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 
103  virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction *f);
104  vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
106 
108 
110  virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator *ri);
111  vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
113 
114 //BTX
117  void Render( vtkRenderer *, vtkVolume * );
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 );
176  float RetrieveRenderTime( vtkRenderer *ren, vtkVolume *vol );
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 
189  double GetMinimumBoundsDepth( vtkRenderer *ren,
190  vtkVolume *vol );
191 
196 
201 
204 
207 
208 private:
210  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&); // Not implemented.
211 };
212 
213 #endif
214 
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:49
vtkUnstructuredGridVolumeRayIntegrator * RayIntegrator
virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0
vtkUnstructuredGridVolumeRayCastIterator ** RayCastIterators
vtkUnstructuredGridVolumeRayCastFunction * RayCastFunction
#define VTKRENDERINGVOLUME_EXPORT
A class for performing multithreaded execution.
A software mapper for unstructured volumes.
abstract specification for renderers
Definition: vtkRenderer.h:63
helper class that draws the image to the screen
dynamic, self-adjusting array of double
a superclass for volume ray integration functions
Timer support and logging.
Definition: vtkTimerLog.h:81
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
a simple class to control print indentation
Definition: vtkIndent.h:38
Abstract class for a unstructured grid volume mapper.
list of point or cell ids
Definition: vtkIdList.h:35
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkUnstructuredGridVolumeRayIntegrator * RealRayIntegrator
static vtkAlgorithm * New()
virtual void ReleaseGraphicsResources(vtkWindow *)
void PrintSelf(ostream &os, vtkIndent indent)