VTK
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 
44 {
45 public:
48  void PrintSelf( ostream& os, vtkIndent indent ) override;
49 
51 
56  vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
57  vtkGetMacro( ImageSampleDistance, float );
59 
61 
65  vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
66  vtkGetMacro( MinimumImageSampleDistance, float );
68 
70 
74  vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
75  vtkGetMacro( MaximumImageSampleDistance, float );
77 
79 
85  vtkSetClampMacro( AutoAdjustSampleDistances, vtkTypeBool, 0, 1 );
86  vtkGetMacro( AutoAdjustSampleDistances, vtkTypeBool );
87  vtkBooleanMacro( AutoAdjustSampleDistances, vtkTypeBool );
89 
91 
95  vtkSetMacro( NumberOfThreads, int );
96  vtkGetMacro( NumberOfThreads, int );
98 
100 
104  vtkSetClampMacro( IntermixIntersectingGeometry, vtkTypeBool, 0, 1 );
105  vtkGetMacro( IntermixIntersectingGeometry, vtkTypeBool );
106  vtkBooleanMacro( IntermixIntersectingGeometry, vtkTypeBool );
108 
110 
113  virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction *f);
114  vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
116 
118 
122  virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator *ri);
123  vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
125 
130  void Render( vtkRenderer *, vtkVolume * ) override;
131 
138  void ReleaseGraphicsResources(vtkWindow *) override;
139 
140  vtkGetVectorMacro( ImageInUseSize, int, 2 );
141  vtkGetVectorMacro( ImageOrigin, int, 2 );
142  vtkGetVectorMacro( ImageViewportSize, int , 2 );
143 
144  void CastRays( int threadID, int threadCount );
145 
146 protected:
149 
154 
157 
159 
160  // This is how big the image would be if it covered the entire viewport
161  int ImageViewportSize[2];
162 
163  // This is how big the allocated memory for image is. This may be bigger
164  // or smaller than ImageFullSize - it will be bigger if necessary to
165  // ensure a power of 2, it will be smaller if the volume only covers a
166  // small region of the viewport
167  int ImageMemorySize[2];
168 
169  // This is the size of subregion in ImageSize image that we are using for
170  // the current image. Since ImageSize is a power of 2, there is likely
171  // wasted space in it. This number will be used for things such as clearing
172  // the image if necessary.
173  int ImageInUseSize[2];
174 
175  // This is the location in ImageFullSize image where our ImageSize image
176  // is located.
177  int ImageOrigin[2];
178 
179  // This is the allocated image
180  unsigned char *Image;
181 
187 
188  void StoreRenderTime( vtkRenderer *ren, vtkVolume *vol, float t );
189  float RetrieveRenderTime( vtkRenderer *ren, vtkVolume *vol );
190 
192 
193  float *ZBuffer;
194  int ZBufferSize[2];
195  int ZBufferOrigin[2];
196 
197  // Get the ZBuffer value corresponding to location (x,y) where (x,y)
198  // are indexing into the ImageInUse image. This must be converted to
199  // the zbuffer image coordinates. Nearest neighbor value is returned.
200  double GetZBufferValue( int x, int y );
201 
202  double GetMinimumBoundsDepth( vtkRenderer *ren,
203  vtkVolume *vol );
204 
209 
214 
217 
220 
221 private:
223  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&) = delete;
224 };
225 
226 #endif
227 
vtkUnstructuredGridVolumeRayCastMapper::AutoAdjustSampleDistances
vtkTypeBool AutoAdjustSampleDistances
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:153
vtkUnstructuredGridVolumeRayCastMapper::ImageSampleDistance
float ImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:150
vtkUnstructuredGridVolumeMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkUnstructuredGridVolumeMapper.h:75
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:184
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:156
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:48
vtkUnstructuredGridVolumeRayCastMapper::MaximumImageSampleDistance
float MaximumImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:152
vtkUnstructuredGridVolumeRayCastMapper::NearIntersectionsBuffer
vtkDataArray ** NearIntersectionsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:212
vtkUnstructuredGridVolumeRayCastMapper::RealRayIntegrator
vtkUnstructuredGridVolumeRayIntegrator * RealRayIntegrator
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:208
vtkUnstructuredGridVolumeRayCastMapper::RenderTableSize
int RenderTableSize
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:185
vtkUnstructuredGridVolumeRayCastMapper::ImageDisplayHelper
vtkRayCastImageDisplayHelper * ImageDisplayHelper
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:158
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
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:193
vtkUnstructuredGridVolumeRayCastMapper::RenderTableEntries
int RenderTableEntries
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:186
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkUnstructuredGridVolumeRayCastMapper::MinimumImageSampleDistance
float MinimumImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:151
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:191
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkTimerLog
Timer support and logging.
Definition: vtkTimerLog.h:85
vtkUnstructuredGridVolumeRayCastMapper::RenderVolumeTable
vtkVolume ** RenderVolumeTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:183
vtkUnstructuredGridVolumeMapper
Abstract class for an unstructured grid volume mapper.
Definition: vtkUnstructuredGridVolumeMapper.h:40
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:57
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:180
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:155
vtkUnstructuredGridVolumeRayCastMapper::RayIntegrator
vtkUnstructuredGridVolumeRayIntegrator * RayIntegrator
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:207
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkUnstructuredGridVolumeRayCastMapper::RenderTimeTable
float * RenderTimeTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:182
vtkUnstructuredGridVolumeRayCastMapper::FarIntersectionsBuffer
vtkDataArray ** FarIntersectionsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:213