VTK  9.2.5
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 
48 #ifndef vtkUnstructuredGridVolumeRayCastMapper_h
49 #define vtkUnstructuredGridVolumeRayCastMapper_h
50 
51 #include "vtkRenderingVolumeModule.h" // For export macro
53 
54 class vtkDoubleArray;
55 class vtkIdList;
56 class vtkMultiThreader;
58 class vtkRenderer;
59 class vtkTimerLog;
63 class vtkVolume;
64 
65 class VTKRENDERINGVOLUME_EXPORT vtkUnstructuredGridVolumeRayCastMapper
67 {
68 public:
71  void PrintSelf(ostream& os, vtkIndent indent) override;
72 
74 
79  vtkSetClampMacro(ImageSampleDistance, float, 0.1f, 100.0f);
80  vtkGetMacro(ImageSampleDistance, float);
82 
84 
88  vtkSetClampMacro(MinimumImageSampleDistance, float, 0.1f, 100.0f);
89  vtkGetMacro(MinimumImageSampleDistance, float);
91 
93 
97  vtkSetClampMacro(MaximumImageSampleDistance, float, 0.1f, 100.0f);
98  vtkGetMacro(MaximumImageSampleDistance, float);
100 
102 
108  vtkSetClampMacro(AutoAdjustSampleDistances, vtkTypeBool, 0, 1);
109  vtkGetMacro(AutoAdjustSampleDistances, vtkTypeBool);
110  vtkBooleanMacro(AutoAdjustSampleDistances, vtkTypeBool);
112 
114 
118  vtkSetMacro(NumberOfThreads, int);
119  vtkGetMacro(NumberOfThreads, int);
121 
123 
127  vtkSetClampMacro(IntermixIntersectingGeometry, vtkTypeBool, 0, 1);
128  vtkGetMacro(IntermixIntersectingGeometry, vtkTypeBool);
129  vtkBooleanMacro(IntermixIntersectingGeometry, vtkTypeBool);
131 
133 
137  vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
139 
141 
146  vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
148 
153  void Render(vtkRenderer*, vtkVolume*) override;
154 
162 
163  vtkGetVectorMacro(ImageInUseSize, int, 2);
164  vtkGetVectorMacro(ImageOrigin, int, 2);
165  vtkGetVectorMacro(ImageViewportSize, int, 2);
166 
167  void CastRays(int threadID, int threadCount);
168 
169 protected:
172 
177 
180 
182 
183  // This is how big the image would be if it covered the entire viewport
184  int ImageViewportSize[2];
185 
186  // This is how big the allocated memory for image is. This may be bigger
187  // or smaller than ImageFullSize - it will be bigger if necessary to
188  // ensure a power of 2, it will be smaller if the volume only covers a
189  // small region of the viewport
190  int ImageMemorySize[2];
191 
192  // This is the size of subregion in ImageSize image that we are using for
193  // the current image. Since ImageSize is a power of 2, there is likely
194  // wasted space in it. This number will be used for things such as clearing
195  // the image if necessary.
196  int ImageInUseSize[2];
197 
198  // This is the location in ImageFullSize image where our ImageSize image
199  // is located.
200  int ImageOrigin[2];
201 
202  // This is the allocated image
203  unsigned char* Image;
204 
210 
211  void StoreRenderTime(vtkRenderer* ren, vtkVolume* vol, float t);
213 
215 
216  float* ZBuffer;
217  int ZBufferSize[2];
218  int ZBufferOrigin[2];
219 
220  // Get the ZBuffer value corresponding to location (x,y) where (x,y)
221  // are indexing into the ImageInUse image. This must be converted to
222  // the zbuffer image coordinates. Nearest neighbor value is returned.
223  double GetZBufferValue(int x, int y);
224 
226 
231 
236 
239 
242 
243 private:
245  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&) = delete;
246 };
247 
248 #endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:165
dynamic, self-adjusting array of double
list of point or cell ids
Definition: vtkIdList.h:143
a simple class to control print indentation
Definition: vtkIndent.h:119
A class for performing multithreaded execution.
helper class that draws the image to the screen
abstract specification for renderers
Definition: vtkRenderer.h:182
Timer support and logging.
Definition: vtkTimerLog.h:205
Abstract class for an unstructured grid volume mapper.
vtkUnstructuredGridVolumeRayCastIterator is a superclass for iterating over the intersections of a vi...
A software mapper for unstructured volumes.
vtkUnstructuredGridVolumeRayIntegrator * RealRayIntegrator
void Render(vtkRenderer *, vtkVolume *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Initialize rendering for this volume.
vtkUnstructuredGridVolumeRayIntegrator * RayIntegrator
vtkUnstructuredGridVolumeRayCastIterator ** RayCastIterators
virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction *f)
Set/Get the helper class for casting rays.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void CastRays(int threadID, int threadCount)
static vtkUnstructuredGridVolumeRayCastMapper * New()
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkUnstructuredGridVolumeRayCastFunction * RayCastFunction
void StoreRenderTime(vtkRenderer *ren, vtkVolume *vol, float t)
float RetrieveRenderTime(vtkRenderer *ren, vtkVolume *vol)
virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator *ri)
Set/Get the helper class for integrating rays.
double GetMinimumBoundsDepth(vtkRenderer *ren, vtkVolume *vol)
a superclass for volume ray integration functions
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:140
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
int vtkTypeBool
Definition: vtkABI.h:69