VTK  9.7.1
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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkImageData;
25 class vtkRectilinearGrid;
26 class vtkRenderer;
27 class vtkVolume;
28 
29 #define VTK_CROP_SUBVOLUME 0x0002000
30 #define VTK_CROP_FENCE 0x2ebfeba
31 #define VTK_CROP_INVERTED_FENCE 0x5140145
32 #define VTK_CROP_CROSS 0x0417410
33 #define VTK_CROP_INVERTED_CROSS 0x7be8bef
34 
35 class vtkWindow;
36 
37 class VTKRENDERINGVOLUME_EXPORT VTK_MARSHALAUTO vtkVolumeMapper : public vtkAbstractVolumeMapper
38 {
39 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
47  virtual void SetInputData(vtkImageData*);
48  virtual void SetInputData(vtkDataSet*);
49  virtual void SetInputData(vtkRectilinearGrid*);
50  virtual vtkDataSet* GetInput();
51  virtual vtkDataSet* GetInput(int port);
53 
55 
97  vtkSetMacro(BlendMode, int);
100  {
101  this->SetBlendMode(vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND);
102  }
104  {
105  this->SetBlendMode(vtkVolumeMapper::MINIMUM_INTENSITY_BLEND);
106  }
108  {
109  this->SetBlendMode(vtkVolumeMapper::AVERAGE_INTENSITY_BLEND);
110  }
113  void SetBlendModeToSlice() { this->SetBlendMode(vtkVolumeMapper::SLICE_BLEND); }
114  vtkGetMacro(BlendMode, int);
116 
118 
126  vtkSetVector2Macro(AverageIPScalarRange, double);
127  vtkGetVectorMacro(AverageIPScalarRange, double, 2);
129 
131 
135  vtkSetClampMacro(Cropping, vtkTypeBool, 0, 1);
136  vtkGetMacro(Cropping, vtkTypeBool);
137  vtkBooleanMacro(Cropping, vtkTypeBool);
139 
141 
146  vtkSetVector6Macro(CroppingRegionPlanes, double);
147  vtkGetVectorMacro(CroppingRegionPlanes, double, 6);
149 
151 
155  vtkGetVectorMacro(VoxelCroppingRegionPlanes, double, 6);
157 
159 
170  vtkSetMacro(ComputeNormalFromOpacity, bool);
171  vtkGetMacro(ComputeNormalFromOpacity, bool);
172  vtkBooleanMacro(ComputeNormalFromOpacity, bool);
174 
176 
187  vtkSetClampMacro(CroppingRegionFlags, int, 0x0, 0x7ffffff);
188  vtkGetMacro(CroppingRegionFlags, int);
189  void SetCroppingRegionFlagsToSubVolume() { this->SetCroppingRegionFlags(VTK_CROP_SUBVOLUME); }
190  void SetCroppingRegionFlagsToFence() { this->SetCroppingRegionFlags(VTK_CROP_FENCE); }
192  {
193  this->SetCroppingRegionFlags(VTK_CROP_INVERTED_FENCE);
194  }
195  void SetCroppingRegionFlagsToCross() { this->SetCroppingRegionFlags(VTK_CROP_CROSS); }
197  {
198  this->SetCroppingRegionFlags(VTK_CROP_INVERTED_CROSS);
199  }
201 
207  void Render(vtkRenderer* ren, vtkVolume* vol) override = 0;
208 
216 
260  {
267  SLICE_BLEND
268  };
269 
270 protected:
271  vtkVolumeMapper();
272  ~vtkVolumeMapper() override;
273 
279  double SpacingAdjustedSampleDistance(double inputSpacing[3], int inputExtent[6]);
280 
282 
286  bool ComputeNormalFromOpacity = false;
287 
291  double AverageIPScalarRange[2];
292 
294 
299  double CroppingRegionPlanes[6];
300  double VoxelCroppingRegionPlanes[6];
302  void ConvertCroppingRegionPlanesToVoxels();
304 
305  int FillInputPortInformation(int, vtkInformation*) override;
306 
307 private:
308  vtkVolumeMapper(const vtkVolumeMapper&) = delete;
309  void operator=(const vtkVolumeMapper&) = delete;
310 };
311 
312 VTK_ABI_NAMESPACE_END
313 #endif
void SetBlendModeToAdditive()
Set/Get the blend mode.
int CroppingRegionFlags
Cropping variables, and a method for converting the world coordinate cropping region planes to voxel ...
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:40
a dataset that is topologically regular with variable spacing in the three coordinate directions ...
Abstract class for a volume mapper.
#define VTK_CROP_CROSS
virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THIS METHOD OUTSIDE OF THE RENDERI...
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
void SetBlendModeToIsoSurface()
Set/Get the blend mode.
void SetCroppingRegionFlagsToCross()
Set the flags for the cropping regions.
Abstract class for a volume mapper.
abstract specification for renderers
Definition: vtkRenderer.h:63
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:64
void SetCroppingRegionFlagsToSubVolume()
Set the flags for the cropping regions.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
void SetBlendModeToSlice()
Set/Get the blend mode.
void SetCroppingRegionFlagsToInvertedFence()
Set the flags for the cropping regions.
#define VTK_CROP_INVERTED_CROSS
void SetBlendModeToComposite()
Set/Get the blend mode.
a simple class to control print indentation
Definition: vtkIndent.h:28
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
void SetCroppingRegionFlagsToFence()
Set the flags for the cropping regions.
BlendModes
Blend modes.
#define VTK_CROP_SUBVOLUME
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
void SetCroppingRegionFlagsToInvertedCross()
Set the flags for the cropping regions.
void SetBlendModeToMinimumIntensity()
Set/Get the blend mode.
void SetBlendModeToAverageIntensity()
Set/Get the blend mode.
vtkTypeBool Cropping
Cropping variables, and a method for converting the world coordinate cropping region planes to voxel ...
#define VTK_MARSHALAUTO
#define VTK_CROP_FENCE
void SetBlendModeToMaximumIntensity()
Set/Get the blend mode.
#define VTK_CROP_INVERTED_FENCE