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 
32 #ifndef vtkUnstructuredGridVolumeRayCastMapper_h
33 #define vtkUnstructuredGridVolumeRayCastMapper_h
34 
35 #include "vtkRenderingVolumeModule.h" // For export macro
37 
38 class vtkDoubleArray;
39 class vtkIdList;
40 class vtkMultiThreader;
42 class vtkRenderer;
43 class vtkTimerLog;
47 class vtkVolume;
48 
50 {
51 public:
54  void PrintSelf( ostream& os, vtkIndent indent );
55 
57 
62  vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
63  vtkGetMacro( ImageSampleDistance, float );
65 
67 
71  vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
72  vtkGetMacro( MinimumImageSampleDistance, float );
74 
76 
80  vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
81  vtkGetMacro( MaximumImageSampleDistance, float );
83 
85 
91  vtkSetClampMacro( AutoAdjustSampleDistances, int, 0, 1 );
92  vtkGetMacro( AutoAdjustSampleDistances, int );
93  vtkBooleanMacro( AutoAdjustSampleDistances, int );
95 
97 
101  vtkSetMacro( NumberOfThreads, int );
102  vtkGetMacro( NumberOfThreads, int );
104 
106 
110  vtkSetClampMacro( IntermixIntersectingGeometry, int, 0, 1 );
111  vtkGetMacro( IntermixIntersectingGeometry, int );
112  vtkBooleanMacro( IntermixIntersectingGeometry, int );
114 
116 
120  vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
122 
124 
129  vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
131 
137 
145 
146  vtkGetVectorMacro( ImageInUseSize, int, 2 );
147  vtkGetVectorMacro( ImageOrigin, int, 2 );
148  vtkGetVectorMacro( ImageViewportSize, int , 2 );
149 
150  void CastRays( int threadID, int threadCount );
151 
152 protected:
155 
160 
163 
165 
166  // This is how big the image would be if it covered the entire viewport
167  int ImageViewportSize[2];
168 
169  // This is how big the allocated memory for image is. This may be bigger
170  // or smaller than ImageFullSize - it will be bigger if necessary to
171  // ensure a power of 2, it will be smaller if the volume only covers a
172  // small region of the viewport
173  int ImageMemorySize[2];
174 
175  // This is the size of subregion in ImageSize image that we are using for
176  // the current image. Since ImageSize is a power of 2, there is likely
177  // wasted space in it. This number will be used for things such as clearing
178  // the image if necessary.
179  int ImageInUseSize[2];
180 
181  // This is the location in ImageFullSize image where our ImageSize image
182  // is located.
183  int ImageOrigin[2];
184 
185  // This is the allocated image
186  unsigned char *Image;
187 
193 
194  void StoreRenderTime( vtkRenderer *ren, vtkVolume *vol, float t );
196 
198 
199  float *ZBuffer;
200  int ZBufferSize[2];
201  int ZBufferOrigin[2];
202 
203  // Get the ZBuffer value corresponding to location (x,y) where (x,y)
204  // are indexing into the ImageInUse image. This must be converted to
205  // the zbuffer image coordinates. Nearest neighbor value is returned.
206  double GetZBufferValue( int x, int y );
207 
209  vtkVolume *vol );
210 
215 
220 
223 
226 
227 private:
229  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&) VTK_DELETE_FUNCTION;
230 };
231 
232 #endif
233 
vtkUnstructuredGridVolumeRayCastMapper::ImageSampleDistance
float ImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:156
vtkUnstructuredGridVolumeRayIntegrator
a superclass for volume ray integration functions
Definition: vtkUnstructuredGridVolumeRayIntegrator.h:45
vtkUnstructuredGridVolumeRayCastMapper::Scalars
vtkDataArray * Scalars
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:224
vtkUnstructuredGridVolumeRayCastMapper::SetRayIntegrator
virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator *ri)
Set/Get the helper class for integrating rays.
vtkUnstructuredGridVolumeRayCastMapper::Render
void Render(vtkRenderer *, vtkVolume *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Initialize rendering for this volume.
vtkUnstructuredGridVolumeRayCastMapper::RenderRendererTable
vtkRenderer ** RenderRendererTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:190
vtkVolume
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:51
vtkRayCastImageDisplayHelper
helper class that draws the image to the screen
Definition: vtkRayCastImageDisplayHelper.h:40
vtkUnstructuredGridVolumeRayCastMapper::NumberOfThreads
int NumberOfThreads
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:162
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkUnstructuredGridVolumeRayCastMapper::MaximumImageSampleDistance
float MaximumImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:158
vtkUnstructuredGridVolumeRayCastMapper::NearIntersectionsBuffer
vtkDataArray ** NearIntersectionsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:218
vtkUnstructuredGridVolumeRayCastMapper::RealRayIntegrator
vtkUnstructuredGridVolumeRayIntegrator * RealRayIntegrator
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:214
vtkUnstructuredGridVolumeRayCastMapper::RenderTableSize
int RenderTableSize
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:191
vtkUnstructuredGridVolumeRayCastMapper::ImageDisplayHelper
vtkRayCastImageDisplayHelper * ImageDisplayHelper
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:164
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkUnstructuredGridVolumeRayCastMapper::IntersectedCellsBuffer
vtkIdList ** IntersectedCellsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:216
vtkUnstructuredGridVolumeRayCastIterator
vtkUnstructuredGridVolumeRayCastIterator is a superclass for iterating over the intersections of a vi...
Definition: vtkUnstructuredGridVolumeRayCastIterator.h:44
vtkUnstructuredGridVolumeRayCastMapper::CurrentVolume
vtkVolume * CurrentVolume
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:221
vtkMultiThreader
A class for performing multithreaded execution.
Definition: vtkMultiThreader.h:97
vtkUnstructuredGridVolumeRayCastMapper::CurrentRenderer
vtkRenderer * CurrentRenderer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:222
vtkUnstructuredGridVolumeRayCastMapper::~vtkUnstructuredGridVolumeRayCastMapper
~vtkUnstructuredGridVolumeRayCastMapper()
vtkUnstructuredGridVolumeRayCastMapper::ZBuffer
float * ZBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:199
vtkUnstructuredGridVolumeRayCastMapper::RenderTableEntries
int RenderTableEntries
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:192
vtkUnstructuredGridVolumeRayCastMapper::AutoAdjustSampleDistances
int AutoAdjustSampleDistances
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:159
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkUnstructuredGridVolumeRayCastMapper::MinimumImageSampleDistance
float MinimumImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:157
vtkUnstructuredGridVolumeRayCastMapper::GetMinimumBoundsDepth
double GetMinimumBoundsDepth(vtkRenderer *ren, vtkVolume *vol)
vtkUnstructuredGridVolumeRayCastMapper::IntersectionLengthsBuffer
vtkDoubleArray ** IntersectionLengthsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:217
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:37
vtkUnstructuredGridVolumeRayCastMapper::RayCastFunction
vtkUnstructuredGridVolumeRayCastFunction * RayCastFunction
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:211
vtkUnstructuredGridVolumeRayCastFunction
a superclass for ray casting functions
Definition: vtkUnstructuredGridVolumeRayCastFunction.h:42
vtkUnstructuredGridVolumeRayCastMapper::SetRayCastFunction
virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction *f)
Set/Get the helper class for casting rays.
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkUnstructuredGridVolumeRayCastMapper
A software mapper for unstructured volumes.
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:50
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkTimerLog
Timer support and logging.
Definition: vtkTimerLog.h:81
vtkUnstructuredGridVolumeRayCastMapper::RenderVolumeTable
vtkVolume ** RenderVolumeTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:189
vtkUnstructuredGridVolumeMapper
Abstract class for a unstructured grid volume mapper.
Definition: vtkUnstructuredGridVolumeMapper.h:41
vtkUnstructuredGridVolumeRayCastMapper::RetrieveRenderTime
float RetrieveRenderTime(vtkRenderer *ren, vtkVolume *vol)
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkUnstructuredGridVolumeRayCastMapper::CastRays
void CastRays(int threadID, int threadCount)
vtkUnstructuredGridVolumeRayCastMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkUnstructuredGridVolumeRayCastMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkUnstructuredGridVolumeRayCastMapper::Image
unsigned char * Image
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:186
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:42
vtkUnstructuredGridVolumeRayCastMapper::GetZBufferValue
double GetZBufferValue(int x, int y)
vtkUnstructuredGridVolumeRayCastMapper::StoreRenderTime
void StoreRenderTime(vtkRenderer *ren, vtkVolume *vol, float t)
vtkUnstructuredGridVolumeRayCastMapper::CellScalars
int CellScalars
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:225
vtkUnstructuredGridVolumeRayCastMapper::IntermixIntersectingGeometry
int IntermixIntersectingGeometry
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:197
vtkUnstructuredGridVolumeMapper.h
vtkUnstructuredGridVolumeRayCastMapper::vtkUnstructuredGridVolumeRayCastMapper
vtkUnstructuredGridVolumeRayCastMapper()
vtkUnstructuredGridVolumeRayCastMapper::RayCastIterators
vtkUnstructuredGridVolumeRayCastIterator ** RayCastIterators
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:212
vtkUnstructuredGridVolumeRayCastMapper::Threader
vtkMultiThreader * Threader
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:161
vtkUnstructuredGridVolumeRayCastMapper::RayIntegrator
vtkUnstructuredGridVolumeRayIntegrator * RayIntegrator
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:213
vtkUnstructuredGridVolumeRayCastMapper::New
static vtkUnstructuredGridVolumeRayCastMapper * New()
vtkUnstructuredGridVolumeRayCastMapper::RenderTimeTable
float * RenderTimeTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:188
vtkUnstructuredGridVolumeRayCastMapper::FarIntersectionsBuffer
vtkDataArray ** FarIntersectionsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:219