VTK
vtkUnstructuredGridVolumeRayCastMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkUnstructuredGridVolumeRayCastMapper.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 =========================================================================*/
15 
29 #ifndef vtkUnstructuredGridVolumeRayCastMapper_h
30 #define vtkUnstructuredGridVolumeRayCastMapper_h
31 
32 #include "vtkRenderingVolumeModule.h" // For export macro
34 
35 class vtkDoubleArray;
36 class vtkIdList;
37 class vtkMultiThreader;
39 class vtkRenderer;
40 class vtkTimerLog;
44 class vtkVolume;
45 
47 {
48 public:
51  void PrintSelf( ostream& os, vtkIndent indent ) override;
52 
54 
59  vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
60  vtkGetMacro( ImageSampleDistance, float );
62 
64 
68  vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
69  vtkGetMacro( MinimumImageSampleDistance, float );
71 
73 
77  vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
78  vtkGetMacro( MaximumImageSampleDistance, float );
80 
82 
88  vtkSetClampMacro( AutoAdjustSampleDistances, vtkTypeBool, 0, 1 );
89  vtkGetMacro( AutoAdjustSampleDistances, vtkTypeBool );
90  vtkBooleanMacro( AutoAdjustSampleDistances, vtkTypeBool );
92 
94 
98  vtkSetMacro( NumberOfThreads, int );
99  vtkGetMacro( NumberOfThreads, int );
101 
103 
107  vtkSetClampMacro( IntermixIntersectingGeometry, vtkTypeBool, 0, 1 );
108  vtkGetMacro( IntermixIntersectingGeometry, vtkTypeBool );
109  vtkBooleanMacro( IntermixIntersectingGeometry, vtkTypeBool );
111 
113 
116  virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction *f);
117  vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
119 
121 
125  virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator *ri);
126  vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
128 
133  void Render( vtkRenderer *, vtkVolume * ) override;
134 
141  void ReleaseGraphicsResources(vtkWindow *) override;
142 
143  vtkGetVectorMacro( ImageInUseSize, int, 2 );
144  vtkGetVectorMacro( ImageOrigin, int, 2 );
145  vtkGetVectorMacro( ImageViewportSize, int , 2 );
146 
147  void CastRays( int threadID, int threadCount );
148 
149 protected:
152 
157 
160 
162 
163  // This is how big the image would be if it covered the entire viewport
164  int ImageViewportSize[2];
165 
166  // This is how big the allocated memory for image is. This may be bigger
167  // or smaller than ImageFullSize - it will be bigger if necessary to
168  // ensure a power of 2, it will be smaller if the volume only covers a
169  // small region of the viewport
170  int ImageMemorySize[2];
171 
172  // This is the size of subregion in ImageSize image that we are using for
173  // the current image. Since ImageSize is a power of 2, there is likely
174  // wasted space in it. This number will be used for things such as clearing
175  // the image if necessary.
176  int ImageInUseSize[2];
177 
178  // This is the location in ImageFullSize image where our ImageSize image
179  // is located.
180  int ImageOrigin[2];
181 
182  // This is the allocated image
183  unsigned char *Image;
184 
190 
191  void StoreRenderTime( vtkRenderer *ren, vtkVolume *vol, float t );
192  float RetrieveRenderTime( vtkRenderer *ren, vtkVolume *vol );
193 
195 
196  float *ZBuffer;
197  int ZBufferSize[2];
198  int ZBufferOrigin[2];
199 
200  // Get the ZBuffer value corresponding to location (x,y) where (x,y)
201  // are indexing into the ImageInUse image. This must be converted to
202  // the zbuffer image coordinates. Nearest neighbor value is returned.
203  double GetZBufferValue( int x, int y );
204 
205  double GetMinimumBoundsDepth( vtkRenderer *ren,
206  vtkVolume *vol );
207 
212 
217 
220 
223 
224 private:
226  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&) = delete;
227 };
228 
229 #endif
230 
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:50
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkUnstructuredGridVolumeRayIntegrator * RayIntegrator
vtkUnstructuredGridVolumeRayCastIterator ** RayCastIterators
vtkUnstructuredGridVolumeRayCastFunction * RayCastFunction
A class for performing multithreaded execution.
A software mapper for unstructured volumes.
abstract specification for renderers
Definition: vtkRenderer.h:63
void Render(vtkRenderer *ren, vtkVolume *vol) override=0
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
helper class that draws the image to the screen
dynamic, self-adjusting array of double
a superclass for volume ray integration functions
int vtkTypeBool
Definition: vtkABI.h:69
Timer support and logging.
Definition: vtkTimerLog.h:91
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
Abstract class for an unstructured grid volume mapper.
list of point or cell ids
Definition: vtkIdList.h:36
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkUnstructuredGridVolumeRayCastIterator is a superclass for iterating over the intersections of a vi...
vtkUnstructuredGridVolumeRayIntegrator * RealRayIntegrator
static vtkAlgorithm * New()