VTK
vtkSmartVolumeMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSmartVolumeMapper.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 =========================================================================*/
79 #ifndef vtkSmartVolumeMapper_h
80 #define vtkSmartVolumeMapper_h
81 
82 #include "vtkRenderingVolumeOpenGL2Module.h" // For export macro
83 #include "vtkVolumeMapper.h"
84 #include "vtkImageReslice.h" // for VTK_RESLICE_NEAREST, VTK_RESLICE_CUBIC
85 
88 class vtkImageResample;
90 class vtkRenderWindow;
91 class vtkVolume;
92 class vtkVolumeProperty;
93 class vtkImageMagnitude;
94 
95 class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkSmartVolumeMapper : public vtkVolumeMapper
96 {
97 public:
100  void PrintSelf( ostream& os, vtkIndent indent );
101 
103 
113  vtkSetMacro( FinalColorWindow, float );
115 
117 
120  vtkGetMacro( FinalColorWindow, float );
122 
124 
131  vtkSetMacro( FinalColorLevel, float );
133 
135 
138  vtkGetMacro( FinalColorLevel, float );
140 
141 // The possible values for the default and current render mode ivars
142  enum
143  {
144  DefaultRenderMode=0,
145 #if !defined(VTK_LEGACY_REMOVE)
146  RayCastAndTextureRenderMode=1,
147 #endif // !VTK_LEGACY_REMOVE
148  RayCastRenderMode=2,
149 #if !defined(VTK_LEGACY_REMOVE)
150  TextureRenderMode=3,
151 #endif // !VTK_LEGACY_REMOVE
152  GPURenderMode=4,
153  UndefinedRenderMode=5,
154  OSPRayRenderMode=6,
155  InvalidRenderMode=7
156  };
157 
163 
170 
177 
184 
190 
192 
195  vtkGetMacro( RequestedRenderMode, int );
197 
203 
205 
212  vtkSetMacro( MaxMemoryInBytes, vtkIdType );
213  vtkGetMacro( MaxMemoryInBytes, vtkIdType );
215 
217 
223  vtkSetClampMacro( MaxMemoryFraction, float, 0.1f, 1.0f );
224  vtkGetMacro( MaxMemoryFraction, float );
226 
228 
232  vtkSetClampMacro(InterpolationMode, int,
234  vtkGetMacro(InterpolationMode, int);
239 
246  vtkVolume *volume,
247  vtkVolume *volume2,
249  int blend_mode,
250  double viewDirection[3],
251  double viewUp[3] );
252 
254 
260  vtkSetClampMacro( InteractiveUpdateRate, double, 1.0e-10, 1.0e10 );
262 
264 
269  vtkGetMacro( InteractiveUpdateRate, double );
271 
273 
281  vtkSetClampMacro( InteractiveAdjustSampleDistances, int, 0, 1);
282  vtkGetMacro( InteractiveAdjustSampleDistances, int);
283  vtkBooleanMacro( InteractiveAdjustSampleDistances, int);
285 
287 
296  vtkSetClampMacro( AutoAdjustSampleDistances, int, 0, 1 );
297  vtkGetMacro( AutoAdjustSampleDistances, int );
298  vtkBooleanMacro( AutoAdjustSampleDistances, int );
300 
302 
309  vtkSetMacro( SampleDistance, float );
310  vtkGetMacro( SampleDistance, float );
312 
318 
326 
328 
336  {
337  DISABLED = -1,
338  MAGNITUDE = 0,
339  COMPONENT = 1,
340  };
341 
342  vtkSetClampMacro(VectorMode, int, -1, 1);
343  vtkGetMacro(VectorMode, int);
344 
345  vtkSetClampMacro(VectorComponent, int, 0, 3);
346  vtkGetMacro(VectorComponent, int);
348 
349 protected:
352 
359 
366 
368 
374 
376 
382 
387 
389 
397 
399 
408 
414 
416 
428 
434  vtkVolume *vol);
435 
441  vtkVolume *vol);
442 
444 
451 
452 
459 
464 
470 
477 
486 
488 
498 
499 private:
504  void SetupVectorMode(vtkVolume* vol);
505 
506  vtkSmartVolumeMapper(const vtkSmartVolumeMapper&) VTK_DELETE_FUNCTION;
507  void operator=(const vtkSmartVolumeMapper&) VTK_DELETE_FUNCTION;
508 
509  vtkOSPRayVolumeInterface *OSPRayMapper;
510 };
511 
512 #endif
vtkSmartVolumeMapper::InteractiveAdjustSampleDistances
int InteractiveAdjustSampleDistances
If the InteractiveAdjustSampleDistances flag is enabled, vtkSmartVolumeMapper interactively sets and ...
Definition: vtkSmartVolumeMapper.h:485
vtkVolumeMapper
Abstract class for a volume mapper.
Definition: vtkVolumeMapper.h:50
vtkSmartVolumeMapper::SetRequestedRenderMode
void SetRequestedRenderMode(int mode)
Set the requested render mode.
vtkImageReslice.h
vtkSmartVolumeMapper::VectorComponent
int VectorComponent
Definition: vtkSmartVolumeMapper.h:496
vtkSmartVolumeMapper::SetRequestedRenderModeToOSPRay
void SetRequestedRenderModeToOSPRay()
Set the requested render mode to vtkSmartVolumeMapper::OSPRayRenderMode.
vtkSmartVolumeMapper::FinalColorLevel
float FinalColorLevel
Definition: vtkSmartVolumeMapper.h:372
vtkVolume
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:51
vtkSmartVolumeMapper::SupportStatusCheckTime
vtkTimeStamp SupportStatusCheckTime
Definition: vtkSmartVolumeMapper.h:403
vtkSmartVolumeMapper::SetInterpolationModeToLinear
void SetInterpolationModeToLinear()
vtkIdType
int vtkIdType
Definition: vtkType.h:287
vtkSmartVolumeMapper::ConnectFilterInput
void ConnectFilterInput(vtkImageResample *f)
Connect input of the vtkSmartVolumeMapper to the input of the internal resample filter by doing a sha...
vtkFixedPointVolumeRayCastMapper
A fixed point mapper for volumes.
Definition: vtkFixedPointVolumeRayCastMapper.h:106
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:36
vtkX3D::image
@ image
Definition: vtkX3D.h:374
vtkSmartVolumeMapper::InteractiveUpdateRate
double InteractiveUpdateRate
If the DesiredUpdateRate of the vtkRenderWindow causing the Render is at or above this value,...
Definition: vtkSmartVolumeMapper.h:476
vtkSmartVolumeMapper::GPUSupported
int GPUSupported
Definition: vtkSmartVolumeMapper.h:404
vtkSmartVolumeMapper::vtkSmartVolumeMapper
vtkSmartVolumeMapper()
vtkSmartVolumeMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
vtkSmartVolumeMapper::SetInterpolationModeToNearestNeighbor
void SetInterpolationModeToNearestNeighbor()
vtkSmartVolumeMapper::RayCastSupported
int RayCastSupported
Definition: vtkSmartVolumeMapper.h:405
vtkSmartVolumeMapper::CurrentRenderMode
int CurrentRenderMode
Definition: vtkSmartVolumeMapper.h:395
vtkImageMagnitude
Colapses components with magnitude function.
Definition: vtkImageMagnitude.h:33
vtkSmartVolumeMapper::New
static vtkSmartVolumeMapper * New()
vtkSmartVolumeMapper::MaxMemoryFraction
float MaxMemoryFraction
Definition: vtkSmartVolumeMapper.h:380
vtkSmartVolumeMapper::CreateCanonicalView
void CreateCanonicalView(vtkRenderer *ren, vtkVolume *volume, vtkVolume *volume2, vtkImageData *image, int blend_mode, double viewDirection[3], double viewUp[3])
This method can be used to render a representative view of the input data into the supplied image giv...
vtkSmartVolumeMapper::SetRequestedRenderModeToRayCast
void SetRequestedRenderModeToRayCast()
Set the requested render mode to vtkSmartVolumeMapper::RayCastRenderMode.
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkSmartVolumeMapper::GPULowResMapper
vtkGPUVolumeRayCastMapper * GPULowResMapper
The three potential mappers.
Definition: vtkSmartVolumeMapper.h:447
vtkSmartVolumeMapper::VectorMode
int VectorMode
VectorMode is a special rendering mode for 3-component vectors which makes use of GPURayCastMapper's ...
Definition: vtkSmartVolumeMapper.h:495
vtkSmartVolumeMapper::InterpolationMode
int InterpolationMode
Used for downsampling.
Definition: vtkSmartVolumeMapper.h:386
vtkImageResample
Resamples an image to be larger or smaller.
Definition: vtkImageResample.h:39
vtkSmartVolumeMapper::VectorModeType
VectorModeType
VectorMode is a special rendering mode for 3-component vectors which makes use of GPURayCastMapper's ...
Definition: vtkSmartVolumeMapper.h:336
VTK_RESLICE_CUBIC
#define VTK_RESLICE_CUBIC
Definition: vtkImageReslice.h:68
vtkVolumeMapper.h
vtkSmartVolumeMapper::ComputeRenderMode
void ComputeRenderMode(vtkRenderer *ren, vtkVolume *vol)
The method that computes the render mode from the requested render mode based on the support status f...
vtkSmartVolumeMapper::InputDataMagnitude
vtkImageData * InputDataMagnitude
Definition: vtkSmartVolumeMapper.h:426
vtkSmartVolumeMapper::Initialized
int Initialized
Initialization variables.
Definition: vtkSmartVolumeMapper.h:402
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:46
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkSmartVolumeMapper
Adaptive volume mapper.
Definition: vtkSmartVolumeMapper.h:96
vtkSmartVolumeMapper::GPUMapper
vtkGPUVolumeRayCastMapper * GPUMapper
Definition: vtkSmartVolumeMapper.h:448
vtkGPUVolumeRayCastMapper
Ray casting performed on the GPU.
Definition: vtkGPUVolumeRayCastMapper.h:41
vtkSmartVolumeMapper::SetInterpolationModeToCubic
void SetInterpolationModeToCubic()
VTK_RESLICE_NEAREST
#define VTK_RESLICE_NEAREST
Definition: vtkImageReslice.h:66
vtkSmartVolumeMapper::InitializedBlendMode
int InitializedBlendMode
We need to keep track of the blend mode we had when we initialized because we need to reinitialize (a...
Definition: vtkSmartVolumeMapper.h:458
vtkSmartVolumeMapper::RequestedRenderMode
int RequestedRenderMode
The requested render mode is used to compute the current render mode.
Definition: vtkSmartVolumeMapper.h:394
vtkSmartVolumeMapper::SetRequestedRenderModeToDefault
void SetRequestedRenderModeToDefault()
Set the requested render mode to vtkSmartVolumeMapper::DefaultRenderMode.
vtkSmartVolumeMapper::ImageMagnitude
vtkImageMagnitude * ImageMagnitude
This filter is used to compute the magnitude of 3-component data.
Definition: vtkSmartVolumeMapper.h:425
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSmartVolumeMapper::GetLastUsedRenderMode
int GetLastUsedRenderMode()
This will return the render mode used during the previous call to Render().
vtkSmartVolumeMapper::LowResGPUNecessary
int LowResGPUNecessary
Definition: vtkSmartVolumeMapper.h:406
vtkSmartVolumeMapper::~vtkSmartVolumeMapper
~vtkSmartVolumeMapper()
vtkSmartVolumeMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkOSPRayVolumeInterface
Removes link dependence on optional ospray module.
Definition: vtkOSPRayVolumeInterface.h:35
vtkSmartVolumeMapper::RayCastMapper
vtkFixedPointVolumeRayCastMapper * RayCastMapper
Definition: vtkSmartVolumeMapper.h:449
vtkSmartVolumeMapper::MaxMemoryInBytes
vtkIdType MaxMemoryInBytes
GPU mapper-specific memory ivars.
Definition: vtkSmartVolumeMapper.h:379
vtkSmartVolumeMapper::SetRequestedRenderModeToGPU
void SetRequestedRenderModeToGPU()
Set the requested render mode to vtkSmartVolumeMapper::GPURenderMode.
vtkX3D::mode
@ mode
Definition: vtkX3D.h:247
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:87
vtkSmartVolumeMapper::AutoAdjustSampleDistances
int AutoAdjustSampleDistances
Set whether or not the sample distance should be automatically calculated within the internal volume ...
Definition: vtkSmartVolumeMapper.h:469
vtkSmartVolumeMapper::Initialize
void Initialize(vtkRenderer *ren, vtkVolume *vol)
The initialize method.
vtkSmartVolumeMapper::ConnectMapperInput
void ConnectMapperInput(vtkVolumeMapper *m)
Connect input of the vtkSmartVolumeMapper to the input of the internal volume mapper by doing a shall...
vtkSmartVolumeMapper::FinalColorWindow
float FinalColorWindow
Window / level ivars.
Definition: vtkSmartVolumeMapper.h:371
vtkSmartVolumeMapper::GPUResampleFilter
vtkImageResample * GPUResampleFilter
This is the resample filter that may be used if we need to create a low resolution version of the vol...
Definition: vtkSmartVolumeMapper.h:413
vtkSmartVolumeMapper::Render
void Render(vtkRenderer *, vtkVolume *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Initialize rendering for this volume.
vtkVolumeProperty
represents the common properties for rendering a volume.
Definition: vtkVolumeProperty.h:61
vtkSmartVolumeMapper::SampleDistance
float SampleDistance
The distance between sample points along the ray.
Definition: vtkSmartVolumeMapper.h:463