VTK  9.3.0
vtkUnstructuredGridVolumeRayCastMapper.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
17#ifndef vtkUnstructuredGridVolumeRayCastMapper_h
18#define vtkUnstructuredGridVolumeRayCastMapper_h
19
20#include "vtkRenderingVolumeModule.h" // For export macro
22
23VTK_ABI_NAMESPACE_BEGIN
24class vtkDoubleArray;
25class vtkIdList;
28class vtkRenderer;
29class vtkTimerLog;
33class vtkVolume;
34
35class VTKRENDERINGVOLUME_EXPORT vtkUnstructuredGridVolumeRayCastMapper
37{
38public:
41 void PrintSelf(ostream& os, vtkIndent indent) override;
42
44
49 vtkSetClampMacro(ImageSampleDistance, float, 0.1f, 100.0f);
50 vtkGetMacro(ImageSampleDistance, float);
52
54
58 vtkSetClampMacro(MinimumImageSampleDistance, float, 0.1f, 100.0f);
59 vtkGetMacro(MinimumImageSampleDistance, float);
61
63
67 vtkSetClampMacro(MaximumImageSampleDistance, float, 0.1f, 100.0f);
68 vtkGetMacro(MaximumImageSampleDistance, float);
70
72
78 vtkSetClampMacro(AutoAdjustSampleDistances, vtkTypeBool, 0, 1);
79 vtkGetMacro(AutoAdjustSampleDistances, vtkTypeBool);
80 vtkBooleanMacro(AutoAdjustSampleDistances, vtkTypeBool);
82
84
88 vtkSetMacro(NumberOfThreads, int);
89 vtkGetMacro(NumberOfThreads, int);
91
93
97 vtkSetClampMacro(IntermixIntersectingGeometry, vtkTypeBool, 0, 1);
98 vtkGetMacro(IntermixIntersectingGeometry, vtkTypeBool);
99 vtkBooleanMacro(IntermixIntersectingGeometry, vtkTypeBool);
101
103
107 vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
109
111
116 vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
118
123 void Render(vtkRenderer*, vtkVolume*) override;
124
132
133 vtkGetVectorMacro(ImageInUseSize, int, 2);
134 vtkGetVectorMacro(ImageOrigin, int, 2);
135 vtkGetVectorMacro(ImageViewportSize, int, 2);
136
137 void CastRays(int threadID, int threadCount);
138
139protected:
142
147
150
152
153 // This is how big the image would be if it covered the entire viewport
154 int ImageViewportSize[2];
155
156 // This is how big the allocated memory for image is. This may be bigger
157 // or smaller than ImageFullSize - it will be bigger if necessary to
158 // ensure a power of 2, it will be smaller if the volume only covers a
159 // small region of the viewport
160 int ImageMemorySize[2];
161
162 // This is the size of subregion in ImageSize image that we are using for
163 // the current image. Since ImageSize is a power of 2, there is likely
164 // wasted space in it. This number will be used for things such as clearing
165 // the image if necessary.
166 int ImageInUseSize[2];
167
168 // This is the location in ImageFullSize image where our ImageSize image
169 // is located.
170 int ImageOrigin[2];
171
172 // This is the allocated image
173 unsigned char* Image;
174
180
181 void StoreRenderTime(vtkRenderer* ren, vtkVolume* vol, float t);
183
185
186 float* ZBuffer;
187 int ZBufferSize[2];
188 int ZBufferOrigin[2];
189
190 // Get the ZBuffer value corresponding to location (x,y) where (x,y)
191 // are indexing into the ImageInUse image. This must be converted to
192 // the zbuffer image coordinates. Nearest neighbor value is returned.
193 double GetZBufferValue(int x, int y);
194
196
201
206
209
212
213private:
215 void operator=(const vtkUnstructuredGridVolumeRayCastMapper&) = delete;
216};
217
218VTK_ABI_NAMESPACE_END
219#endif
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of double
list of point or cell ids
Definition vtkIdList.h:23
a simple class to control print indentation
Definition vtkIndent.h:29
A class for performing multithreaded execution.
helper class that draws the image to the screen
abstract specification for renderers
Definition vtkRenderer.h:59
Timer support and logging.
Definition vtkTimerLog.h:85
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.
static vtkUnstructuredGridVolumeRayCastMapper * New()
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)
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:40
window superclass for vtkRenderWindow
Definition vtkWindow.h:25
int vtkTypeBool
Definition vtkABI.h:64