00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00065 #ifndef __vtkPolyDataMapper2D_h
00066 #define __vtkPolyDataMapper2D_h
00067
00068
00069 #include "vtkMapper2D.h"
00070 #include "vtkWindow.h"
00071 #include "vtkViewport.h"
00072 #include "vtkActor2D.h"
00073 #include "vtkProperty2D.h"
00074 #include "vtkScalarsToColors.h"
00075 #include "vtkPolyData.h"
00076
00077 class VTK_RENDERING_EXPORT vtkPolyDataMapper2D : public vtkMapper2D
00078 {
00079 public:
00080 vtkTypeMacro(vtkPolyDataMapper2D,vtkMapper2D);
00081 static vtkPolyDataMapper2D *New();
00082 void PrintSelf(ostream& os, vtkIndent indent);
00083
00085
00086 vtkSetObjectMacro(Input, vtkPolyData);
00087 vtkGetObjectMacro(Input, vtkPolyData);
00089
00091
00092 void SetLookupTable(vtkScalarsToColors *lut);
00093 vtkScalarsToColors *GetLookupTable();
00095
00098 virtual void CreateDefaultLookupTable();
00099
00101
00103 vtkSetMacro(ScalarVisibility,int);
00104 vtkGetMacro(ScalarVisibility,int);
00105 vtkBooleanMacro(ScalarVisibility,int);
00107
00109
00116 vtkSetMacro(ColorMode,int);
00117 vtkGetMacro(ColorMode,int);
00118 void SetColorModeToDefault()
00119 {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);};
00120 void SetColorModeToMapScalars()
00121 {this->SetColorMode(VTK_COLOR_MODE_MAP_SCALARS);};
00123
00125 const char *GetColorModeAsString();
00126
00128
00134 vtkSetMacro(UseLookupTableScalarRange,int);
00135 vtkGetMacro(UseLookupTableScalarRange,int);
00136 vtkBooleanMacro(UseLookupTableScalarRange,int);
00138
00140
00143 vtkSetVector2Macro(ScalarRange,float);
00144 vtkGetVectorMacro(ScalarRange,float,2);
00146
00148
00158 vtkSetMacro(ScalarMode,int);
00159 vtkGetMacro(ScalarMode,int);
00160 void SetScalarModeToDefault() {
00161 this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT);};
00162 void SetScalarModeToUsePointData() {
00163 this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA);};
00164 void SetScalarModeToUseCellData() {
00165 this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA);};
00166 void SetScalarModeToUsePointFieldData() {
00167 this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);};
00168 void SetScalarModeToUseCellFieldData() {
00169 this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_FIELD_DATA);};
00171
00173
00174 void ColorByArrayComponent(int arrayNum, int component);
00175 void ColorByArrayComponent(char* arrayName, int component);
00177
00179
00180 char* GetArrayName() { return this->ArrayName; }
00181 int GetArrayId() { return this->ArrayId; }
00182 int GetArrayAccessMode() { return this->ArrayAccessMode; }
00183 int GetArrayComponent() { return this->ArrayComponent; }
00185
00188 virtual unsigned long GetMTime();
00189
00191
00195 vtkSetObjectMacro(TransformCoordinate, vtkCoordinate);
00196 vtkGetObjectMacro(TransformCoordinate, vtkCoordinate);
00198
00204 vtkUnsignedCharArray *MapScalars(float alpha);
00205
00207 void ShallowCopy(vtkAbstractMapper *m);
00208
00209 protected:
00210 vtkPolyDataMapper2D();
00211 ~vtkPolyDataMapper2D();
00212
00213 vtkPolyData* Input;
00214
00215 vtkUnsignedCharArray *Colors;
00216
00217 vtkScalarsToColors *LookupTable;
00218 int ScalarVisibility;
00219 vtkTimeStamp BuildTime;
00220 float ScalarRange[2];
00221 int UseLookupTableScalarRange;
00222 int ColorMode;
00223 int ScalarMode;
00224
00225 vtkCoordinate *TransformCoordinate;
00226
00227
00228 int ArrayId;
00229 char ArrayName[256];
00230 int ArrayComponent;
00231 int ArrayAccessMode;
00232 private:
00233 vtkPolyDataMapper2D(const vtkPolyDataMapper2D&);
00234 void operator=(const vtkPolyDataMapper2D&);
00235 };
00236
00237
00238 #endif
00239