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 
31 #ifndef vtkUnstructuredGridVolumeRayCastMapper_h
32 #define vtkUnstructuredGridVolumeRayCastMapper_h
33 
34 #include "vtkRenderingVolumeModule.h" // For export macro
36 
37 class vtkDoubleArray;
38 class vtkIdList;
39 class vtkMultiThreader;
41 class vtkRenderer;
42 class vtkTimerLog;
46 class vtkVolume;
47 
49 {
50 public:
53  void PrintSelf( ostream& os, vtkIndent indent );
54 
56 
59  vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
60  vtkGetMacro( ImageSampleDistance, float );
62 
64 
66  vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
67  vtkGetMacro( MinimumImageSampleDistance, float );
69 
71 
73  vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
74  vtkGetMacro( MaximumImageSampleDistance, float );
76 
78 
81  vtkSetClampMacro( AutoAdjustSampleDistances, int, 0, 1 );
82  vtkGetMacro( AutoAdjustSampleDistances, int );
83  vtkBooleanMacro( AutoAdjustSampleDistances, int );
85 
87 
89  vtkSetMacro( NumberOfThreads, int );
90  vtkGetMacro( NumberOfThreads, int );
92 
94 
96  vtkSetClampMacro( IntermixIntersectingGeometry, int, 0, 1 );
97  vtkGetMacro( IntermixIntersectingGeometry, int );
98  vtkBooleanMacro( IntermixIntersectingGeometry, int );
100 
102 
106 
108 
113 
114 //BTX
118 
124 
125  vtkGetVectorMacro( ImageInUseSize, int, 2 );
126  vtkGetVectorMacro( ImageOrigin, int, 2 );
127  vtkGetVectorMacro( ImageViewportSize, int , 2 );
128 
129 //ETX
130 
131  void CastRays( int threadID, int threadCount );
132 
133 protected:
136 
141 
144 
146 
147  // This is how big the image would be if it covered the entire viewport
148  int ImageViewportSize[2];
149 
150  // This is how big the allocated memory for image is. This may be bigger
151  // or smaller than ImageFullSize - it will be bigger if necessary to
152  // ensure a power of 2, it will be smaller if the volume only covers a
153  // small region of the viewport
154  int ImageMemorySize[2];
155 
156  // This is the size of subregion in ImageSize image that we are using for
157  // the current image. Since ImageSize is a power of 2, there is likely
158  // wasted space in it. This number will be used for things such as clearing
159  // the image if necessary.
160  int ImageInUseSize[2];
161 
162  // This is the location in ImageFullSize image where our ImageSize image
163  // is located.
164  int ImageOrigin[2];
165 
166  // This is the allocated image
167  unsigned char *Image;
168 
174 
175  void StoreRenderTime( vtkRenderer *ren, vtkVolume *vol, float t );
177 
179 
180  float *ZBuffer;
181  int ZBufferSize[2];
182  int ZBufferOrigin[2];
183 
184  // Get the ZBuffer value corresponding to location (x,y) where (x,y)
185  // are indexing into the ImageInUse image. This must be converted to
186  // the zbuffer image coordinates. Nearest neighbor value is returned.
187  double GetZBufferValue( int x, int y );
188 
190  vtkVolume *vol );
191 
196 
201 
204 
207 
208 private:
210  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&); // Not implemented.
211 };
212 
213 #endif
214 
vtkUnstructuredGridVolumeRayCastMapper::ImageSampleDistance
float ImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:137
vtkUnstructuredGridVolumeRayIntegrator
a superclass for volume ray integration functions
Definition: vtkUnstructuredGridVolumeRayIntegrator.h:44
vtkUnstructuredGridVolumeRayCastMapper::Scalars
vtkDataArray * Scalars
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:205
vtkUnstructuredGridVolumeRayCastMapper::SetRayIntegrator
virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator *ri)
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkUnstructuredGridVolumeRayCastMapper::Render
void Render(vtkRenderer *, vtkVolume *)
vtkUnstructuredGridVolumeRayCastMapper::RenderRendererTable
vtkRenderer ** RenderRendererTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:171
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:143
vtkRenderingVolumeModule.h
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkUnstructuredGridVolumeRayCastMapper::MaximumImageSampleDistance
float MaximumImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:139
vtkGetVectorMacro
#define vtkGetVectorMacro(name, type, count)
Definition: vtkSetGet.h:424
vtkUnstructuredGridVolumeRayCastMapper::NearIntersectionsBuffer
vtkDataArray ** NearIntersectionsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:199
vtkUnstructuredGridVolumeRayCastMapper::RealRayIntegrator
vtkUnstructuredGridVolumeRayIntegrator * RealRayIntegrator
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:195
vtkUnstructuredGridVolumeRayCastMapper::RenderTableSize
int RenderTableSize
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:172
vtkUnstructuredGridVolumeRayCastMapper::ImageDisplayHelper
vtkRayCastImageDisplayHelper * ImageDisplayHelper
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:145
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkUnstructuredGridVolumeRayCastMapper::IntersectedCellsBuffer
vtkIdList ** IntersectedCellsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:197
vtkUnstructuredGridVolumeRayCastIterator
Definition: vtkUnstructuredGridVolumeRayCastIterator.h:43
vtkUnstructuredGridVolumeRayCastMapper::CurrentVolume
vtkVolume * CurrentVolume
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:202
vtkMultiThreader
A class for performing multithreaded execution.
Definition: vtkMultiThreader.h:94
vtkUnstructuredGridVolumeRayCastMapper::CurrentRenderer
vtkRenderer * CurrentRenderer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:203
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkUnstructuredGridVolumeRayCastMapper::~vtkUnstructuredGridVolumeRayCastMapper
~vtkUnstructuredGridVolumeRayCastMapper()
vtkUnstructuredGridVolumeRayCastMapper::ZBuffer
float * ZBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:180
vtkUnstructuredGridVolumeRayCastMapper::RenderTableEntries
int RenderTableEntries
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:173
vtkUnstructuredGridVolumeRayCastMapper::AutoAdjustSampleDistances
int AutoAdjustSampleDistances
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:140
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkUnstructuredGridVolumeRayCastMapper::MinimumImageSampleDistance
float MinimumImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:138
vtkUnstructuredGridVolumeRayCastMapper::GetMinimumBoundsDepth
double GetMinimumBoundsDepth(vtkRenderer *ren, vtkVolume *vol)
vtkUnstructuredGridVolumeRayCastMapper::IntersectionLengthsBuffer
vtkDoubleArray ** IntersectionLengthsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:198
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:36
vtkUnstructuredGridVolumeRayCastMapper::RayCastFunction
vtkUnstructuredGridVolumeRayCastFunction * RayCastFunction
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:192
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkgl::f
GLclampf f
Definition: vtkgl.h:14181
vtkUnstructuredGridVolumeRayCastFunction
a superclass for ray casting functions
Definition: vtkUnstructuredGridVolumeRayCastFunction.h:41
vtkUnstructuredGridVolumeRayCastMapper::SetRayCastFunction
virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction *f)
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkUnstructuredGridVolumeRayCastMapper
A software mapper for unstructured volumes.
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:49
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkTimerLog
Timer support and logging.
Definition: vtkTimerLog.h:82
vtkgl::t
GLdouble GLdouble t
Definition: vtkgl.h:11602
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkUnstructuredGridVolumeRayCastMapper::RenderVolumeTable
vtkVolume ** RenderVolumeTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:170
vtkUnstructuredGridVolumeMapper
Abstract class for a unstructured grid volume mapper.
Definition: vtkUnstructuredGridVolumeMapper.h:40
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)
vtkUnstructuredGridVolumeRayCastMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *)
VTKRENDERINGVOLUME_EXPORT
#define VTKRENDERINGVOLUME_EXPORT
Definition: vtkRenderingVolumeModule.h:15
vtkUnstructuredGridVolumeRayCastMapper::Image
unsigned char * Image
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:167
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:49
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:206
vtkUnstructuredGridVolumeRayCastMapper::IntermixIntersectingGeometry
int IntermixIntersectingGeometry
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:178
vtkUnstructuredGridVolumeMapper.h
vtkUnstructuredGridVolumeRayCastMapper::vtkUnstructuredGridVolumeRayCastMapper
vtkUnstructuredGridVolumeRayCastMapper()
vtkUnstructuredGridVolumeRayCastMapper::RayCastIterators
vtkUnstructuredGridVolumeRayCastIterator ** RayCastIterators
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:193
vtkUnstructuredGridVolumeRayCastMapper::Threader
vtkMultiThreader * Threader
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:142
vtkUnstructuredGridVolumeRayCastMapper::RayIntegrator
vtkUnstructuredGridVolumeRayIntegrator * RayIntegrator
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:194
vtkUnstructuredGridVolumeRayCastMapper::New
static vtkUnstructuredGridVolumeRayCastMapper * New()
vtkUnstructuredGridVolumeRayCastMapper::RenderTimeTable
float * RenderTimeTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:169
vtkUnstructuredGridVolumeRayCastMapper::FarIntersectionsBuffer
vtkDataArray ** FarIntersectionsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:200