00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00031 #ifndef __vtkSMDataObjectDisplayProxy_h
00032 #define __vtkSMDataObjectDisplayProxy_h
00033
00034 #include "vtkSMConsumerDisplayProxy.h"
00035 class vtkSMProxy;
00036 class vtkPVDataInformation;
00037 class vtkPVArrayInformation;
00038 class vtkSMSourceProxy;
00039
00040 class VTK_EXPORT vtkSMDataObjectDisplayProxy : public vtkSMConsumerDisplayProxy
00041 {
00042 public:
00043 static vtkSMDataObjectDisplayProxy* New();
00044 vtkTypeRevisionMacro(vtkSMDataObjectDisplayProxy, vtkSMConsumerDisplayProxy);
00045 void PrintSelf(ostream& os, vtkIndent indent);
00046
00048 virtual void CacheUpdate(int idx, int total);
00049
00052 virtual void AddInput(vtkSMSourceProxy* input, const char*, int);
00053
00055 void SetInput(vtkSMProxy* input);
00056
00059 virtual void Update();
00060
00065 virtual void InvalidateGeometry();
00066
00068
00069 virtual void AddToRenderModule(vtkSMRenderModuleProxy*);
00070 virtual void RemoveFromRenderModule(vtkSMRenderModuleProxy*);
00072
00075 virtual vtkPVGeometryInformation* GetGeometryInformation();
00076
00077
00079 virtual void SetRepresentation(int representation);
00080
00082 virtual void SetVisibility(int visible);
00083
00085
00087 vtkGetMacro(HasVolumePipeline, int);
00088 vtkGetMacro(SupportsBunykMapper, int);
00089 vtkGetMacro(SupportsZSweepMapper, int);
00091
00093
00096 vtkGetMacro(VolumeRenderMode, int);
00098
00101 void ResetTransferFunctions();
00102
00104
00105 void SetVolumeMapperToBunykCM();
00106 void SetVolumeMapperToPTCM();
00107 void SetVolumeMapperToZSweepCM();
00109
00111 virtual int GetVolumeMapperTypeCM();
00112
00115 void SetInputAsGeometryFilter(vtkSMProxy* onProxy);
00116
00120 virtual void MarkConsumersAsModified();
00121
00122
00123
00124 enum {FLAT=0, GOURAND, PHONG};
00125
00126 enum {DEFAULT=0, POINT_DATA, CELL_DATA, POINT_FIELD_DATA, CELL_FIELD_DATA};
00127
00128 enum {POINTS=0, WIREFRAME, SURFACE, OUTLINE, VOLUME};
00129
00130 enum
00131 {
00132 PROJECTED_TETRA_VOLUME_MAPPER =0,
00133 ZSWEEP_VOLUME_MAPPER,
00134 BUNYK_RAY_CAST_VOLUME_MAPPER,
00135 UNKNOWN_VOLUME_MAPPER
00136 };
00137
00138
00140
00141 int GetInterpolationCM();
00142 void SetInterpolationCM(int interpolation);
00144
00146
00147 void SetPointSizeCM(double size);
00148 double GetPointSizeCM();
00150
00152
00153 void SetLineWidthCM(double width);
00154 double GetLineWidthCM();
00156
00158
00159 void SetScalarModeCM(int mode);
00160 int GetScalarModeCM();
00162
00164
00165 void SetScalarArrayCM(const char* arrayname);
00166 const char* GetScalarArrayCM();
00168
00170
00171 void SetOpacityCM(double op);
00172 double GetOpacityCM();
00174
00176
00177 void SetColorModeCM(int mode);
00178 int GetColorModeCM();
00180
00182
00183 void SetColorCM(double rgb[3]);
00184 void GetColorCM(double rgb[3]);
00185 void SetColorCM(double r, double g, double b)
00186 {
00187 double rgb[3]; rgb[0] = r; rgb[1] = g; rgb[2] =b;
00188 this->SetColorCM(rgb);
00189 }
00191
00192
00194
00196 void SetInterpolateScalarsBeforeMappingCM(int flag);
00197 int GetInterpolateScalarsBeforeMappingCM();
00199
00201
00202 void SetScalarVisibilityCM(int);
00203 int GetScalarVisibilityCM();
00205
00207
00208 void SetPositionCM(double pos[3]);
00209 void GetPositionCM(double pos[3]);
00210 void SetPositionCM(double r, double g, double b)
00211 {
00212 double rgb[3]; rgb[0] = r; rgb[1] = g; rgb[2] =b;
00213 this->SetPositionCM(rgb);
00214 }
00216
00218
00219 void SetScaleCM(double scale[3]);
00220 void GetScaleCM(double scale[3]);
00221 void SetScaleCM(double r, double g, double b)
00222 {
00223 double rgb[3]; rgb[0] = r; rgb[1] = g; rgb[2] =b;
00224 this->SetScaleCM(rgb);
00225 }
00227
00229
00230 void SetOrientationCM(double orientation[3]);
00231 void GetOrientationCM(double orientation[3]);
00232 void SetOrientationCM(double r, double g, double b)
00233 {
00234 double rgb[3]; rgb[0] = r; rgb[1] = g; rgb[2] =b;
00235 this->SetOrientationCM(rgb);
00236 }
00238
00240
00241 void GetOriginCM(double origin[3]);
00242 void SetOriginCM(double origin[3]);
00243 void SetOriginCM(double r, double g, double b)
00244 {
00245 double rgb[3]; rgb[0] = r; rgb[1] = g; rgb[2] =b;
00246 this->SetOriginCM(rgb);
00247 }
00249
00251
00252 void SetRepresentationCM(int r);
00253 int GetRepresentationCM();
00255
00257
00258 void SetImmediateModeRenderingCM(int f);
00259 int GetImmediateModeRenderingCM();
00261 protected:
00262 vtkSMDataObjectDisplayProxy();
00263 ~vtkSMDataObjectDisplayProxy();
00264
00265 void SetInputInternal(vtkSMSourceProxy* input);
00266
00267 void ResetTransferFunctions(vtkPVDataInformation* dataInfo,
00268 vtkPVArrayInformation* arrayInfo);
00269
00271
00272 virtual void SetupPipeline();
00273 virtual void SetupDefaults();
00275
00277
00278 virtual void SetupVolumePipeline();
00279 virtual void SetupVolumeDefaults();
00281
00282
00283 virtual void CreateVTKObjects(int numObjects);
00284
00285 virtual void GatherGeometryInformation();
00286
00287
00288
00289
00290
00291 friend class vtkPVComparativeVisManager;
00292 friend class vtkPVComparativeVis;
00293 friend class vtkSMComparativeVisProxy;
00294 vtkGetObjectMacro(MapperProxy, vtkSMProxy);
00295 vtkGetObjectMacro(ActorProxy, vtkSMProxy);
00296 vtkGetObjectMacro(GeometryFilterProxy, vtkSMProxy);
00297
00298
00299 vtkSMProxy *GeometryFilterProxy;
00300 vtkSMProxy *UpdateSuppressorProxy;
00301 vtkSMProxy *MapperProxy;
00302 vtkSMProxy *PropertyProxy;
00303 vtkSMProxy *ActorProxy;
00304
00305 vtkSMProxy* VolumeFilterProxy;
00306 vtkSMProxy* VolumeUpdateSuppressorProxy;
00307 vtkSMProxy* VolumePTMapperProxy;
00308 vtkSMProxy* VolumeBunykMapperProxy;
00309 vtkSMProxy* VolumeZSweepMapperProxy;
00310 vtkSMProxy* VolumeActorProxy;
00311 vtkSMProxy* VolumePropertyProxy;
00312 vtkSMProxy* OpacityFunctionProxy;
00313 vtkSMProxy* ColorTransferFunctionProxy;
00314
00315 int HasVolumePipeline;
00316 int SupportsZSweepMapper;
00317 int SupportsBunykMapper;
00318
00319
00320
00321
00322
00323 int VolumeRenderMode;
00324
00326
00327 virtual void VolumeRenderModeOn();
00328 virtual void VolumeRenderModeOff();
00330
00331
00332 int Visibility;
00333 int Representation;
00334
00335 int GeometryIsValid;
00336 int VolumeGeometryIsValid;
00337 int CanCreateProxy;
00338
00339 int GeometryInformationIsValid;
00340 vtkPVGeometryInformation* GeometryInformation;
00341
00342 virtual void InvalidateGeometryInternal();
00343 private:
00344 vtkSMDataObjectDisplayProxy(const vtkSMDataObjectDisplayProxy&);
00345 void operator=(const vtkSMDataObjectDisplayProxy&);
00346 };
00347
00348
00349 #endif
00350