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 
131  virtual int IsRenderSupported(vtkRenderWindow *vtkNotUsed(window),
132  vtkVolumeProperty *vtkNotUsed(property))
133  {
134  return 0;
135  }
137 
138  void CreateCanonicalView( vtkRenderer *ren,
139  vtkVolume *volume,
141  int blend_mode,
142  double viewDirection[3],
143  double viewUp[3] );
144 
146 
161  void SetMaskInput(vtkImageData *mask);
162  vtkGetObjectMacro(MaskInput, vtkImageData);
164 
165  //BTX
166  enum { BinaryMaskType = 0, LabelMapMaskType };
167  //ETX
168 
170 
172  vtkSetMacro( MaskType, int );
173  vtkGetMacro( MaskType, int );
174  void SetMaskTypeToBinary();
175  void SetMaskTypeToLabelMap();
177 
179 
184  vtkSetClampMacro(MaskBlendFactor,float,0.0f,1.0f);
185  vtkGetMacro(MaskBlendFactor,float);
187 
189 
193  vtkSetMacro(RenderToImage, int);
194  vtkGetMacro(RenderToImage, int);
195  vtkBooleanMacro(RenderToImage, int);
197 
201  virtual void GetDepthImage(vtkImageData*) {};
202 
206  virtual void GetColorImage(vtkImageData*) {};
207 
208 //BTX
211  void Render( vtkRenderer *, vtkVolume * );
212 
215  virtual void GPURender( vtkRenderer *, vtkVolume *) {}
216 
222 
231  virtual void GetReductionRatio(double ratio[3])=0;
232 
233 //ETX
234 
235 protected:
238 
239  // Check to see that the render will be OK
240  int ValidateRender( vtkRenderer *, vtkVolume * );
241 
242 
243  // Special version of render called during the creation
244  // of a canonical view.
245  void CanonicalViewRender( vtkRenderer *, vtkVolume * );
246 
247  // Methods called by the AMR Volume Mapper.
248  virtual void PreRender(vtkRenderer *ren,
249  vtkVolume *vol,
250  double datasetBounds[6],
251  double scalarRange[2],
252  int numberOfScalarComponents,
253  unsigned int numberOfLevels)=0;
254 
255  // \pre input is up-to-date
256  virtual void RenderBlock(vtkRenderer *ren,
257  vtkVolume *vol,
258  unsigned int level)=0;
259 
260  virtual void PostRender(vtkRenderer *ren,
261  int numberOfScalarComponents)=0;
262 
265  void SetCellFlag(int cellFlag);
266 
271 
272  // Render to texture mode flag
274 
275  // The distance between sample points along the ray
277 
281 
284 
285  // 1 if we are generating the canonical image, 0 otherwise
288 
290 
292  vtkSetClampMacro(AMRMode,int,0,1);
293  vtkGetMacro(AMRMode,int);
294  vtkBooleanMacro(AMRMode,int);
296 
299  int MaskType;
300 
301  int AMRMode;
302 
303  // Point data or cell data (or field data, not handled) ?
304  int CellFlag;
305 
315  virtual void ClipCroppingRegionPlanes();
316 
317  double ClippedCroppingRegionPlanes[6];
318 
321 
323 
325 
326  vtkGetObjectMacro(TransformedInput, vtkImageData);
327  void SetTransformedInput(vtkImageData*);
328 
332 
333 private:
334  vtkGPUVolumeRayCastMapper(const vtkGPUVolumeRayCastMapper&); // Not implemented.
335  void operator=(const vtkGPUVolumeRayCastMapper&); // Not implemented.
336 };
337 
338 #endif
339 
virtual void GPURender(vtkRenderer *, vtkVolume *)
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:49
Abstract class for a volume mapper.
void PrintSelf(ostream &os, vtkIndent indent)
virtual void GetDepthImage(vtkImageData *)
#define VTKRENDERINGVOLUME_EXPORT
virtual void GetColorImage(vtkImageData *)
abstract specification for renderers
Definition: vtkRenderer.h:62
int vtkIdType
Definition: vtkType.h:247
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
a simple class to control print indentation
Definition: vtkIndent.h:38
topologically and geometrically regular array of data
Definition: vtkImageData.h:44
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.