VTK  9.1.0
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 
45 #ifndef vtkUnstructuredGridVolumeRayCastMapper_h
46 #define vtkUnstructuredGridVolumeRayCastMapper_h
47 
48 #include "vtkRenderingVolumeModule.h" // For export macro
50 
51 class vtkDoubleArray;
52 class vtkIdList;
53 class vtkMultiThreader;
55 class vtkRenderer;
56 class vtkTimerLog;
60 class vtkVolume;
61 
62 class VTKRENDERINGVOLUME_EXPORT vtkUnstructuredGridVolumeRayCastMapper
64 {
65 public:
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
71 
76  vtkSetClampMacro(ImageSampleDistance, float, 0.1f, 100.0f);
77  vtkGetMacro(ImageSampleDistance, float);
79 
81 
85  vtkSetClampMacro(MinimumImageSampleDistance, float, 0.1f, 100.0f);
86  vtkGetMacro(MinimumImageSampleDistance, float);
88 
90 
94  vtkSetClampMacro(MaximumImageSampleDistance, float, 0.1f, 100.0f);
95  vtkGetMacro(MaximumImageSampleDistance, float);
97 
99 
105  vtkSetClampMacro(AutoAdjustSampleDistances, vtkTypeBool, 0, 1);
106  vtkGetMacro(AutoAdjustSampleDistances, vtkTypeBool);
107  vtkBooleanMacro(AutoAdjustSampleDistances, vtkTypeBool);
109 
111 
115  vtkSetMacro(NumberOfThreads, int);
116  vtkGetMacro(NumberOfThreads, int);
118 
120 
124  vtkSetClampMacro(IntermixIntersectingGeometry, vtkTypeBool, 0, 1);
125  vtkGetMacro(IntermixIntersectingGeometry, vtkTypeBool);
126  vtkBooleanMacro(IntermixIntersectingGeometry, vtkTypeBool);
128 
130 
134  vtkGetObjectMacro(RayCastFunction, vtkUnstructuredGridVolumeRayCastFunction);
136 
138 
143  vtkGetObjectMacro(RayIntegrator, vtkUnstructuredGridVolumeRayIntegrator);
145 
150  void Render(vtkRenderer*, vtkVolume*) override;
151 
159 
160  vtkGetVectorMacro(ImageInUseSize, int, 2);
161  vtkGetVectorMacro(ImageOrigin, int, 2);
162  vtkGetVectorMacro(ImageViewportSize, int, 2);
163 
164  void CastRays(int threadID, int threadCount);
165 
166 protected:
169 
174 
177 
179 
180  // This is how big the image would be if it covered the entire viewport
181  int ImageViewportSize[2];
182 
183  // This is how big the allocated memory for image is. This may be bigger
184  // or smaller than ImageFullSize - it will be bigger if necessary to
185  // ensure a power of 2, it will be smaller if the volume only covers a
186  // small region of the viewport
187  int ImageMemorySize[2];
188 
189  // This is the size of subregion in ImageSize image that we are using for
190  // the current image. Since ImageSize is a power of 2, there is likely
191  // wasted space in it. This number will be used for things such as clearing
192  // the image if necessary.
193  int ImageInUseSize[2];
194 
195  // This is the location in ImageFullSize image where our ImageSize image
196  // is located.
197  int ImageOrigin[2];
198 
199  // This is the allocated image
200  unsigned char* Image;
201 
207 
208  void StoreRenderTime(vtkRenderer* ren, vtkVolume* vol, float t);
210 
212 
213  float* ZBuffer;
214  int ZBufferSize[2];
215  int ZBufferOrigin[2];
216 
217  // Get the ZBuffer value corresponding to location (x,y) where (x,y)
218  // are indexing into the ImageInUse image. This must be converted to
219  // the zbuffer image coordinates. Nearest neighbor value is returned.
220  double GetZBufferValue(int x, int y);
221 
223 
228 
233 
236 
239 
240 private:
242  void operator=(const vtkUnstructuredGridVolumeRayCastMapper&) = delete;
243 };
244 
245 #endif
vtkUnstructuredGridVolumeRayCastMapper::AutoAdjustSampleDistances
vtkTypeBool AutoAdjustSampleDistances
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:173
vtkUnstructuredGridVolumeRayCastMapper::ImageSampleDistance
float ImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:170
vtkUnstructuredGridVolumeRayIntegrator
a superclass for volume ray integration functions
Definition: vtkUnstructuredGridVolumeRayIntegrator.h:42
vtkUnstructuredGridVolumeRayCastMapper::Scalars
vtkDataArray * Scalars
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:237
vtkUnstructuredGridVolumeRayCastMapper::SetRayIntegrator
virtual void SetRayIntegrator(vtkUnstructuredGridVolumeRayIntegrator *ri)
Set/Get the helper class for integrating rays.
vtkUnstructuredGridVolumeRayCastMapper::RenderRendererTable
vtkRenderer ** RenderRendererTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:204
vtkVolume
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:134
vtkRayCastImageDisplayHelper
helper class that draws the image to the screen
Definition: vtkRayCastImageDisplayHelper.h:40
vtkUnstructuredGridVolumeRayCastMapper::NumberOfThreads
int NumberOfThreads
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:176
vtkUnstructuredGridVolumeRayCastMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkUnstructuredGridVolumeRayCastMapper::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:159
vtkUnstructuredGridVolumeRayCastMapper::MaximumImageSampleDistance
float MaximumImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:172
vtkUnstructuredGridVolumeRayCastMapper::NearIntersectionsBuffer
vtkDataArray ** NearIntersectionsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:231
vtkUnstructuredGridVolumeRayCastMapper::RealRayIntegrator
vtkUnstructuredGridVolumeRayIntegrator * RealRayIntegrator
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:227
vtkUnstructuredGridVolumeRayCastMapper::RenderTableSize
int RenderTableSize
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:205
vtkUnstructuredGridVolumeRayCastMapper::ImageDisplayHelper
vtkRayCastImageDisplayHelper * ImageDisplayHelper
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:178
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkUnstructuredGridVolumeRayCastMapper::IntersectedCellsBuffer
vtkIdList ** IntersectedCellsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:229
vtkUnstructuredGridVolumeRayCastIterator
vtkUnstructuredGridVolumeRayCastIterator is a superclass for iterating over the intersections of a vi...
Definition: vtkUnstructuredGridVolumeRayCastIterator.h:44
vtkUnstructuredGridVolumeRayCastMapper::CurrentVolume
vtkVolume * CurrentVolume
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:234
vtkMultiThreader
A class for performing multithreaded execution.
Definition: vtkMultiThreader.h:77
vtkUnstructuredGridVolumeRayCastMapper::CurrentRenderer
vtkRenderer * CurrentRenderer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:235
vtkUnstructuredGridVolumeRayCastMapper::ZBuffer
float * ZBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:213
vtkUnstructuredGridVolumeRayCastMapper::~vtkUnstructuredGridVolumeRayCastMapper
~vtkUnstructuredGridVolumeRayCastMapper() override
vtkUnstructuredGridVolumeRayCastMapper::RenderTableEntries
int RenderTableEntries
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:206
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkUnstructuredGridVolumeRayCastMapper::MinimumImageSampleDistance
float MinimumImageSampleDistance
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:171
vtkUnstructuredGridVolumeRayCastMapper::GetMinimumBoundsDepth
double GetMinimumBoundsDepth(vtkRenderer *ren, vtkVolume *vol)
vtkUnstructuredGridVolumeRayCastMapper::IntersectionLengthsBuffer
vtkDoubleArray ** IntersectionLengthsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:230
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:140
vtkUnstructuredGridVolumeRayCastMapper::RayCastFunction
vtkUnstructuredGridVolumeRayCastFunction * RayCastFunction
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:224
vtkUnstructuredGridVolumeRayCastFunction
a superclass for ray casting functions
Definition: vtkUnstructuredGridVolumeRayCastFunction.h:39
vtkUnstructuredGridVolumeRayCastMapper::SetRayCastFunction
virtual void SetRayCastFunction(vtkUnstructuredGridVolumeRayCastFunction *f)
Set/Get the helper class for casting rays.
vtkUnstructuredGridVolumeRayCastMapper
A software mapper for unstructured volumes.
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:64
vtkUnstructuredGridVolumeRayCastMapper::IntermixIntersectingGeometry
vtkTypeBool IntermixIntersectingGeometry
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:211
vtkTimerLog
Timer support and logging.
Definition: vtkTimerLog.h:199
vtkUnstructuredGridVolumeRayCastMapper::RenderVolumeTable
vtkVolume ** RenderVolumeTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:203
vtkUnstructuredGridVolumeMapper
Abstract class for an unstructured grid volume mapper.
Definition: vtkUnstructuredGridVolumeMapper.h:40
vtkUnstructuredGridVolumeRayCastMapper::RetrieveRenderTime
float RetrieveRenderTime(vtkRenderer *ren, vtkVolume *vol)
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkUnstructuredGridVolumeRayCastMapper::CastRays
void CastRays(int threadID, int threadCount)
vtkUnstructuredGridVolumeRayCastMapper::Image
unsigned char * Image
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:200
vtkDoubleArray
dynamic, self-adjusting array of double
Definition: vtkDoubleArray.h:145
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:238
vtkUnstructuredGridVolumeMapper.h
vtkUnstructuredGridVolumeRayCastMapper::vtkUnstructuredGridVolumeRayCastMapper
vtkUnstructuredGridVolumeRayCastMapper()
vtkUnstructuredGridVolumeRayCastMapper::RayCastIterators
vtkUnstructuredGridVolumeRayCastIterator ** RayCastIterators
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:225
vtkUnstructuredGridVolumeRayCastMapper::Threader
vtkMultiThreader * Threader
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:175
vtkUnstructuredGridVolumeRayCastMapper::Render
void Render(vtkRenderer *, vtkVolume *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Initialize rendering for this volume.
vtkUnstructuredGridVolumeRayCastMapper::RayIntegrator
vtkUnstructuredGridVolumeRayIntegrator * RayIntegrator
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:226
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkUnstructuredGridVolumeRayCastMapper::New
static vtkUnstructuredGridVolumeRayCastMapper * New()
vtkUnstructuredGridVolumeRayCastMapper::RenderTimeTable
float * RenderTimeTable
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:202
vtkUnstructuredGridVolumeRayCastMapper::FarIntersectionsBuffer
vtkDataArray ** FarIntersectionsBuffer
Definition: vtkUnstructuredGridVolumeRayCastMapper.h:232