VTK  9.4.20250102
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
36#ifndef vtkUnstructuredGridVolumeRayCastMapper_h
37#define vtkUnstructuredGridVolumeRayCastMapper_h
38
39#include "vtkRenderingVolumeModule.h" // For export macro
41
42VTK_ABI_NAMESPACE_BEGIN
43class vtkDoubleArray;
44class vtkIdList;
47class vtkRenderer;
48class vtkTimerLog;
52class vtkVolume;
53
54class VTKRENDERINGVOLUME_EXPORT vtkUnstructuredGridVolumeRayCastMapper
56{
57public:
60 void PrintSelf(ostream& os, vtkIndent indent) override;
61
63
68 vtkSetClampMacro(ImageSampleDistance, float, 0.1f, 100.0f);
69 vtkGetMacro(ImageSampleDistance, float);
71
73
77 vtkSetClampMacro(MinimumImageSampleDistance, float, 0.1f, 100.0f);
78 vtkGetMacro(MinimumImageSampleDistance, float);
80
82
86 vtkSetClampMacro(MaximumImageSampleDistance, float, 0.1f, 100.0f);
87 vtkGetMacro(MaximumImageSampleDistance, float);
89
91
97 vtkSetClampMacro(AutoAdjustSampleDistances, vtkTypeBool, 0, 1);
98 vtkGetMacro(AutoAdjustSampleDistances, vtkTypeBool);
99 vtkBooleanMacro(AutoAdjustSampleDistances, vtkTypeBool);
101
103
107 vtkSetMacro(NumberOfThreads, int);
108 vtkGetMacro(NumberOfThreads, int);
110
112
116 vtkSetClampMacro(IntermixIntersectingGeometry, vtkTypeBool, 0, 1);
117 vtkGetMacro(IntermixIntersectingGeometry, vtkTypeBool);
118 vtkBooleanMacro(IntermixIntersectingGeometry, vtkTypeBool);
120
122
126 vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
128
130
135 vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
137
142 void Render(vtkRenderer*, vtkVolume*) override;
143
151
152 vtkGetVectorMacro(ImageInUseSize, int, 2);
153 vtkGetVectorMacro(ImageOrigin, int, 2);
154 vtkGetVectorMacro(ImageViewportSize, int, 2);
155
156 void CastRays(int threadID, int threadCount);
157
158protected:
161
166
169
171
172 // This is how big the image would be if it covered the entire viewport
173 int ImageViewportSize[2];
174
175 // This is how big the allocated memory for image is. This may be bigger
176 // or smaller than ImageFullSize - it will be bigger if necessary to
177 // ensure a power of 2, it will be smaller if the volume only covers a
178 // small region of the viewport
179 int ImageMemorySize[2];
180
181 // This is the size of subregion in ImageSize image that we are using for
182 // the current image. Since ImageSize is a power of 2, there is likely
183 // wasted space in it. This number will be used for things such as clearing
184 // the image if necessary.
185 int ImageInUseSize[2];
186
187 // This is the location in ImageFullSize image where our ImageSize image
188 // is located.
189 int ImageOrigin[2];
190
191 // This is the allocated image
192 unsigned char* Image;
193
199
200 void StoreRenderTime(vtkRenderer* ren, vtkVolume* vol, float t);
202
204
205 float* ZBuffer;
206 int ZBufferSize[2];
207 int ZBufferOrigin[2];
208
209 // Get the ZBuffer value corresponding to location (x,y) where (x,y)
210 // are indexing into the ImageInUse image. This must be converted to
211 // the zbuffer image coordinates. Nearest neighbor value is returned.
212 double GetZBufferValue(int x, int y);
213
215
220
225
228
231
232private:
234 void operator=(const vtkUnstructuredGridVolumeRayCastMapper&) = delete;
235};
236
237VTK_ABI_NAMESPACE_END
238#endif
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of double
list of point or cell ids
Definition vtkIdList.h:133
a simple class to control print indentation
Definition vtkIndent.h:108
A class for performing multithreaded execution.
helper class that draws the image to the screen
abstract specification for renderers
Timer support and logging.
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:130
window superclass for vtkRenderWindow
Definition vtkWindow.h:48
int vtkTypeBool
Definition vtkABI.h:64