VTK
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 =========================================================================*/
27 #ifndef __vtkVolumeMapper_h
28 #define __vtkVolumeMapper_h
29 
31 
32 class vtkRenderer;
33 class vtkVolume;
34 class vtkImageData;
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 
45 {
46 public:
48  void PrintSelf( ostream& os, vtkIndent indent );
49 
51 
52  virtual void SetInput( vtkImageData * );
53  virtual void SetInput( vtkDataSet * );
54  vtkImageData *GetInput();
56 
58 
64  vtkSetMacro( BlendMode, int );
65  void SetBlendModeToComposite()
66  { this->SetBlendMode( vtkVolumeMapper::COMPOSITE_BLEND ); }
67  void SetBlendModeToMaximumIntensity()
68  { this->SetBlendMode( vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND ); }
69  void SetBlendModeToMinimumIntensity()
70  { this->SetBlendMode( vtkVolumeMapper::MINIMUM_INTENSITY_BLEND ); }
71  void SetBlendModeToAdditive()
72  { this->SetBlendMode( vtkVolumeMapper::ADDITIVE_BLEND ); }
73  vtkGetMacro( BlendMode, int );
75 
77 
79  vtkSetClampMacro(Cropping,int,0,1);
80  vtkGetMacro(Cropping,int);
81  vtkBooleanMacro(Cropping,int);
83 
85 
88  vtkSetVector6Macro( CroppingRegionPlanes, double );
89  vtkGetVectorMacro( CroppingRegionPlanes, double, 6 );
91 
93 
95  vtkGetVectorMacro( VoxelCroppingRegionPlanes, double, 6 );
97 
99 
108  vtkSetClampMacro( CroppingRegionFlags, int, 0x0, 0x7ffffff );
109  vtkGetMacro( CroppingRegionFlags, int );
110  void SetCroppingRegionFlagsToSubVolume()
111  {this->SetCroppingRegionFlags( VTK_CROP_SUBVOLUME );};
112  void SetCroppingRegionFlagsToFence()
113  {this->SetCroppingRegionFlags( VTK_CROP_FENCE );};
114  void SetCroppingRegionFlagsToInvertedFence()
115  {this->SetCroppingRegionFlags( VTK_CROP_INVERTED_FENCE );};
116  void SetCroppingRegionFlagsToCross()
117  {this->SetCroppingRegionFlags( VTK_CROP_CROSS );};
118  void SetCroppingRegionFlagsToInvertedCross()
119  {this->SetCroppingRegionFlags( VTK_CROP_INVERTED_CROSS );};
121 
122 //BTX
123 
126  virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0;
127 
133 
134  enum
135  {
139  ADDITIVE_BLEND
140  };
141 //ETX
142 
143 protected:
144  vtkVolumeMapper();
145  ~vtkVolumeMapper();
146 
148 
149  // Cropping variables, and a method for converting the world
150  // coordinate cropping region planes to voxel coordinates
151  int Cropping;
152  double CroppingRegionPlanes[6];
153  double VoxelCroppingRegionPlanes[6];
155  void ConvertCroppingRegionPlanesToVoxels();
156 
157  virtual int FillInputPortInformation(int, vtkInformation*);
158 
159 private:
160  vtkVolumeMapper(const vtkVolumeMapper&); // Not implemented.
161  void operator=(const vtkVolumeMapper&); // Not implemented.
162 };
163 
164 
165 #endif
166 
167