VTK
vtkGPUVolumeRayCastMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkGPUVolumeRayCastMapper.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
29 #ifndef vtkGPUVolumeRayCastMapper_h
30 #define vtkGPUVolumeRayCastMapper_h
31 
32 #include "vtkRenderingVolumeModule.h" // For export macro
33 #include "vtkVolumeMapper.h"
34 
35 class vtkVolumeProperty;
36 class vtkRenderWindow;
37 
38 //class vtkKWAMRVolumeMapper; // friend class.
39 
41 {
42 public:
45  void PrintSelf( ostream& os, vtkIndent indent );
46 
48 
51  vtkSetClampMacro( AutoAdjustSampleDistances, int, 0, 1 );
52  vtkGetMacro( AutoAdjustSampleDistances, int );
53  vtkBooleanMacro( AutoAdjustSampleDistances, int );
55 
57 
60  vtkSetMacro( SampleDistance, float );
61  vtkGetMacro( SampleDistance, float );
63 
65 
70  vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
71  vtkGetMacro( ImageSampleDistance, float );
73 
75 
77  vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
78  vtkGetMacro( MinimumImageSampleDistance, float );
80 
82 
84  vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
85  vtkGetMacro( MaximumImageSampleDistance, float );
87 
88 
90 
96  vtkSetMacro( FinalColorWindow, float );
97  vtkGetMacro( FinalColorWindow, float );
98  vtkSetMacro( FinalColorLevel, float );
99  vtkGetMacro( FinalColorLevel, float );
101 
103 
105  vtkSetMacro( MaxMemoryInBytes, vtkIdType );
106  vtkGetMacro( MaxMemoryInBytes, vtkIdType );
108 
110 
112  vtkSetClampMacro( MaxMemoryFraction, float, 0.1f, 1.0f );
113  vtkGetMacro( MaxMemoryFraction, float );
115 
117 
122  vtkSetMacro(ReportProgress,bool);
123  vtkGetMacro(ReportProgress,bool);
125 
127 
132  vtkVolumeProperty *vtkNotUsed(property))
133  {
134  return 0;
135  }
137 
139  vtkVolume *volume,
141  int blend_mode,
142  double viewDirection[3],
143  double viewUp[3] );
144 
146 
164 
165  //BTX
166  enum { BinaryMaskType = 0, LabelMapMaskType };
167  //ETX
168 
170 
172  vtkSetMacro( MaskType, int );
173  vtkGetMacro( MaskType, int );
177 
179 
184  vtkSetClampMacro(MaskBlendFactor,float,0.0f,1.0f);
185  vtkGetMacro(MaskBlendFactor,float);
187 
188 //BTX
192 
195  virtual void GPURender( vtkRenderer *, vtkVolume *) {}
196 
202 
211  virtual void GetReductionRatio(double ratio[3])=0;
212 
213 //ETX
214 
215 protected:
218 
219  // Check to see that the render will be OK
221 
222 
223  // Special version of render called during the creation
224  // of a canonical view.
226 
227  // Methods called by the AMR Volume Mapper.
228  virtual void PreRender(vtkRenderer *ren,
229  vtkVolume *vol,
230  double datasetBounds[6],
231  double scalarRange[2],
232  int numberOfScalarComponents,
233  unsigned int numberOfLevels)=0;
234 
235  // \pre input is up-to-date
236  virtual void RenderBlock(vtkRenderer *ren,
237  vtkVolume *vol,
238  unsigned int level)=0;
239 
240  virtual void PostRender(vtkRenderer *ren,
241  int numberOfScalarComponents)=0;
242 
245  void SetCellFlag(int cellFlag);
246 
247  // The distance between sample points along the ray
249 
250 
255 
259 
262 
265 
266 
267  // 1 if we are generating the canonical image, 0 otherwise
270 
272 
274  vtkSetClampMacro(AMRMode,int,0,1);
275  vtkGetMacro(AMRMode,int);
276  vtkBooleanMacro(AMRMode,int);
278 
279  int AMRMode;
280  int CellFlag; // point data or cell data (or field data, not handled) ?
281 
291  virtual void ClipCroppingRegionPlanes();
292 
293  double ClippedCroppingRegionPlanes[6];
297  int MaskType;
299 
300  vtkGetObjectMacro(TransformedInput, vtkImageData);
302 
306 
307 private:
308  vtkGPUVolumeRayCastMapper(const vtkGPUVolumeRayCastMapper&); // Not implemented.
309  void operator=(const vtkGPUVolumeRayCastMapper&); // Not implemented.
310 };
311 
312 #endif
313 
vtkGPUVolumeRayCastMapper::New
static vtkGPUVolumeRayCastMapper * New()
vtkGPUVolumeRayCastMapper::GeneratingCanonicalView
int GeneratingCanonicalView
Definition: vtkGPUVolumeRayCastMapper.h:268
vtkVolumeMapper
Abstract class for a volume mapper.
Definition: vtkVolumeMapper.h:46
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkGPUVolumeRayCastMapper::PreRender
virtual void PreRender(vtkRenderer *ren, vtkVolume *vol, double datasetBounds[6], double scalarRange[2], int numberOfScalarComponents, unsigned int numberOfLevels)=0
vtkGPUVolumeRayCastMapper::SetMaskInput
void SetMaskInput(vtkImageData *mask)
vtkGPUVolumeRayCastMapper::SetMaskTypeToBinary
void SetMaskTypeToBinary()
vtkGPUVolumeRayCastMapper::Render
void Render(vtkRenderer *, vtkVolume *)
vtkVolume
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:50
vtkGPUVolumeRayCastMapper::BigTimeToDraw
double BigTimeToDraw
Definition: vtkGPUVolumeRayCastMapper.h:257
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkGPUVolumeRayCastMapper::MaxMemoryFraction
float MaxMemoryFraction
Definition: vtkGPUVolumeRayCastMapper.h:264
vtkGPUVolumeRayCastMapper::SetCellFlag
void SetCellFlag(int cellFlag)
vtkGPUVolumeRayCastMapper::TransformedInput
vtkImageData * TransformedInput
Definition: vtkGPUVolumeRayCastMapper.h:298
vtkRenderingVolumeModule.h
vtkGPUVolumeRayCastMapper::ValidateRender
int ValidateRender(vtkRenderer *, vtkVolume *)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkGPUVolumeRayCastMapper::RenderBlock
virtual void RenderBlock(vtkRenderer *ren, vtkVolume *vol, unsigned int level)=0
vtkGPUVolumeRayCastMapper::FinalColorLevel
float FinalColorLevel
Definition: vtkGPUVolumeRayCastMapper.h:261
vtkGPUVolumeRayCastMapper::SampleDistance
float SampleDistance
Definition: vtkGPUVolumeRayCastMapper.h:248
vtkGPUVolumeRayCastMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkGPUVolumeRayCastMapper::PostRender
virtual void PostRender(vtkRenderer *ren, int numberOfScalarComponents)=0
vtkGPUVolumeRayCastMapper::MaximumImageSampleDistance
float MaximumImageSampleDistance
Definition: vtkGPUVolumeRayCastMapper.h:253
vtkGPUVolumeRayCastMapper::vtkGPUVolumeRayCastMapper
vtkGPUVolumeRayCastMapper()
vtkGPUVolumeRayCastMapper::FinalColorWindow
float FinalColorWindow
Definition: vtkGPUVolumeRayCastMapper.h:260
vtkGPUVolumeRayCastMapper::MinimumImageSampleDistance
float MinimumImageSampleDistance
Definition: vtkGPUVolumeRayCastMapper.h:252
vtkGPUVolumeRayCastMapper::CanonicalViewImageData
vtkImageData * CanonicalViewImageData
Definition: vtkGPUVolumeRayCastMapper.h:269
vtkgl::mask
GLenum GLint GLuint mask
Definition: vtkgl.h:11980
vtkGPUVolumeRayCastMapper::CellFlag
int CellFlag
Definition: vtkGPUVolumeRayCastMapper.h:280
vtkGPUVolumeRayCastMapper::MaskBlendFactor
float MaskBlendFactor
Definition: vtkGPUVolumeRayCastMapper.h:296
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkGPUVolumeRayCastMapper::SetTransformedInput
void SetTransformedInput(vtkImageData *)
vtkGPUVolumeRayCastMapper::ClipCroppingRegionPlanes
virtual void ClipCroppingRegionPlanes()
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkNotUsed
#define vtkNotUsed(x)
Definition: vtkSetGet.h:557
vtkVolumeMapper.h
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkGPUVolumeRayCastMapper
Ray casting performed on the GPU.
Definition: vtkGPUVolumeRayCastMapper.h:41
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGPUVolumeRayCastMapper::ImageSampleDistance
float ImageSampleDistance
Definition: vtkGPUVolumeRayCastMapper.h:251
vtkgl::level
GLint level
Definition: vtkgl.h:11316
vtkGPUVolumeRayCastMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *)
Definition: vtkGPUVolumeRayCastMapper.h:201
vtkgl::f
GLclampf f
Definition: vtkgl.h:14181
vtkGPUVolumeRayCastMapper::IsRenderSupported
virtual int IsRenderSupported(vtkRenderWindow *vtkNotUsed(window), vtkVolumeProperty *vtkNotUsed(property))
Definition: vtkGPUVolumeRayCastMapper.h:131
vtkGPUVolumeRayCastMapper::AMRMode
int AMRMode
Definition: vtkGPUVolumeRayCastMapper.h:276
vtkGPUVolumeRayCastMapper::CreateCanonicalView
void CreateCanonicalView(vtkRenderer *ren, vtkVolume *volume, vtkImageData *image, int blend_mode, double viewDirection[3], double viewUp[3])
vtkGPUVolumeRayCastMapper::~vtkGPUVolumeRayCastMapper
~vtkGPUVolumeRayCastMapper()
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkGPUVolumeRayCastMapper::CanonicalViewRender
void CanonicalViewRender(vtkRenderer *, vtkVolume *)
vtkGPUVolumeRayCastMapper::MaskType
int MaskType
Definition: vtkGPUVolumeRayCastMapper.h:297
vtkGPUVolumeRayCastMapper::SmallVolumeRender
int SmallVolumeRender
Definition: vtkGPUVolumeRayCastMapper.h:256
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkGPUVolumeRayCastMapper::GPURender
virtual void GPURender(vtkRenderer *, vtkVolume *)
Definition: vtkGPUVolumeRayCastMapper.h:195
vtkGPUVolumeRayCastMapper::SetMaskTypeToLabelMap
void SetMaskTypeToLabelMap()
VTKRENDERINGVOLUME_EXPORT
#define VTKRENDERINGVOLUME_EXPORT
Definition: vtkRenderingVolumeModule.h:15
vtkGPUVolumeRayCastMapper::AutoAdjustSampleDistances
int AutoAdjustSampleDistances
Definition: vtkGPUVolumeRayCastMapper.h:254
vtkGPUVolumeRayCastMapper::ReportProgress
bool ReportProgress
Definition: vtkGPUVolumeRayCastMapper.h:294
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:89
vtkGPUVolumeRayCastMapper::LastInput
vtkImageData * LastInput
Definition: vtkGPUVolumeRayCastMapper.h:305
vtkGPUVolumeRayCastMapper::SmallTimeToDraw
double SmallTimeToDraw
Definition: vtkGPUVolumeRayCastMapper.h:258
vtkgl::image
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: vtkgl.h:11341
vtkGPUVolumeRayCastMapper::MaskInput
vtkImageData * MaskInput
Definition: vtkGPUVolumeRayCastMapper.h:295
vtkGPUVolumeRayCastMapper::MaxMemoryInBytes
vtkIdType MaxMemoryInBytes
Definition: vtkGPUVolumeRayCastMapper.h:263
vtkVolumeProperty
represents the common properties for rendering a volume.
Definition: vtkVolumeProperty.h:60
vtkGPUVolumeRayCastMapper::GetReductionRatio
virtual void GetReductionRatio(double ratio[3])=0