VTK  9.3.0
vtkVolumeMapper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
16 #ifndef vtkVolumeMapper_h
17 #define vtkVolumeMapper_h
18 
20 #include "vtkRenderingVolumeModule.h" // For export macro
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class vtkImageData;
24 class vtkRectilinearGrid;
25 class vtkRenderer;
26 class vtkVolume;
27 
28 #define VTK_CROP_SUBVOLUME 0x0002000
29 #define VTK_CROP_FENCE 0x2ebfeba
30 #define VTK_CROP_INVERTED_FENCE 0x5140145
31 #define VTK_CROP_CROSS 0x0417410
32 #define VTK_CROP_INVERTED_CROSS 0x7be8bef
33 
34 class vtkWindow;
35 
36 class VTKRENDERINGVOLUME_EXPORT vtkVolumeMapper : public vtkAbstractVolumeMapper
37 {
38 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
41 
43 
46  virtual void SetInputData(vtkImageData*);
47  virtual void SetInputData(vtkDataSet*);
49  virtual vtkDataSet* GetInput();
50  virtual vtkDataSet* GetInput(int port);
52 
54 
96  vtkSetMacro(BlendMode, int);
99  {
100  this->SetBlendMode(vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND);
101  }
103  {
104  this->SetBlendMode(vtkVolumeMapper::MINIMUM_INTENSITY_BLEND);
105  }
107  {
108  this->SetBlendMode(vtkVolumeMapper::AVERAGE_INTENSITY_BLEND);
109  }
112  void SetBlendModeToSlice() { this->SetBlendMode(vtkVolumeMapper::SLICE_BLEND); }
113  vtkGetMacro(BlendMode, int);
115 
117 
125  vtkSetVector2Macro(AverageIPScalarRange, double);
126  vtkGetVectorMacro(AverageIPScalarRange, double, 2);
128 
130 
134  vtkSetClampMacro(Cropping, vtkTypeBool, 0, 1);
135  vtkGetMacro(Cropping, vtkTypeBool);
136  vtkBooleanMacro(Cropping, vtkTypeBool);
138 
140 
145  vtkSetVector6Macro(CroppingRegionPlanes, double);
146  vtkGetVectorMacro(CroppingRegionPlanes, double, 6);
148 
150 
154  vtkGetVectorMacro(VoxelCroppingRegionPlanes, double, 6);
156 
158 
169  vtkSetMacro(ComputeNormalFromOpacity, bool);
170  vtkGetMacro(ComputeNormalFromOpacity, bool);
171  vtkBooleanMacro(ComputeNormalFromOpacity, bool);
173 
175 
186  vtkSetClampMacro(CroppingRegionFlags, int, 0x0, 0x7ffffff);
187  vtkGetMacro(CroppingRegionFlags, int);
188  void SetCroppingRegionFlagsToSubVolume() { this->SetCroppingRegionFlags(VTK_CROP_SUBVOLUME); }
189  void SetCroppingRegionFlagsToFence() { this->SetCroppingRegionFlags(VTK_CROP_FENCE); }
191  {
192  this->SetCroppingRegionFlags(VTK_CROP_INVERTED_FENCE);
193  }
194  void SetCroppingRegionFlagsToCross() { this->SetCroppingRegionFlags(VTK_CROP_CROSS); }
196  {
197  this->SetCroppingRegionFlags(VTK_CROP_INVERTED_CROSS);
198  }
200 
206  void Render(vtkRenderer* ren, vtkVolume* vol) override = 0;
207 
215 
259  {
266  SLICE_BLEND
267  };
268 
269 protected:
271  ~vtkVolumeMapper() override;
272 
278  double SpacingAdjustedSampleDistance(double inputSpacing[3], int inputExtent[6]);
279 
281 
285  bool ComputeNormalFromOpacity = false;
286 
290  double AverageIPScalarRange[2];
291 
293 
298  double CroppingRegionPlanes[6];
299  double VoxelCroppingRegionPlanes[6];
303 
305 
306 private:
307  vtkVolumeMapper(const vtkVolumeMapper&) = delete;
308  void operator=(const vtkVolumeMapper&) = delete;
309 };
310 
311 VTK_ABI_NAMESPACE_END
312 #endif
Abstract class for a volume mapper.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
a simple class to control print indentation
Definition: vtkIndent.h:38
Store vtkAlgorithm input/output information.
a dataset that is topologically regular with variable spacing in the three coordinate directions
abstract specification for renderers
Definition: vtkRenderer.h:71
Abstract class for a volume mapper.
double SpacingAdjustedSampleDistance(double inputSpacing[3], int inputExtent[6])
Compute a sample distance from the data spacing.
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...
void ConvertCroppingRegionPlanesToVoxels()
Cropping variables, and a method for converting the world coordinate cropping region planes to voxel ...
void SetCroppingRegionFlagsToInvertedFence()
Set the flags for the cropping regions.
virtual void SetInputData(vtkDataSet *)
Set/Get the input data.
virtual void SetInputData(vtkImageData *)
Set/Get the input data.
void SetBlendModeToSlice()
Set/Get the blend mode.
void SetCroppingRegionFlagsToFence()
Set the flags for the cropping regions.
void SetCroppingRegionFlagsToInvertedCross()
Set the flags for the cropping regions.
void SetBlendModeToMinimumIntensity()
Set/Get the blend mode.
void SetBlendModeToAdditive()
Set/Get the blend mode.
int FillInputPortInformation(int, vtkInformation *) override
Fill the input port information objects for this algorithm.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
void SetBlendModeToMaximumIntensity()
Set/Get the blend mode.
void SetBlendModeToIsoSurface()
Set/Get the blend mode.
void SetCroppingRegionFlagsToCross()
Set the flags for the cropping regions.
BlendModes
Blend modes.
~vtkVolumeMapper() override
virtual vtkDataSet * GetInput(int port)
Set/Get the input data.
void SetBlendModeToComposite()
Set/Get the blend mode.
void SetCroppingRegionFlagsToSubVolume()
Set the flags for the cropping regions.
void SetBlendModeToAverageIntensity()
Set/Get the blend mode.
virtual vtkDataSet * GetInput()
Set/Get the input data.
vtkTypeBool Cropping
Cropping variables, and a method for converting the world coordinate cropping region planes to voxel ...
int CroppingRegionFlags
Cropping variables, and a method for converting the world coordinate cropping region planes to voxel ...
virtual void SetInputData(vtkRectilinearGrid *)
Set/Get the input data.
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:49
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
@ port
Definition: vtkX3D.h:447
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_CROP_INVERTED_FENCE
#define VTK_CROP_FENCE
#define VTK_CROP_SUBVOLUME
#define VTK_CROP_INVERTED_CROSS
#define VTK_CROP_CROSS