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 
38 #ifndef vtkUnstructuredGridVolumeRayCastMapper_h
39 #define vtkUnstructuredGridVolumeRayCastMapper_h
40 
41 #include "vtkRenderingVolumeModule.h" // For export macro
43 
44 class vtkDoubleArray;
45 class vtkIdList;
46 class vtkMultiThreader;
48 class vtkRenderer;
49 class vtkTimerLog;
53 class vtkVolume;
54 
55 class VTKRENDERINGVOLUME_EXPORT vtkUnstructuredGridVolumeRayCastMapper
57 {
58 public:
61  void PrintSelf(ostream& os, vtkIndent indent) override;
62 
64 
69  vtkSetClampMacro(ImageSampleDistance, float, 0.1f, 100.0f);
70  vtkGetMacro(ImageSampleDistance, float);
72 
74 
78  vtkSetClampMacro(MinimumImageSampleDistance, float, 0.1f, 100.0f);
79  vtkGetMacro(MinimumImageSampleDistance, float);
81 
83 
87  vtkSetClampMacro(MaximumImageSampleDistance, float, 0.1f, 100.0f);
88  vtkGetMacro(MaximumImageSampleDistance, float);
90 
92 
98  vtkSetClampMacro(AutoAdjustSampleDistances, vtkTypeBool, 0, 1);
99  vtkGetMacro(AutoAdjustSampleDistances, vtkTypeBool);
100  vtkBooleanMacro(AutoAdjustSampleDistances, vtkTypeBool);
102 
104 
108  vtkSetMacro(NumberOfThreads, int);
109  vtkGetMacro(NumberOfThreads, int);
111 
113 
117  vtkSetClampMacro(IntermixIntersectingGeometry, vtkTypeBool, 0, 1);
118  vtkGetMacro(IntermixIntersectingGeometry, vtkTypeBool);
119  vtkBooleanMacro(IntermixIntersectingGeometry, vtkTypeBool);
121 
123 
127  vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
129 
131 
136  vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
138 
143  void Render(vtkRenderer*, vtkVolume*) override;
144 
152 
153  vtkGetVectorMacro(ImageInUseSize, int, 2);
154  vtkGetVectorMacro(ImageOrigin, int, 2);
155  vtkGetVectorMacro(ImageViewportSize, int, 2);
156 
157  void CastRays(int threadID, int threadCount);
158 
159 protected:
162 
167 
170 
172 
173  // This is how big the image would be if it covered the entire viewport
174  int ImageViewportSize[2];
175 
176  // This is how big the allocated memory for image is. This may be bigger
177  // or smaller than ImageFullSize - it will be bigger if necessary to
178  // ensure a power of 2, it will be smaller if the volume only covers a
179  // small region of the viewport
180  int ImageMemorySize[2];
181 
182  // This is the size of subregion in ImageSize image that we are using for
183  // the current image. Since ImageSize is a power of 2, there is likely
184  // wasted space in it. This number will be used for things such as clearing
185  // the image if necessary.
186  int ImageInUseSize[2];
187 
188  // This is the location in ImageFullSize image where our ImageSize image
189  // is located.
190  int ImageOrigin[2];
191 
192  // This is the allocated image
193  unsigned char* Image;
194 
200 
201  void StoreRenderTime(vtkRenderer* ren, vtkVolume* vol, float t);
203 
205 
206  float* ZBuffer;
207  int ZBufferSize[2];
208  int ZBufferOrigin[2];
209 
210  // Get the ZBuffer value corresponding to location (x,y) where (x,y)
211  // are indexing into the ImageInUse image. This must be converted to
212  // the zbuffer image coordinates. Nearest neighbor value is returned.
213  double GetZBufferValue(int x, int y);
214 
216 
221 
226 
229 
232 
233 private:
235  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&) = delete;
236 };
237 
238 #endif
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:65
dynamic, self-adjusting array of double
list of point or cell ids
Definition: vtkIdList.h:43
a simple class to control print indentation
Definition: vtkIndent.h:49
A class for performing multithreaded execution.
helper class that draws the image to the screen
abstract specification for renderers
Definition: vtkRenderer.h:82
Timer support and logging.
Definition: vtkTimerLog.h:105
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:60
window superclass for vtkRenderWindow
Definition: vtkWindow.h:48
int vtkTypeBool
Definition: vtkABI.h:69