00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00035 #ifndef __vtkPolyDataMapper2D_h
00036 #define __vtkPolyDataMapper2D_h
00037
00038
00039 #include "vtkMapper2D.h"
00040
00041 class vtkCoordinate;
00042 class vtkPolyData;
00043 class vtkScalarsToColors;
00044 class vtkUnsignedCharArray;
00045
00046 class VTK_RENDERING_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
00047 {
00048 public:
00049 vtkTypeRevisionMacro(vtkPolyDataMapper2D,vtkMapper2D);
00050 static vtkPolyDataMapper2D *New();
00051 void PrintSelf(ostream& os, vtkIndent indent);
00052
00054
00055 void SetInput(vtkPolyData *in);
00056 vtkPolyData *GetInput();
00058
00060
00061 void SetLookupTable(vtkScalarsToColors *lut);
00062 vtkScalarsToColors *GetLookupTable();
00064
00067 virtual void CreateDefaultLookupTable();
00068
00070
00072 vtkSetMacro(ScalarVisibility,int);
00073 vtkGetMacro(ScalarVisibility,int);
00074 vtkBooleanMacro(ScalarVisibility,int);
00076
00078
00085 vtkSetMacro(ColorMode,int);
00086 vtkGetMacro(ColorMode,int);
00087 void SetColorModeToDefault();
00088 void SetColorModeToMapScalars();
00090
00092 const char *GetColorModeAsString();
00093
00095
00101 vtkSetMacro(UseLookupTableScalarRange,int);
00102 vtkGetMacro(UseLookupTableScalarRange,int);
00103 vtkBooleanMacro(UseLookupTableScalarRange,int);
00105
00107
00110 vtkSetVector2Macro(ScalarRange,double);
00111 vtkGetVectorMacro(ScalarRange,double,2);
00113
00115
00125 vtkSetMacro(ScalarMode,int);
00126 vtkGetMacro(ScalarMode,int);
00127 void SetScalarModeToDefault() {
00128 this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT);};
00129 void SetScalarModeToUsePointData() {
00130 this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA);};
00131 void SetScalarModeToUseCellData() {
00132 this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA);};
00133 void SetScalarModeToUsePointFieldData() {
00134 this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);};
00135 void SetScalarModeToUseCellFieldData() {
00136 this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);};
00138
00140
00141 void ColorByArrayComponent(int arrayNum, int component);
00142 void ColorByArrayComponent(char* arrayName, int component);
00144
00146
00147 char* GetArrayName() { return this->ArrayName; }
00148 int GetArrayId() { return this->ArrayId; }
00149 int GetArrayAccessMode() { return this->ArrayAccessMode; }
00150 int GetArrayComponent() { return this->ArrayComponent; }
00152
00155 virtual unsigned long GetMTime();
00156
00158
00162 virtual void SetTransformCoordinate(vtkCoordinate*);
00163 vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
00165
00171 vtkUnsignedCharArray *MapScalars(double alpha);
00172
00174 void ShallowCopy(vtkAbstractMapper *m);
00175
00176 protected:
00177 vtkPolyDataMapper2D();
00178 ~vtkPolyDataMapper2D();
00179
00180 vtkUnsignedCharArray *Colors;
00181
00182 vtkScalarsToColors *LookupTable;
00183 int ScalarVisibility;
00184 vtkTimeStamp BuildTime;
00185 double ScalarRange[2];
00186 int UseLookupTableScalarRange;
00187 int ColorMode;
00188 int ScalarMode;
00189
00190 vtkCoordinate *TransformCoordinate;
00191
00192 virtual int FillInputPortInformation(int, vtkInformation*);
00193
00194
00195 int ArrayId;
00196 char ArrayName[256];
00197 int ArrayComponent;
00198 int ArrayAccessMode;
00199 private:
00200 vtkPolyDataMapper2D(const vtkPolyDataMapper2D&);
00201 void operator=(const vtkPolyDataMapper2D&);
00202 };
00203
00204
00205 #endif
00206