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 
29 #ifndef vtkUnstructuredGridVolumeRayCastMapper_h
30 #define vtkUnstructuredGridVolumeRayCastMapper_h
31 
32 #include "vtkRenderingVolumeModule.h" // For export macro
34 
35 class vtkDoubleArray;
36 class vtkIdList;
37 class vtkMultiThreader;
39 class vtkRenderer;
40 class vtkTimerLog;
44 class vtkVolume;
45 
47 {
48 public:
51  void PrintSelf( ostream& os, vtkIndent indent ) override;
52 
54 
59  vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
60  vtkGetMacro( ImageSampleDistance, float );
62 
64 
68  vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
69  vtkGetMacro( MinimumImageSampleDistance, float );
71 
73 
77  vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
78  vtkGetMacro( MaximumImageSampleDistance, float );
80 
82 
88  vtkSetClampMacro( AutoAdjustSampleDistances, vtkTypeBool, 0, 1 );
89  vtkGetMacro( AutoAdjustSampleDistances, vtkTypeBool );
90  vtkBooleanMacro( AutoAdjustSampleDistances, vtkTypeBool );
92 
94 
98  vtkSetMacro( NumberOfThreads, int );
99  vtkGetMacro( NumberOfThreads, int );
101 
103 
107  vtkSetClampMacro( IntermixIntersectingGeometry, vtkTypeBool, 0, 1 );
108  vtkGetMacro( IntermixIntersectingGeometry, vtkTypeBool );
109  vtkBooleanMacro( IntermixIntersectingGeometry, vtkTypeBool );
111 
113 
116  virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction *f);
117  vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
119 
121 
125  virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator *ri);
126  vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
128 
133  void Render( vtkRenderer *, vtkVolume * ) override;
134 
141  void ReleaseGraphicsResources(vtkWindow *) override;
142 
143  vtkGetVectorMacro( ImageInUseSize, int, 2 );
144  vtkGetVectorMacro( ImageOrigin, int, 2 );
145  vtkGetVectorMacro( ImageViewportSize, int , 2 );
146 
147  void CastRays( int threadID, int threadCount );
148 
149 protected:
152 
157 
160 
162 
163  // This is how big the image would be if it covered the entire viewport
164  int ImageViewportSize[2];
165 
166  // This is how big the allocated memory for image is. This may be bigger
167  // or smaller than ImageFullSize - it will be bigger if necessary to
168  // ensure a power of 2, it will be smaller if the volume only covers a
169  // small region of the viewport
170  int ImageMemorySize[2];
171 
172  // This is the size of subregion in ImageSize image that we are using for
173  // the current image. Since ImageSize is a power of 2, there is likely
174  // wasted space in it. This number will be used for things such as clearing
175  // the image if necessary.
176  int ImageInUseSize[2];
177 
178  // This is the location in ImageFullSize image where our ImageSize image
179  // is located.
180  int ImageOrigin[2];
181 
182  // This is the allocated image
183  unsigned char *Image;
184 
190 
191  void StoreRenderTime( vtkRenderer *ren, vtkVolume *vol, float t );
192  float RetrieveRenderTime( vtkRenderer *ren, vtkVolume *vol );
193 
195 
196  float *ZBuffer;
197  int ZBufferSize[2];
198  int ZBufferOrigin[2];
199 
200  // Get the ZBuffer value corresponding to location (x,y) where (x,y)
201  // are indexing into the ImageInUse image. This must be converted to
202  // the zbuffer image coordinates. Nearest neighbor value is returned.
203  double GetZBufferValue( int x, int y );
204 
205  double GetMinimumBoundsDepth( vtkRenderer *ren,
206  vtkVolume *vol );
207 
212 
217 
220 
223 
224 private:
226  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&) = delete;
227 };
228 
229 #endif
230 
vtkUnstructuredGridVolumeRayCastMapper::AutoAdjustSampleDistances
vtkTypeBool AutoAdjustSampleDistances
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:156
vtkUnstructuredGridVolumeRayCastMapper::ImageSampleDistance
float ImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:153
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:221
vtkUnstructuredGridVolumeRayCastMapper::RenderRendererTable
vtkRenderer ** RenderRendererTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:187
vtkVolume
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:50
vtkRayCastImageDisplayHelper
helper class that draws the image to the screen
Definition: vtkRayCastImageDisplayHelper.h:39
vtkUnstructuredGridVolumeRayCastMapper::NumberOfThreads
int NumberOfThreads
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:159
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:54
vtkUnstructuredGridVolumeRayCastMapper::MaximumImageSampleDistance
float MaximumImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:155
vtkUnstructuredGridVolumeRayCastMapper::NearIntersectionsBuffer
vtkDataArray ** NearIntersectionsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:215
vtkUnstructuredGridVolumeRayCastMapper::RealRayIntegrator
vtkUnstructuredGridVolumeRayIntegrator * RealRayIntegrator
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:211
vtkUnstructuredGridVolumeRayCastMapper::RenderTableSize
int RenderTableSize
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:188
vtkUnstructuredGridVolumeRayCastMapper::ImageDisplayHelper
vtkRayCastImageDisplayHelper * ImageDisplayHelper
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:161
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkUnstructuredGridVolumeRayCastMapper::IntersectedCellsBuffer
vtkIdList ** IntersectedCellsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:213
vtkUnstructuredGridVolumeRayCastIterator
Definition: vtkUnstructuredGridVolumeRayCastIterator.h:43
vtkUnstructuredGridVolumeRayCastMapper::CurrentVolume
vtkVolume * CurrentVolume
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:218
vtkMultiThreader
A class for performing multithreaded execution.
Definition: vtkMultiThreader.h:83
vtkUnstructuredGridVolumeRayCastMapper::CurrentRenderer
vtkRenderer * CurrentRenderer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:219
vtkUnstructuredGridVolumeRayCastMapper::ZBuffer
float * ZBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:196
vtkUnstructuredGridVolumeRayCastMapper::RenderTableEntries
int RenderTableEntries
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:189
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkUnstructuredGridVolumeRayCastMapper::MinimumImageSampleDistance
float MinimumImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:154
vtkUnstructuredGridVolumeRayCastMapper::IntersectionLengthsBuffer
vtkDoubleArray ** IntersectionLengthsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:214
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkUnstructuredGridVolumeRayCastMapper::RayCastFunction
vtkUnstructuredGridVolumeRayCastFunction * RayCastFunction
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:208
vtkUnstructuredGridVolumeRayCastFunction
a superclass for ray casting functions
Definition: vtkUnstructuredGridVolumeRayCastFunction.h:38
vtkUnstructuredGridVolumeRayCastMapper
A software mapper for unstructured volumes.
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:46
vtkUnstructuredGridVolumeRayCastMapper::IntermixIntersectingGeometry
vtkTypeBool IntermixIntersectingGeometry
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:194
vtkAlgorithm::New
static vtkAlgorithm * New()
vtkTimerLog
Timer support and logging.
Definition: vtkTimerLog.h:91
vtkUnstructuredGridVolumeRayCastMapper::RenderVolumeTable
vtkVolume ** RenderVolumeTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:186
vtkUnstructuredGridVolumeMapper
Abstract class for an unstructured grid volume mapper.
Definition: vtkUnstructuredGridVolumeMapper.h:40
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:63
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:183
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:41
vtkUnstructuredGridVolumeRayCastMapper::CellScalars
int CellScalars
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:222
vtkUnstructuredGridVolumeMapper.h
vtkUnstructuredGridVolumeRayCastMapper::RayCastIterators
vtkUnstructuredGridVolumeRayCastIterator ** RayCastIterators
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:209
vtkUnstructuredGridVolumeRayCastMapper::Threader
vtkMultiThreader * Threader
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:158
vtkUnstructuredGridVolumeRayCastMapper::RayIntegrator
vtkUnstructuredGridVolumeRayIntegrator * RayIntegrator
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:210
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkUnstructuredGridVolumeRayCastMapper::RenderTimeTable
float * RenderTimeTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:185
vtkUnstructuredGridVolumeRayCastMapper::FarIntersectionsBuffer
vtkDataArray ** FarIntersectionsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:216