00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00024 #ifndef __vtkScalarsToColorsPainter_h
00025 #define __vtkScalarsToColorsPainter_h
00026
00027 #include "vtkPainter.h"
00028 #include "vtkSmartPointer.h"
00029 class vtkDataArray;
00030 class vtkImageData;
00031 class vtkInformationDoubleVectorKey;
00032 class vtkInformationIntegerKey;
00033 class vtkInformationObjectBaseKey;
00034 class vtkInformationStringKey;
00035 class vtkPolyData;
00036 class vtkScalarsToColors;
00037
00038 class VTK_RENDERING_EXPORT vtkScalarsToColorsPainter : public vtkPainter
00039 {
00040 public:
00041 static vtkScalarsToColorsPainter* New();
00042 vtkTypeRevisionMacro(vtkScalarsToColorsPainter, vtkPainter);
00043 void PrintSelf(ostream& os, vtkIndent indent);
00044
00051 static vtkInformationIntegerKey* USE_LOOKUP_TABLE_SCALAR_RANGE();
00052
00056 static vtkInformationDoubleVectorKey* SCALAR_RANGE();
00057
00060 static vtkInformationIntegerKey* SCALAR_MODE();
00061
00067 static vtkInformationIntegerKey* COLOR_MODE();
00068
00072 static vtkInformationIntegerKey* INTERPOLATE_SCALARS_BEFORE_MAPPING();
00073
00075
00076 static vtkInformationObjectBaseKey* LOOKUP_TABLE();
00077 void SetLookupTable(vtkScalarsToColors *lut);
00078 vtkScalarsToColors *GetLookupTable();
00080
00083 virtual void CreateDefaultLookupTable();
00084
00087 static vtkInformationIntegerKey* SCALAR_VISIBILITY();
00088
00090
00091 static vtkInformationIntegerKey* ARRAY_ACCESS_MODE();
00092 static vtkInformationIntegerKey* ARRAY_ID();
00093 static vtkInformationStringKey* ARRAY_NAME();
00094 static vtkInformationIntegerKey* ARRAY_COMPONENT();
00096
00098 static vtkInformationIntegerKey* SCALAR_MATERIAL_MODE();
00099
00100
00101 protected:
00102 vtkScalarsToColorsPainter();
00103 virtual ~vtkScalarsToColorsPainter();
00104
00106 vtkDataObject* NewClone(vtkDataObject* data);
00107
00109
00112 void MapScalarsToTexture(vtkPolyData* output,
00113 vtkDataArray* scalars, vtkPolyData* input);
00115
00117 virtual void PrepareForRendering(vtkRenderer* renderer, vtkActor* actor);
00118
00120
00122 virtual void MapScalars(vtkPolyData* output,
00123 double alpha, int multiply_with_alpha,
00124 vtkPolyData* input);
00126
00129 virtual void ProcessInformation(vtkInformation*);
00130
00133 virtual vtkDataObject *GetOutput();
00134
00136 virtual void ReportReferences(vtkGarbageCollector *collector);
00137
00145 virtual int GetPremultiplyColorsWithAlpha(vtkActor* actor);
00146
00153 int CanUseTextureMapForColoring(vtkDataObject* input);
00154
00155
00157 void UpdateColorTextureMap(double alpha, int multiply_with_alpha);
00158
00159
00160
00161
00162 vtkSetMacro(UseLookupTableScalarRange,int);
00163 vtkSetVector2Macro(ScalarRange,double);
00164 vtkSetMacro(ScalarMode, int);
00165 vtkSetMacro(ColorMode, int);
00166 vtkSetMacro(InterpolateScalarsBeforeMapping,int);
00167 vtkSetMacro(ScalarVisibility,int);
00168 vtkSetMacro(ScalarMaterialMode,int);
00169 vtkSetMacro(ArrayAccessMode, int);
00170 vtkSetMacro(ArrayId, int);
00171 vtkSetStringMacro(ArrayName);
00172 vtkSetMacro(ArrayComponent, int);
00173
00174 vtkDataObject* OutputData;
00175
00176 int ArrayAccessMode;
00177 int ArrayComponent;
00178 int ArrayId;
00179 char* ArrayName;
00180
00181 vtkScalarsToColors *LookupTable;
00182
00183
00184 vtkSmartPointer<vtkScalarsToColors> ScalarsLookupTable;
00185 vtkSmartPointer<vtkImageData> ColorTextureMap;
00186 int ColorMode;
00187 int InterpolateScalarsBeforeMapping;
00188 int ScalarMode;
00189 int ScalarMaterialMode;
00190 double LastUsedAlpha;
00191
00192 double ScalarRange[2];
00193 int ScalarVisibility;
00194 int UseLookupTableScalarRange;
00195
00196 vtkTimeStamp OutputUpdateTime;
00197
00198
00199
00200 int UsingScalarColoring;
00201
00202 private:
00203 vtkScalarsToColorsPainter(const vtkScalarsToColorsPainter&);
00204 void operator=(const vtkScalarsToColorsPainter&);
00205
00206 };
00207
00208 #endif
00209