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 "vtkVolumeMapper.h"
33 
34 class vtkVolumeProperty;
35 class vtkRenderWindow;
36 
37 //class vtkKWAMRVolumeMapper; // friend class.
38 
40 {
41 public:
44  void PrintSelf( ostream& os, vtkIndent indent );
45 
47 
50  vtkSetClampMacro( AutoAdjustSampleDistances, int, 0, 1 );
51  vtkGetMacro( AutoAdjustSampleDistances, int );
52  vtkBooleanMacro( AutoAdjustSampleDistances, int );
54 
56 
59  vtkSetMacro( SampleDistance, float );
60  vtkGetMacro( SampleDistance, float );
62 
64 
69  vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
70  vtkGetMacro( ImageSampleDistance, float );
72 
74 
76  vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
77  vtkGetMacro( MinimumImageSampleDistance, float );
79 
81 
83  vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
84  vtkGetMacro( MaximumImageSampleDistance, float );
86 
87 
89 
95  vtkSetMacro( FinalColorWindow, float );
96  vtkGetMacro( FinalColorWindow, float );
97  vtkSetMacro( FinalColorLevel, float );
98  vtkGetMacro( FinalColorLevel, float );
100 
102 
104  vtkSetMacro( MaxMemoryInBytes, vtkIdType );
105  vtkGetMacro( MaxMemoryInBytes, vtkIdType );
107 
109 
111  vtkSetClampMacro( MaxMemoryFraction, float, 0.1f, 1.0f );
112  vtkGetMacro( MaxMemoryFraction, float );
114 
116 
121  vtkSetMacro(ReportProgress,bool);
122  vtkGetMacro(ReportProgress,bool);
124 
126 
130  virtual int IsRenderSupported(vtkRenderWindow *vtkNotUsed(window),
131  vtkVolumeProperty *vtkNotUsed(property))
132  {
133  return 0;
134  }
136 
137  void CreateCanonicalView( vtkRenderer *ren,
138  vtkVolume *volume,
140  int blend_mode,
141  double viewDirection[3],
142  double viewUp[3] );
143 
145 
160  void SetMaskInput(vtkImageData *mask);
161  vtkGetObjectMacro(MaskInput, vtkImageData);
163 
164  //BTX
165  enum { BinaryMaskType = 0, LabelMapMaskType };
166  //ETX
167 
169 
171  vtkSetMacro( MaskType, int );
172  vtkGetMacro( MaskType, int );
173  void SetMaskTypeToBinary();
174  void SetMaskTypeToLabelMap();
176 
178 
183  vtkSetClampMacro(MaskBlendFactor,float,0.0f,1.0f);
184  vtkGetMacro(MaskBlendFactor,float);
186 
187 //BTX
190  void Render( vtkRenderer *, vtkVolume * );
191 
194  virtual void GPURender( vtkRenderer *, vtkVolume *) {}
195 
201 
210  virtual void GetReductionRatio(double ratio[3])=0;
211 
212 //ETX
213 
214 protected:
217 
218  // Check to see that the render will be OK
219  int ValidateRender( vtkRenderer *, vtkVolume * );
220 
221 
222  // Special version of render called during the creation
223  // of a canonical view.
224  void CanonicalViewRender( vtkRenderer *, vtkVolume * );
225 
226  // Methods called by the AMR Volume Mapper.
227  virtual void PreRender(vtkRenderer *ren,
228  vtkVolume *vol,
229  double datasetBounds[6],
230  double scalarRange[2],
231  int numberOfScalarComponents,
232  unsigned int numberOfLevels)=0;
233 
234  // \pre input is up-to-date
235  virtual void RenderBlock(vtkRenderer *ren,
236  vtkVolume *vol,
237  unsigned int level)=0;
238 
239  virtual void PostRender(vtkRenderer *ren,
240  int numberOfScalarComponents)=0;
241 
244  void SetCellFlag(int cellFlag);
245 
246  // The distance between sample points along the ray
248 
249 
254 
258 
261 
264 
265 
266  // 1 if we are generating the canonical image, 0 otherwise
269 
271 
273  vtkSetClampMacro(AMRMode,int,0,1);
274  vtkGetMacro(AMRMode,int);
275  vtkBooleanMacro(AMRMode,int);
277 
278  int AMRMode;
279  int CellFlag; // point data or cell data (or field data, not handled) ?
280 
290  virtual void ClipCroppingRegionPlanes();
291 
292  double ClippedCroppingRegionPlanes[6];
296  int MaskType;
298 
299  vtkGetObjectMacro(TransformedInput, vtkImageData);
300  void SetTransformedInput(vtkImageData*);
301 
305 
306 private:
307  vtkGPUVolumeRayCastMapper(const vtkGPUVolumeRayCastMapper&); // Not implemented.
308  void operator=(const vtkGPUVolumeRayCastMapper&); // Not implemented.
309 };
310 
311 #endif
312 
virtual void GPURender(vtkRenderer *, vtkVolume *)
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:48
Abstract class for a volume mapper.
void PrintSelf(ostream &os, vtkIndent indent)
#define VTK_VOLUMERENDERING_EXPORT
abstract specification for renderers
Definition: vtkRenderer.h:69
int vtkIdType
Definition: vtkType.h:255
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
a simple class to control print indentation
Definition: vtkIndent.h:37
topologically and geometrically regular array of data
Definition: vtkImageData.h:43
virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0
represents the common properties for rendering a volume.
virtual int IsRenderSupported(vtkRenderWindow *vtkNotUsed(window), vtkVolumeProperty *vtkNotUsed(property))
create a window for renderers to draw into
static vtkAlgorithm * New()
Ray casting performed on the GPU.