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 
26 #ifndef vtkUnstructuredGridVolumeRayCastMapper_h
27 #define vtkUnstructuredGridVolumeRayCastMapper_h
28 
29 #include "vtkRenderingVolumeModule.h" // For export macro
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 class vtkDoubleArray;
34 class vtkIdList;
35 class vtkMultiThreader;
37 class vtkRenderer;
38 class vtkTimerLog;
42 class vtkVolume;
43 
44 class VTKRENDERINGVOLUME_EXPORT vtkUnstructuredGridVolumeRayCastMapper
46 {
47 public:
50  void PrintSelf(ostream& os, vtkIndent indent) override;
51 
53 
58  vtkSetClampMacro(ImageSampleDistance, float, 0.1f, 100.0f);
59  vtkGetMacro(ImageSampleDistance, float);
61 
63 
67  vtkSetClampMacro(MinimumImageSampleDistance, float, 0.1f, 100.0f);
68  vtkGetMacro(MinimumImageSampleDistance, float);
70 
72 
76  vtkSetClampMacro(MaximumImageSampleDistance, float, 0.1f, 100.0f);
77  vtkGetMacro(MaximumImageSampleDistance, float);
79 
81 
87  vtkSetClampMacro(AutoAdjustSampleDistances, vtkTypeBool, 0, 1);
88  vtkGetMacro(AutoAdjustSampleDistances, vtkTypeBool);
89  vtkBooleanMacro(AutoAdjustSampleDistances, vtkTypeBool);
91 
93 
97  vtkSetMacro(NumberOfThreads, int);
98  vtkGetMacro(NumberOfThreads, int);
100 
102 
106  vtkSetClampMacro(IntermixIntersectingGeometry, vtkTypeBool, 0, 1);
107  vtkGetMacro(IntermixIntersectingGeometry, vtkTypeBool);
108  vtkBooleanMacro(IntermixIntersectingGeometry, vtkTypeBool);
110 
112 
116  vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
118 
120 
125  vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
127 
132  void Render(vtkRenderer*, vtkVolume*) override;
133 
141 
142  vtkGetVectorMacro(ImageInUseSize, int, 2);
143  vtkGetVectorMacro(ImageOrigin, int, 2);
144  vtkGetVectorMacro(ImageViewportSize, int, 2);
145 
146  void CastRays(int threadID, int threadCount);
147 
148 protected:
151 
156 
159 
161 
162  // This is how big the image would be if it covered the entire viewport
163  int ImageViewportSize[2];
164 
165  // This is how big the allocated memory for image is. This may be bigger
166  // or smaller than ImageFullSize - it will be bigger if necessary to
167  // ensure a power of 2, it will be smaller if the volume only covers a
168  // small region of the viewport
169  int ImageMemorySize[2];
170 
171  // This is the size of subregion in ImageSize image that we are using for
172  // the current image. Since ImageSize is a power of 2, there is likely
173  // wasted space in it. This number will be used for things such as clearing
174  // the image if necessary.
175  int ImageInUseSize[2];
176 
177  // This is the location in ImageFullSize image where our ImageSize image
178  // is located.
179  int ImageOrigin[2];
180 
181  // This is the allocated image
182  unsigned char* Image;
183 
189 
190  void StoreRenderTime(vtkRenderer* ren, vtkVolume* vol, float t);
192 
194 
195  float* ZBuffer;
196  int ZBufferSize[2];
197  int ZBufferOrigin[2];
198 
199  // Get the ZBuffer value corresponding to location (x,y) where (x,y)
200  // are indexing into the ImageInUse image. This must be converted to
201  // the zbuffer image coordinates. Nearest neighbor value is returned.
202  double GetZBufferValue(int x, int y);
203 
205 
210 
215 
218 
221 
222 private:
224  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&) = delete;
225 };
226 
227 VTK_ABI_NAMESPACE_END
228 #endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
dynamic, self-adjusting array of double
list of point or cell ids
Definition: vtkIdList.h:32
a simple class to control print indentation
Definition: vtkIndent.h:38
A class for performing multithreaded execution.
helper class that draws the image to the screen
abstract specification for renderers
Definition: vtkRenderer.h:71
Timer support and logging.
Definition: vtkTimerLog.h:94
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:49
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
int vtkTypeBool
Definition: vtkABI.h:64