00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00029 #ifndef __vtkGPUVolumeRayCastMapper_h
00030 #define __vtkGPUVolumeRayCastMapper_h
00031
00032 #include "vtkVolumeMapper.h"
00033
00034 class vtkVolumeProperty;
00035 class vtkRenderWindow;
00036
00037
00038
00039 class VTK_VOLUMERENDERING_EXPORT vtkGPUVolumeRayCastMapper : public vtkVolumeMapper
00040 {
00041 public:
00042 static vtkGPUVolumeRayCastMapper *New();
00043 vtkTypeMacro(vtkGPUVolumeRayCastMapper,vtkVolumeMapper);
00044 void PrintSelf( ostream& os, vtkIndent indent );
00045
00047
00050 vtkSetClampMacro( AutoAdjustSampleDistances, int, 0, 1 );
00051 vtkGetMacro( AutoAdjustSampleDistances, int );
00052 vtkBooleanMacro( AutoAdjustSampleDistances, int );
00054
00056
00059 vtkSetMacro( SampleDistance, float );
00060 vtkGetMacro( SampleDistance, float );
00062
00064
00069 vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
00070 vtkGetMacro( ImageSampleDistance, float );
00072
00074
00076 vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
00077 vtkGetMacro( MinimumImageSampleDistance, float );
00079
00081
00083 vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
00084 vtkGetMacro( MaximumImageSampleDistance, float );
00086
00087
00089
00095 vtkSetMacro( FinalColorWindow, float );
00096 vtkGetMacro( FinalColorWindow, float );
00097 vtkSetMacro( FinalColorLevel, float );
00098 vtkGetMacro( FinalColorLevel, float );
00100
00102
00104 vtkSetMacro( MaxMemoryInBytes, vtkIdType );
00105 vtkGetMacro( MaxMemoryInBytes, vtkIdType );
00107
00109
00111 vtkSetClampMacro( MaxMemoryFraction, float, 0.1f, 1.0f );
00112 vtkGetMacro( MaxMemoryFraction, float );
00114
00116
00121 vtkSetMacro(ReportProgress,bool);
00122 vtkGetMacro(ReportProgress,bool);
00124
00126
00130 virtual int IsRenderSupported(vtkRenderWindow *vtkNotUsed(window),
00131 vtkVolumeProperty *vtkNotUsed(property))
00132 {
00133 return 0;
00134 }
00136
00137 void CreateCanonicalView( vtkRenderer *ren,
00138 vtkVolume *volume,
00139 vtkImageData *image,
00140 int blend_mode,
00141 double viewDirection[3],
00142 double viewUp[3] );
00143
00145
00160 void SetMaskInput(vtkImageData *mask);
00161 vtkGetObjectMacro(MaskInput, vtkImageData);
00163
00164
00165 enum { BinaryMaskType = 0, LabelMapMaskType };
00166
00167
00169
00171 vtkSetMacro( MaskType, int );
00172 vtkGetMacro( MaskType, int );
00173 void SetMaskTypeToBinary();
00174 void SetMaskTypeToLabelMap();
00176
00178
00183 vtkSetClampMacro(MaskBlendFactor,float,0.0f,1.0f);
00184 vtkGetMacro(MaskBlendFactor,float);
00186
00187
00190 void Render( vtkRenderer *, vtkVolume * );
00191
00194 virtual void GPURender( vtkRenderer *, vtkVolume *) {}
00195
00200 void ReleaseGraphicsResources(vtkWindow *) {};
00201
00210 virtual void GetReductionRatio(double ratio[3])=0;
00211
00212
00213
00214 protected:
00215 vtkGPUVolumeRayCastMapper();
00216 ~vtkGPUVolumeRayCastMapper();
00217
00218
00219 int ValidateRender( vtkRenderer *, vtkVolume * );
00220
00221
00222
00223
00224 void CanonicalViewRender( vtkRenderer *, vtkVolume * );
00225
00226
00227 virtual void PreRender(vtkRenderer *ren,
00228 vtkVolume *vol,
00229 double datasetBounds[6],
00230 double scalarRange[2],
00231 int numberOfScalarComponents,
00232 unsigned int numberOfLevels)=0;
00233
00234
00235 virtual void RenderBlock(vtkRenderer *ren,
00236 vtkVolume *vol,
00237 unsigned int level)=0;
00238
00239 virtual void PostRender(vtkRenderer *ren,
00240 int numberOfScalarComponents)=0;
00241
00244 void SetCellFlag(int cellFlag);
00245
00246
00247 float SampleDistance;
00248
00249
00250 float ImageSampleDistance;
00251 float MinimumImageSampleDistance;
00252 float MaximumImageSampleDistance;
00253 int AutoAdjustSampleDistances;
00254
00255 int SmallVolumeRender;
00256 double BigTimeToDraw;
00257 double SmallTimeToDraw;
00258
00259 float FinalColorWindow;
00260 float FinalColorLevel;
00261
00262 vtkIdType MaxMemoryInBytes;
00263 float MaxMemoryFraction;
00264
00265
00266
00267 int GeneratingCanonicalView;
00268 vtkImageData *CanonicalViewImageData;
00269
00271
00273 vtkSetClampMacro(AMRMode,int,0,1);
00274 vtkGetMacro(AMRMode,int);
00275 vtkBooleanMacro(AMRMode,int);
00277
00278 int AMRMode;
00279 int CellFlag;
00280
00290 virtual void ClipCroppingRegionPlanes();
00291
00292 double ClippedCroppingRegionPlanes[6];
00293 bool ReportProgress;
00294 vtkImageData * MaskInput;
00295 float MaskBlendFactor;
00296 int MaskType;
00297 vtkImageData * TransformedInput;
00298
00299 vtkGetObjectMacro(TransformedInput, vtkImageData);
00300 void SetTransformedInput(vtkImageData*);
00301
00304 vtkImageData* LastInput;
00305
00306 private:
00307 vtkGPUVolumeRayCastMapper(const vtkGPUVolumeRayCastMapper&);
00308 void operator=(const vtkGPUVolumeRayCastMapper&);
00309 };
00310
00311 #endif
00312