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 
35 
36 class vtkDoubleArray;
37 class vtkIdList;
38 class vtkMultiThreader;
40 class vtkRenderer;
41 class vtkTimerLog;
45 class vtkVolume;
46 
48 {
49 public:
52  void PrintSelf( ostream& os, vtkIndent indent );
53 
55 
58  vtkSetClampMacro( ImageSampleDistance, float, 0.1f, 100.0f );
59  vtkGetMacro( ImageSampleDistance, float );
61 
63 
65  vtkSetClampMacro( MinimumImageSampleDistance, float, 0.1f, 100.0f );
66  vtkGetMacro( MinimumImageSampleDistance, float );
68 
70 
72  vtkSetClampMacro( MaximumImageSampleDistance, float, 0.1f, 100.0f );
73  vtkGetMacro( MaximumImageSampleDistance, float );
75 
77 
80  vtkSetClampMacro( AutoAdjustSampleDistances, int, 0, 1 );
81  vtkGetMacro( AutoAdjustSampleDistances, int );
82  vtkBooleanMacro( AutoAdjustSampleDistances, int );
84 
86 
88  vtkSetMacro( NumberOfThreads, int );
89  vtkGetMacro( NumberOfThreads, int );
91 
93 
95  vtkSetClampMacro( IntermixIntersectingGeometry, int, 0, 1 );
96  vtkGetMacro( IntermixIntersectingGeometry, int );
97  vtkBooleanMacro( IntermixIntersectingGeometry, int );
99 
101 
102  virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction *f);
103  vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
105 
107 
109  virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator *ri);
110  vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
112 
113 //BTX
116  void Render( vtkRenderer *, vtkVolume * );
117 
123 
124  vtkGetVectorMacro( ImageInUseSize, int, 2 );
125  vtkGetVectorMacro( ImageOrigin, int, 2 );
126  vtkGetVectorMacro( ImageViewportSize, int , 2 );
127 
128 //ETX
129 
130  void CastRays( int threadID, int threadCount );
131 
132 protected:
135 
140 
143 
145 
146  // This is how big the image would be if it covered the entire viewport
147  int ImageViewportSize[2];
148 
149  // This is how big the allocated memory for image is. This may be bigger
150  // or smaller than ImageFullSize - it will be bigger if necessary to
151  // ensure a power of 2, it will be smaller if the volume only covers a
152  // small region of the viewport
153  int ImageMemorySize[2];
154 
155  // This is the size of subregion in ImageSize image that we are using for
156  // the current image. Since ImageSize is a power of 2, there is likely
157  // wasted space in it. This number will be used for things such as clearing
158  // the image if necessary.
159  int ImageInUseSize[2];
160 
161  // This is the location in ImageFullSize image where our ImageSize image
162  // is located.
163  int ImageOrigin[2];
164 
165  // This is the allocated image
166  unsigned char *Image;
167 
173 
174  void StoreRenderTime( vtkRenderer *ren, vtkVolume *vol, float t );
175  float RetrieveRenderTime( vtkRenderer *ren, vtkVolume *vol );
176 
178 
179  float *ZBuffer;
180  int ZBufferSize[2];
181  int ZBufferOrigin[2];
182 
183  // Get the ZBuffer value corresponding to location (x,y) where (x,y)
184  // are indexing into the ImageInUse image. This must be converted to
185  // the zbuffer image coordinates. Nearest neighbor value is returned.
186  double GetZBufferValue( int x, int y );
187 
188  double GetMinimumBoundsDepth( vtkRenderer *ren,
189  vtkVolume *vol );
190 
195 
200 
203 
206 
207 private:
209  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&); // Not implemented.
210 };
211 
212 #endif
213