VTK  9.1.0
vtkVolumeMapper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkVolumeMapper.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 =========================================================================*/
25 #ifndef vtkVolumeMapper_h
26 #define vtkVolumeMapper_h
27 
29 #include "vtkRenderingVolumeModule.h" // For export macro
30 
31 class vtkImageData;
32 class vtkRectilinearGrid;
33 class vtkRenderer;
34 class vtkVolume;
35 
36 #define VTK_CROP_SUBVOLUME 0x0002000
37 #define VTK_CROP_FENCE 0x2ebfeba
38 #define VTK_CROP_INVERTED_FENCE 0x5140145
39 #define VTK_CROP_CROSS 0x0417410
40 #define VTK_CROP_INVERTED_CROSS 0x7be8bef
41 
42 class vtkWindow;
43 
44 class VTKRENDERINGVOLUME_EXPORT vtkVolumeMapper : public vtkAbstractVolumeMapper
45 {
46 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51 
54  virtual void SetInputData(vtkImageData*);
55  virtual void SetInputData(vtkDataSet*);
57  virtual vtkDataSet* GetInput();
58  virtual vtkDataSet* GetInput(const int port);
60 
62 
104  vtkSetMacro(BlendMode, int);
107  {
108  this->SetBlendMode(vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND);
109  }
111  {
112  this->SetBlendMode(vtkVolumeMapper::MINIMUM_INTENSITY_BLEND);
113  }
115  {
116  this->SetBlendMode(vtkVolumeMapper::AVERAGE_INTENSITY_BLEND);
117  }
120  void SetBlendModeToSlice() { this->SetBlendMode(vtkVolumeMapper::SLICE_BLEND); }
121  vtkGetMacro(BlendMode, int);
123 
125 
133  vtkSetVector2Macro(AverageIPScalarRange, double);
134  vtkGetVectorMacro(AverageIPScalarRange, double, 2);
136 
138 
142  vtkSetClampMacro(Cropping, vtkTypeBool, 0, 1);
143  vtkGetMacro(Cropping, vtkTypeBool);
144  vtkBooleanMacro(Cropping, vtkTypeBool);
146 
148 
153  vtkSetVector6Macro(CroppingRegionPlanes, double);
154  vtkGetVectorMacro(CroppingRegionPlanes, double, 6);
156 
158 
162  vtkGetVectorMacro(VoxelCroppingRegionPlanes, double, 6);
164 
166 
177  vtkSetClampMacro(CroppingRegionFlags, int, 0x0, 0x7ffffff);
178  vtkGetMacro(CroppingRegionFlags, int);
179  void SetCroppingRegionFlagsToSubVolume() { this->SetCroppingRegionFlags(VTK_CROP_SUBVOLUME); }
180  void SetCroppingRegionFlagsToFence() { this->SetCroppingRegionFlags(VTK_CROP_FENCE); }
182  {
183  this->SetCroppingRegionFlags(VTK_CROP_INVERTED_FENCE);
184  }
185  void SetCroppingRegionFlagsToCross() { this->SetCroppingRegionFlags(VTK_CROP_CROSS); }
187  {
188  this->SetCroppingRegionFlags(VTK_CROP_INVERTED_CROSS);
189  }
191 
197  void Render(vtkRenderer* ren, vtkVolume* vol) override = 0;
198 
206 
250  {
257  SLICE_BLEND
258  };
259 
260 protected:
262  ~vtkVolumeMapper() override;
263 
269  double SpacingAdjustedSampleDistance(double inputSpacing[3], int inputExtent[6]);
270 
272 
276  double AverageIPScalarRange[2];
277 
279 
284  double CroppingRegionPlanes[6];
285  double VoxelCroppingRegionPlanes[6];
289 
291 
292 private:
293  vtkVolumeMapper(const vtkVolumeMapper&) = delete;
294  void operator=(const vtkVolumeMapper&) = delete;
295 };
296 
297 #endif
VTK_CROP_INVERTED_CROSS
#define VTK_CROP_INVERTED_CROSS
Definition: vtkVolumeMapper.h:40
vtkVolumeMapper
Abstract class for a volume mapper.
Definition: vtkVolumeMapper.h:45
vtkVolumeMapper::ADDITIVE_BLEND
@ ADDITIVE_BLEND
Definition: vtkVolumeMapper.h:255
vtkVolumeMapper::SetBlendModeToComposite
void SetBlendModeToComposite()
Set/Get the blend mode.
Definition: vtkVolumeMapper.h:105
VTK_CROP_FENCE
#define VTK_CROP_FENCE
Definition: vtkVolumeMapper.h:37
vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND
@ MAXIMUM_INTENSITY_BLEND
Definition: vtkVolumeMapper.h:252
vtkVolume
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:134
vtkVolumeMapper::SetBlendModeToIsoSurface
void SetBlendModeToIsoSurface()
Set/Get the blend mode.
Definition: vtkVolumeMapper.h:119
vtkRectilinearGrid
a dataset that is topologically regular with variable spacing in the three coordinate directions
Definition: vtkRectilinearGrid.h:151
vtkVolumeMapper::SetBlendModeToAdditive
void SetBlendModeToAdditive()
Set/Get the blend mode.
Definition: vtkVolumeMapper.h:118
vtkVolumeMapper::BlendMode
int BlendMode
Definition: vtkVolumeMapper.h:271
vtkVolumeMapper::GetInput
virtual vtkDataSet * GetInput(const int port)
Set/Get the input data.
vtkVolumeMapper::SetCroppingRegionFlagsToSubVolume
void SetCroppingRegionFlagsToSubVolume()
Set the flags for the cropping regions.
Definition: vtkVolumeMapper.h:179
vtkVolumeMapper::SetBlendModeToSlice
void SetBlendModeToSlice()
Set/Get the blend mode.
Definition: vtkVolumeMapper.h:120
vtkAbstractVolumeMapper.h
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
vtkVolumeMapper::SetInputData
virtual void SetInputData(vtkRectilinearGrid *)
Set/Get the input data.
vtkVolumeMapper::~vtkVolumeMapper
~vtkVolumeMapper() override
vtkVolumeMapper::FillInputPortInformation
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
vtkVolumeMapper::SetBlendModeToMinimumIntensity
void SetBlendModeToMinimumIntensity()
Set/Get the blend mode.
Definition: vtkVolumeMapper.h:110
vtkVolumeMapper::AVERAGE_INTENSITY_BLEND
@ AVERAGE_INTENSITY_BLEND
Definition: vtkVolumeMapper.h:254
vtkX3D::port
@ port
Definition: vtkX3D.h:453
vtkVolumeMapper::COMPOSITE_BLEND
@ COMPOSITE_BLEND
Definition: vtkVolumeMapper.h:251
VTK_CROP_SUBVOLUME
#define VTK_CROP_SUBVOLUME
Definition: vtkVolumeMapper.h:36
vtkVolumeMapper::SetCroppingRegionFlagsToFence
void SetCroppingRegionFlagsToFence()
Set the flags for the cropping regions.
Definition: vtkVolumeMapper.h:180
vtkVolumeMapper::ConvertCroppingRegionPlanesToVoxels
void ConvertCroppingRegionPlanesToVoxels()
Cropping variables, and a method for converting the world coordinate cropping region planes to voxel ...
vtkVolumeMapper::Render
void Render(vtkRenderer *ren, vtkVolume *vol) override=0
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
VTK_CROP_CROSS
#define VTK_CROP_CROSS
Definition: vtkVolumeMapper.h:39
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:157
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkVolumeMapper::SetBlendModeToAverageIntensity
void SetBlendModeToAverageIntensity()
Set/Get the blend mode.
Definition: vtkVolumeMapper.h:114
VTK_CROP_INVERTED_FENCE
#define VTK_CROP_INVERTED_FENCE
Definition: vtkVolumeMapper.h:38
vtkVolumeMapper::SetInputData
virtual void SetInputData(vtkDataSet *)
Set/Get the input data.
vtkVolumeMapper::SetCroppingRegionFlagsToInvertedCross
void SetCroppingRegionFlagsToInvertedCross()
Set the flags for the cropping regions.
Definition: vtkVolumeMapper.h:186
vtkVolumeMapper::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
Definition: vtkVolumeMapper.h:205
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:166
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:183
vtkVolumeMapper::vtkVolumeMapper
vtkVolumeMapper()
vtkVolumeMapper::SetCroppingRegionFlagsToCross
void SetCroppingRegionFlagsToCross()
Set the flags for the cropping regions.
Definition: vtkVolumeMapper.h:185
vtkVolumeMapper::BlendModes
BlendModes
Blend modes.
Definition: vtkVolumeMapper.h:250
vtkVolumeMapper::SetBlendModeToMaximumIntensity
void SetBlendModeToMaximumIntensity()
Set/Get the blend mode.
Definition: vtkVolumeMapper.h:106
vtkVolumeMapper::SpacingAdjustedSampleDistance
double SpacingAdjustedSampleDistance(double inputSpacing[3], int inputExtent[6])
Compute a sample distance from the data spacing.
vtkAbstractVolumeMapper
Abstract class for a volume mapper.
Definition: vtkAbstractVolumeMapper.h:39
vtkVolumeMapper::MINIMUM_INTENSITY_BLEND
@ MINIMUM_INTENSITY_BLEND
Definition: vtkVolumeMapper.h:253
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkVolumeMapper::SetInputData
virtual void SetInputData(vtkImageData *)
Set/Get the input data.
vtkVolumeMapper::SetCroppingRegionFlagsToInvertedFence
void SetCroppingRegionFlagsToInvertedFence()
Set the flags for the cropping regions.
Definition: vtkVolumeMapper.h:181
vtkVolumeMapper::CroppingRegionFlags
int CroppingRegionFlags
Cropping variables, and a method for converting the world coordinate cropping region planes to voxel ...
Definition: vtkVolumeMapper.h:286
vtkVolumeMapper::GetInput
virtual vtkDataSet * GetInput()
Set/Get the input data.
vtkVolumeMapper::Cropping
vtkTypeBool Cropping
Cropping variables, and a method for converting the world coordinate cropping region planes to voxel ...
Definition: vtkVolumeMapper.h:283
vtkVolumeMapper::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkVolumeMapper::ISOSURFACE_BLEND
@ ISOSURFACE_BLEND
Definition: vtkVolumeMapper.h:256
vtkVolumeMapper::SLICE_BLEND
@ SLICE_BLEND
Definition: vtkVolumeMapper.h:257
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69