00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00109 #ifndef __vtkSmartVolumeMapper_h
00110 #define __vtkSmartVolumeMapper_h
00111
00112 #include "vtkVolumeMapper.h"
00113 #include "vtkImageReslice.h"
00114
00115 class vtkFixedPointVolumeRayCastMapper;
00116 class vtkGPUVolumeRayCastMapper;
00117 class vtkImageResample;
00118 class vtkRenderWindow;
00119 class vtkVolume;
00120 class vtkVolumeProperty;
00121 class vtkVolumeTextureMapper3D;
00122
00123 class VTK_VOLUMERENDERING_EXPORT vtkSmartVolumeMapper : public vtkVolumeMapper
00124 {
00125 public:
00126 static vtkSmartVolumeMapper *New();
00127 vtkTypeMacro(vtkSmartVolumeMapper,vtkVolumeMapper);
00128 void PrintSelf( ostream& os, vtkIndent indent );
00129
00131
00137 vtkSetMacro( FinalColorWindow, float );
00139
00141
00142 vtkGetMacro( FinalColorWindow, float );
00144
00146
00150 vtkSetMacro( FinalColorLevel, float );
00152
00154
00155 vtkGetMacro( FinalColorLevel, float );
00157
00158
00159
00160 enum
00161 {
00162 DefaultRenderMode=0,
00163 RayCastAndTextureRenderMode,
00164 RayCastRenderMode,
00165 TextureRenderMode,
00166 GPURenderMode,
00167 UndefinedRenderMode,
00168 InvalidRenderMode
00169 };
00170
00171
00174 void SetRequestedRenderMode(int mode);
00175
00180 void SetRequestedRenderModeToDefault();
00181
00187 void SetRequestedRenderModeToRayCastAndTexture();
00188
00193 void SetRequestedRenderModeToRayCast();
00194
00196
00197 vtkGetMacro( RequestedRenderMode, int );
00199
00201
00206 vtkSetClampMacro( InteractiveUpdateRate, double, 1.0e-10, 1.0e10 );
00208
00210
00212 vtkGetMacro( InteractiveUpdateRate, double );
00214
00217 int GetLastUsedRenderMode();
00218
00220
00224 vtkSetMacro( MaxMemoryInBytes, vtkIdType );
00225 vtkGetMacro( MaxMemoryInBytes, vtkIdType );
00227
00229
00232 vtkSetClampMacro( MaxMemoryFraction, float, 0.1f, 1.0f );
00233 vtkGetMacro( MaxMemoryFraction, float );
00235
00237
00239 vtkSetClampMacro(InterpolationMode, int,
00240 VTK_RESLICE_NEAREST, VTK_RESLICE_CUBIC);
00241 vtkGetMacro(InterpolationMode, int);
00242 void SetInterpolationModeToNearestNeighbor();
00243 void SetInterpolationModeToLinear();
00244 void SetInterpolationModeToCubic();
00246
00248
00251 void CreateCanonicalView( vtkRenderer *ren,
00252 vtkVolume *volume,
00253 vtkVolume *volume2,
00254 vtkImageData *image,
00255 int blend_mode,
00256 double viewDirection[3],
00257 double viewUp[3] );
00259
00260
00261
00264 void Render( vtkRenderer *, vtkVolume * );
00265
00267
00271 void ReleaseGraphicsResources(vtkWindow *);
00272
00274
00275 protected:
00276 vtkSmartVolumeMapper();
00277 ~vtkSmartVolumeMapper();
00278
00282 void ConnectMapperInput(vtkVolumeMapper *m);
00283
00287 void ConnectFilterInput(vtkImageResample *f);
00288
00289
00290 float FinalColorWindow;
00291 float FinalColorLevel;
00292
00293
00294 vtkIdType MaxMemoryInBytes;
00295 float MaxMemoryFraction;
00296
00297
00298 int InterpolationMode;
00299
00300
00301
00302
00303 int RequestedRenderMode;
00304 int CurrentRenderMode;
00305
00306
00307 int Initialized;
00308 vtkTimeStamp SupportStatusCheckTime;
00309 int TextureSupported;
00310 int GPUSupported;
00311 int RayCastSupported;
00312 int LowResGPUNecessary;
00313
00314
00315
00316 vtkImageResample *GPUResampleFilter;
00317
00318
00319
00320
00321 double InteractiveUpdateRate;
00322
00323
00324
00325 void Initialize(vtkRenderer *ren,
00326 vtkVolume *vol);
00327
00328
00329
00330 void ComputeRenderMode(vtkRenderer *ren,
00331 vtkVolume *vol);
00332
00333
00334 vtkGPUVolumeRayCastMapper *GPULowResMapper;
00335 vtkGPUVolumeRayCastMapper *GPUMapper;
00336 vtkFixedPointVolumeRayCastMapper *RayCastMapper;
00337 vtkVolumeTextureMapper3D *TextureMapper;
00338
00339
00340
00341
00342
00343 int InitializedBlendMode;
00344
00345 private:
00346 vtkSmartVolumeMapper(const vtkSmartVolumeMapper&);
00347 void operator=(const vtkSmartVolumeMapper&);
00348 };
00349
00350 #endif