VTK  9.2.6
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 
46 class VTKRENDERINGVOLUME_EXPORT vtkUnstructuredGridVolumeRayCastMapper
48 {
49 public:
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
55 
60  vtkSetClampMacro(ImageSampleDistance, float, 0.1f, 100.0f);
61  vtkGetMacro(ImageSampleDistance, float);
63 
65 
69  vtkSetClampMacro(MinimumImageSampleDistance, float, 0.1f, 100.0f);
70  vtkGetMacro(MinimumImageSampleDistance, float);
72 
74 
78  vtkSetClampMacro(MaximumImageSampleDistance, float, 0.1f, 100.0f);
79  vtkGetMacro(MaximumImageSampleDistance, float);
81 
83 
89  vtkSetClampMacro(AutoAdjustSampleDistances, vtkTypeBool, 0, 1);
90  vtkGetMacro(AutoAdjustSampleDistances, vtkTypeBool);
91  vtkBooleanMacro(AutoAdjustSampleDistances, vtkTypeBool);
93 
95 
99  vtkSetMacro(NumberOfThreads, int);
100  vtkGetMacro(NumberOfThreads, int);
102 
104 
108  vtkSetClampMacro(IntermixIntersectingGeometry, vtkTypeBool, 0, 1);
109  vtkGetMacro(IntermixIntersectingGeometry, vtkTypeBool);
110  vtkBooleanMacro(IntermixIntersectingGeometry, vtkTypeBool);
112 
114 
117  virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction* f);
118  vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
120 
122 
126  virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator* ri);
127  vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
129 
134  void Render(vtkRenderer*, vtkVolume*) override;
135 
142  void ReleaseGraphicsResources(vtkWindow*) override;
143 
144  vtkGetVectorMacro(ImageInUseSize, int, 2);
145  vtkGetVectorMacro(ImageOrigin, int, 2);
146  vtkGetVectorMacro(ImageViewportSize, int, 2);
147 
148  void CastRays(int threadID, int threadCount);
149 
150 protected:
153 
158 
161 
163 
164  // This is how big the image would be if it covered the entire viewport
165  int ImageViewportSize[2];
166 
167  // This is how big the allocated memory for image is. This may be bigger
168  // or smaller than ImageFullSize - it will be bigger if necessary to
169  // ensure a power of 2, it will be smaller if the volume only covers a
170  // small region of the viewport
171  int ImageMemorySize[2];
172 
173  // This is the size of subregion in ImageSize image that we are using for
174  // the current image. Since ImageSize is a power of 2, there is likely
175  // wasted space in it. This number will be used for things such as clearing
176  // the image if necessary.
177  int ImageInUseSize[2];
178 
179  // This is the location in ImageFullSize image where our ImageSize image
180  // is located.
181  int ImageOrigin[2];
182 
183  // This is the allocated image
184  unsigned char* Image;
185 
191 
192  void StoreRenderTime(vtkRenderer* ren, vtkVolume* vol, float t);
193  float RetrieveRenderTime(vtkRenderer* ren, vtkVolume* vol);
194 
196 
197  float* ZBuffer;
198  int ZBufferSize[2];
199  int ZBufferOrigin[2];
200 
201  // Get the ZBuffer value corresponding to location (x,y) where (x,y)
202  // are indexing into the ImageInUse image. This must be converted to
203  // the zbuffer image coordinates. Nearest neighbor value is returned.
204  double GetZBufferValue(int x, int y);
205 
206  double GetMinimumBoundsDepth(vtkRenderer* ren, vtkVolume* vol);
207 
212 
217 
220 
223 
224 private:
226  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&) = delete;
227 };
228 
229 #endif
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:72
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:95
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
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:33
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkUnstructuredGridVolumeRayCastIterator is a superclass for iterating over the intersections of a vi...
vtkUnstructuredGridVolumeRayIntegrator * RealRayIntegrator
static vtkAlgorithm * New()