VTK  9.0.1
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 vtkRenderer;
32 class vtkVolume;
33 class vtkImageData;
34 
35 #define VTK_CROP_SUBVOLUME 0x0002000
36 #define VTK_CROP_FENCE 0x2ebfeba
37 #define VTK_CROP_INVERTED_FENCE 0x5140145
38 #define VTK_CROP_CROSS 0x0417410
39 #define VTK_CROP_INVERTED_CROSS 0x7be8bef
40 
41 class vtkWindow;
42 
43 class VTKRENDERINGVOLUME_EXPORT vtkVolumeMapper : public vtkAbstractVolumeMapper
44 {
45 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
50 
53  virtual void SetInputData(vtkImageData*);
54  virtual void SetInputData(vtkDataSet*);
55  virtual vtkImageData* GetInput();
56  virtual vtkImageData* GetInput(const int port);
58 
60 
102  vtkSetMacro(BlendMode, int);
105  {
106  this->SetBlendMode(vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND);
107  }
109  {
110  this->SetBlendMode(vtkVolumeMapper::MINIMUM_INTENSITY_BLEND);
111  }
113  {
114  this->SetBlendMode(vtkVolumeMapper::AVERAGE_INTENSITY_BLEND);
115  }
118  void SetBlendModeToSlice() { this->SetBlendMode(vtkVolumeMapper::SLICE_BLEND); }
119  vtkGetMacro(BlendMode, int);
121 
123 
131  vtkSetVector2Macro(AverageIPScalarRange, double);
132  vtkGetVectorMacro(AverageIPScalarRange, double, 2);
134 
136 
140  vtkSetClampMacro(Cropping, vtkTypeBool, 0, 1);
141  vtkGetMacro(Cropping, vtkTypeBool);
142  vtkBooleanMacro(Cropping, vtkTypeBool);
144 
146 
151  vtkSetVector6Macro(CroppingRegionPlanes, double);
152  vtkGetVectorMacro(CroppingRegionPlanes, double, 6);
154 
156 
160  vtkGetVectorMacro(VoxelCroppingRegionPlanes, double, 6);
162 
164 
175  vtkSetClampMacro(CroppingRegionFlags, int, 0x0, 0x7ffffff);
176  vtkGetMacro(CroppingRegionFlags, int);
177  void SetCroppingRegionFlagsToSubVolume() { this->SetCroppingRegionFlags(VTK_CROP_SUBVOLUME); }
178  void SetCroppingRegionFlagsToFence() { this->SetCroppingRegionFlags(VTK_CROP_FENCE); }
180  {
181  this->SetCroppingRegionFlags(VTK_CROP_INVERTED_FENCE);
182  }
183  void SetCroppingRegionFlagsToCross() { this->SetCroppingRegionFlags(VTK_CROP_CROSS); }
185  {
186  this->SetCroppingRegionFlags(VTK_CROP_INVERTED_CROSS);
187  }
189 
195  void Render(vtkRenderer* ren, vtkVolume* vol) override = 0;
196 
204 
248  {
255  SLICE_BLEND
256  };
257 
258 protected:
260  ~vtkVolumeMapper() override;
261 
267  double SpacingAdjustedSampleDistance(double inputSpacing[3], int inputExtent[6]);
268 
270 
274  double AverageIPScalarRange[2];
275 
277 
282  double CroppingRegionPlanes[6];
283  double VoxelCroppingRegionPlanes[6];
287 
289 
290 private:
291  vtkVolumeMapper(const vtkVolumeMapper&) = delete;
292  void operator=(const vtkVolumeMapper&) = delete;
293 };
294 
295 #endif
Abstract class for a volume mapper.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:57
topologically and geometrically regular array of data
Definition: vtkImageData.h:42
a simple class to control print indentation
Definition: vtkIndent.h:34
Store vtkAlgorithm input/output information.
abstract specification for renderers
Definition: vtkRenderer.h:68
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()
void SetCroppingRegionFlagsToInvertedFence()
virtual void SetInputData(vtkDataSet *)
virtual void SetInputData(vtkImageData *)
Set/Get the input data.
void SetBlendModeToSlice()
void SetCroppingRegionFlagsToFence()
void SetCroppingRegionFlagsToInvertedCross()
void SetBlendModeToMinimumIntensity()
void SetBlendModeToAdditive()
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.
virtual vtkImageData * GetInput(const int port)
void ReleaseGraphicsResources(vtkWindow *) override
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE Release any graphics resources that are being...
virtual vtkImageData * GetInput()
void SetBlendModeToMaximumIntensity()
void SetBlendModeToIsoSurface()
void SetCroppingRegionFlagsToCross()
BlendModes
Blend modes.
~vtkVolumeMapper() override
void SetBlendModeToComposite()
void SetCroppingRegionFlagsToSubVolume()
void SetBlendModeToAverageIntensity()
vtkTypeBool Cropping
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:45
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
@ port
Definition: vtkX3D.h:453
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_CROP_INVERTED_FENCE
#define VTK_CROP_FENCE
#define VTK_CROP_SUBVOLUME
#define VTK_CROP_INVERTED_CROSS
#define VTK_CROP_CROSS