VTK  9.0.1
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 
26 #ifndef vtkUnstructuredGridVolumeRayCastMapper_h
27 #define vtkUnstructuredGridVolumeRayCastMapper_h
28 
29 #include "vtkRenderingVolumeModule.h" // For export macro
31 
32 class vtkDoubleArray;
33 class vtkIdList;
34 class vtkMultiThreader;
36 class vtkRenderer;
37 class vtkTimerLog;
41 class vtkVolume;
42 
43 class VTKRENDERINGVOLUME_EXPORT vtkUnstructuredGridVolumeRayCastMapper
45 {
46 public:
49  void PrintSelf(ostream& os, vtkIndent indent) override;
50 
52 
57  vtkSetClampMacro(ImageSampleDistance, float, 0.1f, 100.0f);
58  vtkGetMacro(ImageSampleDistance, float);
60 
62 
66  vtkSetClampMacro(MinimumImageSampleDistance, float, 0.1f, 100.0f);
67  vtkGetMacro(MinimumImageSampleDistance, float);
69 
71 
75  vtkSetClampMacro(MaximumImageSampleDistance, float, 0.1f, 100.0f);
76  vtkGetMacro(MaximumImageSampleDistance, float);
78 
80 
86  vtkSetClampMacro(AutoAdjustSampleDistances, vtkTypeBool, 0, 1);
87  vtkGetMacro(AutoAdjustSampleDistances, vtkTypeBool);
88  vtkBooleanMacro(AutoAdjustSampleDistances, vtkTypeBool);
90 
92 
96  vtkSetMacro(NumberOfThreads, int);
97  vtkGetMacro(NumberOfThreads, int);
99 
101 
105  vtkSetClampMacro(IntermixIntersectingGeometry, vtkTypeBool, 0, 1);
106  vtkGetMacro(IntermixIntersectingGeometry, vtkTypeBool);
107  vtkBooleanMacro(IntermixIntersectingGeometry, vtkTypeBool);
109 
111 
114  virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction* f);
115  vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
117 
119 
123  virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator* ri);
124  vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
126 
131  void Render(vtkRenderer*, vtkVolume*) override;
132 
139  void ReleaseGraphicsResources(vtkWindow*) override;
140 
141  vtkGetVectorMacro(ImageInUseSize, int, 2);
142  vtkGetVectorMacro(ImageOrigin, int, 2);
143  vtkGetVectorMacro(ImageViewportSize, int, 2);
144 
145  void CastRays(int threadID, int threadCount);
146 
147 protected:
150 
155 
158 
160 
161  // This is how big the image would be if it covered the entire viewport
162  int ImageViewportSize[2];
163 
164  // This is how big the allocated memory for image is. This may be bigger
165  // or smaller than ImageFullSize - it will be bigger if necessary to
166  // ensure a power of 2, it will be smaller if the volume only covers a
167  // small region of the viewport
168  int ImageMemorySize[2];
169 
170  // This is the size of subregion in ImageSize image that we are using for
171  // the current image. Since ImageSize is a power of 2, there is likely
172  // wasted space in it. This number will be used for things such as clearing
173  // the image if necessary.
174  int ImageInUseSize[2];
175 
176  // This is the location in ImageFullSize image where our ImageSize image
177  // is located.
178  int ImageOrigin[2];
179 
180  // This is the allocated image
181  unsigned char* Image;
182 
188 
189  void StoreRenderTime(vtkRenderer* ren, vtkVolume* vol, float t);
190  float RetrieveRenderTime(vtkRenderer* ren, vtkVolume* vol);
191 
193 
194  float* ZBuffer;
195  int ZBufferSize[2];
196  int ZBufferOrigin[2];
197 
198  // Get the ZBuffer value corresponding to location (x,y) where (x,y)
199  // are indexing into the ImageInUse image. This must be converted to
200  // the zbuffer image coordinates. Nearest neighbor value is returned.
201  double GetZBufferValue(int x, int y);
202 
203  double GetMinimumBoundsDepth(vtkRenderer* ren, vtkVolume* vol);
204 
209 
214 
217 
220 
221 private:
223  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&) = delete;
224 };
225 
226 #endif
vtkUnstructuredGridVolumeRayCastMapper::AutoAdjustSampleDistances
vtkTypeBool AutoAdjustSampleDistances
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:154
vtkUnstructuredGridVolumeRayCastMapper::ImageSampleDistance
float ImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:151
vtkUnstructuredGridVolumeMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkUnstructuredGridVolumeMapper.h:78
vtkUnstructuredGridVolumeRayIntegrator
a superclass for volume ray integration functions
Definition: vtkUnstructuredGridVolumeRayIntegrator.h:41
vtkUnstructuredGridVolumeRayCastMapper::Scalars
vtkDataArray * Scalars
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:218
vtkUnstructuredGridVolumeRayCastMapper::RenderRendererTable
vtkRenderer ** RenderRendererTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:185
vtkVolume
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:44
vtkRayCastImageDisplayHelper
helper class that draws the image to the screen
Definition: vtkRayCastImageDisplayHelper.h:39
vtkUnstructuredGridVolumeRayCastMapper::NumberOfThreads
int NumberOfThreads
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:157
vtkUnstructuredGridVolumeMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkUnstructuredGridVolumeRayCastMapper::MaximumImageSampleDistance
float MaximumImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:153
vtkUnstructuredGridVolumeRayCastMapper::NearIntersectionsBuffer
vtkDataArray ** NearIntersectionsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:212
vtkUnstructuredGridVolumeRayCastMapper::RealRayIntegrator
vtkUnstructuredGridVolumeRayIntegrator * RealRayIntegrator
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:208
vtkUnstructuredGridVolumeRayCastMapper::RenderTableSize
int RenderTableSize
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:186
vtkUnstructuredGridVolumeRayCastMapper::ImageDisplayHelper
vtkRayCastImageDisplayHelper * ImageDisplayHelper
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:159
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkUnstructuredGridVolumeRayCastMapper::IntersectedCellsBuffer
vtkIdList ** IntersectedCellsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:210
vtkUnstructuredGridVolumeRayCastIterator
Definition: vtkUnstructuredGridVolumeRayCastIterator.h:43
vtkUnstructuredGridVolumeRayCastMapper::CurrentVolume
vtkVolume * CurrentVolume
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:215
vtkMultiThreader
A class for performing multithreaded execution.
Definition: vtkMultiThreader.h:77
vtkUnstructuredGridVolumeRayCastMapper::CurrentRenderer
vtkRenderer * CurrentRenderer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:216
vtkUnstructuredGridVolumeRayCastMapper::ZBuffer
float * ZBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:194
vtkUnstructuredGridVolumeRayCastMapper::RenderTableEntries
int RenderTableEntries
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:187
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkUnstructuredGridVolumeRayCastMapper::MinimumImageSampleDistance
float MinimumImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:152
vtkUnstructuredGridVolumeRayCastMapper::IntersectionLengthsBuffer
vtkDoubleArray ** IntersectionLengthsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:211
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkUnstructuredGridVolumeRayCastMapper::RayCastFunction
vtkUnstructuredGridVolumeRayCastFunction * RayCastFunction
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:205
vtkUnstructuredGridVolumeRayCastFunction
a superclass for ray casting functions
Definition: vtkUnstructuredGridVolumeRayCastFunction.h:38
vtkUnstructuredGridVolumeRayCastMapper
A software mapper for unstructured volumes.
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:43
vtkUnstructuredGridVolumeRayCastMapper::IntermixIntersectingGeometry
vtkTypeBool IntermixIntersectingGeometry
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:192
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkTimerLog
Timer support and logging.
Definition: vtkTimerLog.h:90
vtkUnstructuredGridVolumeRayCastMapper::RenderVolumeTable
vtkVolume ** RenderVolumeTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:184
vtkUnstructuredGridVolumeMapper
Abstract class for an unstructured grid volume mapper.
Definition: vtkUnstructuredGridVolumeMapper.h:39
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:67
vtkUnstructuredGridVolumeMapper::Render
void Render(vtkRenderer *ren, vtkVolume *vol) override=0
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
vtkUnstructuredGridVolumeRayCastMapper::Image
unsigned char * Image
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:181
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:35
vtkUnstructuredGridVolumeRayCastMapper::CellScalars
int CellScalars
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:219
vtkUnstructuredGridVolumeMapper.h
vtkUnstructuredGridVolumeRayCastMapper::RayCastIterators
vtkUnstructuredGridVolumeRayCastIterator ** RayCastIterators
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:206
vtkUnstructuredGridVolumeRayCastMapper::Threader
vtkMultiThreader * Threader
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:156
vtkUnstructuredGridVolumeRayCastMapper::RayIntegrator
vtkUnstructuredGridVolumeRayIntegrator * RayIntegrator
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:207
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkUnstructuredGridVolumeRayCastMapper::RenderTimeTable
float * RenderTimeTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:183
vtkUnstructuredGridVolumeRayCastMapper::FarIntersectionsBuffer
vtkDataArray ** FarIntersectionsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:213