VTK
dox/Accelerators/Piston/vtkPistonScalarsColors.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkPistonScalarsColors.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00023 #ifndef __vtkPistonScalarsColors_h
00024 #define __vtkPistonScalarsColors_h
00025 
00026 #include "vtkAcceleratorsPistonModule.h" // For export macro
00027 #include <vtkObject.h>
00028 
00029 #include <vector> // vector is required
00030 
00031 class vtkScalarsToColors;
00032 
00033 class VTKACCELERATORSPISTON_EXPORT vtkPistonScalarsColors : public vtkObject
00034 {
00035 public:
00036   vtkTypeMacro(vtkPistonScalarsColors, vtkObject);
00037 
00040   static vtkPistonScalarsColors *New();
00041 
00046   virtual void PrintSelf(ostream &os, vtkIndent indent);
00047 
00049 
00050   vtkSetMacro(NumberOfValues, int);
00051   // Get number of distinct color values
00052   vtkGetMacro(NumberOfValues, int);
00054 
00056 
00060   void SetTableRange(double range[2]);
00061   virtual void SetTableRange(double rmin, double rmax);
00062   vtkGetVectorMacro(TableRange, double, 2);
00064 
00066 
00067   virtual void SetLookupTable(vtkScalarsToColors *);
00068   vtkGetObjectMacro(LookupTable, vtkScalarsToColors);
00070 
00072 
00074   virtual std::vector<unsigned char>* ComputeScalarsColors(
00075     int numberOfChanels);
00077 
00080   virtual std::vector<float>* ComputeScalarsColorsf(int numberOfChanels);
00081 
00082 
00083 protected:
00084   vtkPistonScalarsColors();
00085   ~vtkPistonScalarsColors();
00086 
00088   void ComputeValues(float *values);
00089 
00090   double TableRange[2];
00091   int NumberOfValues;
00092 
00093   vtkTimeStamp ComputeColorsTime;
00094   std::vector<unsigned char> ScalarsColors;
00095 
00096   vtkTimeStamp ComputeColorsfTime;
00097   std::vector<float> ScalarsColorsf;
00098 
00099   vtkScalarsToColors *LookupTable;
00100 
00101 private:
00102   vtkPistonScalarsColors(const vtkPistonScalarsColors&); // Not implemented.
00103   void operator=(const vtkPistonScalarsColors&);  // Not implemented.
00104 };
00105 
00106 #endif // __vtkPistonScalarsColors_h