00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00038 #ifndef __vtkPolyDataMapper2D_h
00039 #define __vtkPolyDataMapper2D_h
00040
00041
00042 #include "vtkMapper2D.h"
00043
00044 class vtkCoordinate;
00045 class vtkPolyData;
00046 class vtkScalarsToColors;
00047 class vtkUnsignedCharArray;
00048
00049 class VTK_RENDERING_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
00050 {
00051 public:
00052 vtkTypeMacro(vtkPolyDataMapper2D,vtkMapper2D);
00053 static vtkPolyDataMapper2D *New();
00054 void PrintSelf(ostream& os, vtkIndent indent);
00055
00057
00058 void SetInput(vtkPolyData *in);
00059 vtkPolyData *GetInput();
00061
00063
00064 void SetLookupTable(vtkScalarsToColors *lut);
00065 vtkScalarsToColors *GetLookupTable();
00067
00070 virtual void CreateDefaultLookupTable();
00071
00073
00075 vtkSetMacro(ScalarVisibility,int);
00076 vtkGetMacro(ScalarVisibility,int);
00077 vtkBooleanMacro(ScalarVisibility,int);
00079
00081
00088 vtkSetMacro(ColorMode,int);
00089 vtkGetMacro(ColorMode,int);
00090 void SetColorModeToDefault();
00091 void SetColorModeToMapScalars();
00093
00095 const char *GetColorModeAsString();
00096
00098
00104 vtkSetMacro(UseLookupTableScalarRange,int);
00105 vtkGetMacro(UseLookupTableScalarRange,int);
00106 vtkBooleanMacro(UseLookupTableScalarRange,int);
00108
00110
00113 vtkSetVector2Macro(ScalarRange,double);
00114 vtkGetVectorMacro(ScalarRange,double,2);
00116
00118
00128 vtkSetMacro(ScalarMode,int);
00129 vtkGetMacro(ScalarMode,int);
00130 void SetScalarModeToDefault() {
00131 this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT);};
00132 void SetScalarModeToUsePointData() {
00133 this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA);};
00134 void SetScalarModeToUseCellData() {
00135 this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA);};
00136 void SetScalarModeToUsePointFieldData() {
00137 this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);};
00138 void SetScalarModeToUseCellFieldData() {
00139 this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);};
00141
00143
00144 void ColorByArrayComponent(int arrayNum, int component);
00145 void ColorByArrayComponent(char* arrayName, int component);
00147
00149
00150 char* GetArrayName() { return this->ArrayName; }
00151 int GetArrayId() { return this->ArrayId; }
00152 int GetArrayAccessMode() { return this->ArrayAccessMode; }
00153 int GetArrayComponent() { return this->ArrayComponent; }
00155
00158 virtual unsigned long GetMTime();
00159
00161
00165 virtual void SetTransformCoordinate(vtkCoordinate*);
00166 vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
00168
00174 vtkUnsignedCharArray *MapScalars(double alpha);
00175
00177 void ShallowCopy(vtkAbstractMapper *m);
00178
00179 protected:
00180 vtkPolyDataMapper2D();
00181 ~vtkPolyDataMapper2D();
00182
00183 vtkUnsignedCharArray *Colors;
00184
00185 vtkScalarsToColors *LookupTable;
00186 int ScalarVisibility;
00187 vtkTimeStamp BuildTime;
00188 double ScalarRange[2];
00189 int UseLookupTableScalarRange;
00190 int ColorMode;
00191 int ScalarMode;
00192
00193 vtkCoordinate *TransformCoordinate;
00194
00195 virtual int FillInputPortInformation(int, vtkInformation*);
00196
00197
00198 int ArrayId;
00199 char ArrayName[256];
00200 int ArrayComponent;
00201 int ArrayAccessMode;
00202 private:
00203 vtkPolyDataMapper2D(const vtkPolyDataMapper2D&);
00204 void operator=(const vtkPolyDataMapper2D&);
00205 };
00206
00207
00208 #endif
00209