VTK  9.2.6
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 =========================================================================*/
28 #ifndef vtkVolumeMapper_h
29 #define vtkVolumeMapper_h
30 
32 #include "vtkRenderingVolumeModule.h" // For export macro
33 
34 class vtkImageData;
35 class vtkRectilinearGrid;
36 class vtkRenderer;
37 class vtkVolume;
38 
39 #define VTK_CROP_SUBVOLUME 0x0002000
40 #define VTK_CROP_FENCE 0x2ebfeba
41 #define VTK_CROP_INVERTED_FENCE 0x5140145
42 #define VTK_CROP_CROSS 0x0417410
43 #define VTK_CROP_INVERTED_CROSS 0x7be8bef
44 
45 class vtkWindow;
46 
47 class VTKRENDERINGVOLUME_EXPORT vtkVolumeMapper : public vtkAbstractVolumeMapper
48 {
49 public:
51  void PrintSelf(ostream& os, vtkIndent indent) override;
52 
54 
57  virtual void SetInputData(vtkImageData*);
58  virtual void SetInputData(vtkDataSet*);
59  virtual void SetInputData(vtkRectilinearGrid*);
60  virtual vtkDataSet* GetInput();
61  virtual vtkDataSet* GetInput(const int port);
63 
65 
107  vtkSetMacro(BlendMode, int);
110  {
111  this->SetBlendMode(vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND);
112  }
114  {
115  this->SetBlendMode(vtkVolumeMapper::MINIMUM_INTENSITY_BLEND);
116  }
118  {
119  this->SetBlendMode(vtkVolumeMapper::AVERAGE_INTENSITY_BLEND);
120  }
123  void SetBlendModeToSlice() { this->SetBlendMode(vtkVolumeMapper::SLICE_BLEND); }
124  vtkGetMacro(BlendMode, int);
126 
128 
136  vtkSetVector2Macro(AverageIPScalarRange, double);
137  vtkGetVectorMacro(AverageIPScalarRange, double, 2);
139 
141 
145  vtkSetClampMacro(Cropping, vtkTypeBool, 0, 1);
146  vtkGetMacro(Cropping, vtkTypeBool);
147  vtkBooleanMacro(Cropping, vtkTypeBool);
149 
151 
156  vtkSetVector6Macro(CroppingRegionPlanes, double);
157  vtkGetVectorMacro(CroppingRegionPlanes, double, 6);
159 
161 
165  vtkGetVectorMacro(VoxelCroppingRegionPlanes, double, 6);
167 
169 
180  vtkSetMacro(ComputeNormalFromOpacity, bool);
181  vtkGetMacro(ComputeNormalFromOpacity, bool);
182  vtkBooleanMacro(ComputeNormalFromOpacity, bool);
184 
186 
197  vtkSetClampMacro(CroppingRegionFlags, int, 0x0, 0x7ffffff);
198  vtkGetMacro(CroppingRegionFlags, int);
199  void SetCroppingRegionFlagsToSubVolume() { this->SetCroppingRegionFlags(VTK_CROP_SUBVOLUME); }
200  void SetCroppingRegionFlagsToFence() { this->SetCroppingRegionFlags(VTK_CROP_FENCE); }
202  {
203  this->SetCroppingRegionFlags(VTK_CROP_INVERTED_FENCE);
204  }
205  void SetCroppingRegionFlagsToCross() { this->SetCroppingRegionFlags(VTK_CROP_CROSS); }
207  {
208  this->SetCroppingRegionFlags(VTK_CROP_INVERTED_CROSS);
209  }
211 
217  void Render(vtkRenderer* ren, vtkVolume* vol) override = 0;
218 
226 
270  {
277  SLICE_BLEND
278  };
279 
280 protected:
281  vtkVolumeMapper();
282  ~vtkVolumeMapper() override;
283 
289  double SpacingAdjustedSampleDistance(double inputSpacing[3], int inputExtent[6]);
290 
292 
296  bool ComputeNormalFromOpacity = false;
297 
301  double AverageIPScalarRange[2];
302 
304 
309  double CroppingRegionPlanes[6];
310  double VoxelCroppingRegionPlanes[6];
312  void ConvertCroppingRegionPlanesToVoxels();
314 
315  int FillInputPortInformation(int, vtkInformation*) override;
316 
317 private:
318  vtkVolumeMapper(const vtkVolumeMapper&) = delete;
319  void operator=(const vtkVolumeMapper&) = delete;
320 };
321 
322 #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:50
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:62
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:72
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkTypeBool
Definition: vtkABI.h:69
void SetCroppingRegionFlagsToSubVolume()
Set the flags for the cropping regions.
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
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:39
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
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_CROP_FENCE
void SetBlendModeToMaximumIntensity()
Set/Get the blend mode.
#define VTK_CROP_INVERTED_FENCE