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
00039
00084 #ifndef __vtkMapper_h
00085 #define __vtkMapper_h
00086
00087 #include "vtkAbstractMapper3D.h"
00088 #include "vtkScalarsToColors.h"
00089 #include "vtkDataSet.h"
00090
00091 #define VTK_SCALAR_MODE_DEFAULT 0
00092 #define VTK_SCALAR_MODE_USE_POINT_DATA 1
00093 #define VTK_SCALAR_MODE_USE_CELL_DATA 2
00094
00095 #define VTK_RESOLVE_OFF 0
00096 #define VTK_RESOLVE_POLYGON_OFFSET 1
00097 #define VTK_RESOLVE_SHIFT_ZBUFFER 2
00098
00099 class vtkWindow;
00100 class vtkRenderer;
00101 class vtkActor;
00102
00103 class VTK_EXPORT vtkMapper : public vtkAbstractMapper3D
00104 {
00105 public:
00106 vtkTypeMacro(vtkMapper,vtkAbstractMapper3D);
00107 void PrintSelf(ostream& os, vtkIndent indent);
00108
00110 void ShallowCopy(vtkMapper *m);
00111
00114 unsigned long GetMTime();
00115
00118 virtual void Render(vtkRenderer *ren, vtkActor *a) = 0;
00119
00123 virtual void ReleaseGraphicsResources(vtkWindow *) {};
00124
00126 void SetLookupTable(vtkScalarsToColors *lut);
00127 vtkScalarsToColors *GetLookupTable();
00128
00131 virtual void CreateDefaultLookupTable();
00132
00135 vtkSetMacro(ScalarVisibility,int);
00136 vtkGetMacro(ScalarVisibility,int);
00137 vtkBooleanMacro(ScalarVisibility,int);
00138
00148 vtkSetMacro(ColorMode,int);
00149 vtkGetMacro(ColorMode,int);
00150 void SetColorModeToDefault()
00151 {this->SetColorMode(VTK_COLOR_MODE_DEFAULT);};
00152 void SetColorModeToMapScalars()
00153 {this->SetColorMode(VTK_COLOR_MODE_MAP_SCALARS);};
00154 void SetColorModeToLuminance()
00155 {this->SetColorMode(VTK_COLOR_MODE_LUMINANCE);};
00156
00158 const char *GetColorModeAsString();
00159
00165 vtkSetMacro(ImmediateModeRendering,int);
00166 vtkGetMacro(ImmediateModeRendering,int);
00167 vtkBooleanMacro(ImmediateModeRendering,int);
00168
00174 static void SetGlobalImmediateModeRendering(int val);
00175 static void GlobalImmediateModeRenderingOn()
00176 {vtkMapper::SetGlobalImmediateModeRendering(1);};
00177 static void GlobalImmediateModeRenderingOff()
00178 {vtkMapper::SetGlobalImmediateModeRendering(0);};
00179 static int GetGlobalImmediateModeRendering();
00180
00183 vtkSetVector2Macro(ScalarRange,float);
00184 vtkGetVectorMacro(ScalarRange,float,2);
00185
00187 virtual void Update();
00188
00192 vtkScalars *GetColors();
00193
00200 vtkSetMacro(ScalarMode,int);
00201 vtkGetMacro(ScalarMode,int);
00202 void SetScalarModeToDefault() {
00203 this->SetScalarMode(VTK_SCALAR_MODE_DEFAULT);};
00204 void SetScalarModeToUsePointData() {
00205 this->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_DATA);};
00206 void SetScalarModeToUseCellData() {
00207 this->SetScalarMode(VTK_SCALAR_MODE_USE_CELL_DATA);};
00208
00210 const char *GetScalarModeAsString();
00211
00222 static void SetResolveCoincidentTopology(int val);
00223 static int GetResolveCoincidentTopology();
00224 static void SetResolveCoincidentTopologyToDefault();
00225 static void SetResolveCoincidentTopologyToOff()
00226 {SetResolveCoincidentTopology(VTK_RESOLVE_OFF);};
00227 static void SetResolveCoincidentTopologyToPolygonOffset()
00228 {SetResolveCoincidentTopology(VTK_RESOLVE_POLYGON_OFFSET);};
00229 static void SetResolveCoincidentTopologyToShiftZBuffer()
00230 {SetResolveCoincidentTopology(VTK_RESOLVE_SHIFT_ZBUFFER);};
00231
00234 static void SetResolveCoincidentTopologyZShift(double val);
00235 static double GetResolveCoincidentTopologyZShift();
00236
00239 virtual float *GetBounds();
00240 virtual void GetBounds(float bounds[6])
00241 {this->vtkAbstractMapper3D::GetBounds(bounds);};
00242
00246 void SetRenderTime(float time) {this->RenderTime = time;}
00247 vtkGetMacro(RenderTime, float);
00248
00249
00252 vtkDataSet *GetInput();
00253
00254
00258 vtkDataSet *GetInputAsDataSet() { return this->GetInput(); };
00259
00260 protected:
00261 vtkMapper();
00262 ~vtkMapper();
00263 vtkMapper(const vtkMapper&) {};
00264 void operator=(const vtkMapper&) {};
00265
00266 vtkScalars *Colors;
00267
00268 vtkScalarsToColors *LookupTable;
00269 int ScalarVisibility;
00270 vtkTimeStamp BuildTime;
00271 float ScalarRange[2];
00272 int ImmediateModeRendering;
00273 int ColorMode;
00274 int ScalarMode;
00275
00276 float RenderTime;
00277
00278 };
00279
00280 #endif
00281
00282