VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkVolumeMapper.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00027 #ifndef __vtkVolumeMapper_h 00028 #define __vtkVolumeMapper_h 00029 00030 #include "vtkRenderingVolumeModule.h" // For export macro 00031 #include "vtkAbstractVolumeMapper.h" 00032 00033 class vtkRenderer; 00034 class vtkVolume; 00035 class vtkImageData; 00036 00037 #define VTK_CROP_SUBVOLUME 0x0002000 00038 #define VTK_CROP_FENCE 0x2ebfeba 00039 #define VTK_CROP_INVERTED_FENCE 0x5140145 00040 #define VTK_CROP_CROSS 0x0417410 00041 #define VTK_CROP_INVERTED_CROSS 0x7be8bef 00042 00043 class vtkWindow; 00044 00045 class VTKRENDERINGVOLUME_EXPORT vtkVolumeMapper : public vtkAbstractVolumeMapper 00046 { 00047 public: 00048 vtkTypeMacro(vtkVolumeMapper,vtkAbstractVolumeMapper); 00049 void PrintSelf( ostream& os, vtkIndent indent ); 00050 00052 00053 virtual void SetInputData( vtkImageData * ); 00054 virtual void SetInputData( vtkDataSet * ); 00055 vtkImageData *GetInput(); 00057 00059 00065 vtkSetMacro( BlendMode, int ); 00066 void SetBlendModeToComposite() 00067 { this->SetBlendMode( vtkVolumeMapper::COMPOSITE_BLEND ); } 00068 void SetBlendModeToMaximumIntensity() 00069 { this->SetBlendMode( vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND ); } 00070 void SetBlendModeToMinimumIntensity() 00071 { this->SetBlendMode( vtkVolumeMapper::MINIMUM_INTENSITY_BLEND ); } 00072 void SetBlendModeToAdditive() 00073 { this->SetBlendMode( vtkVolumeMapper::ADDITIVE_BLEND ); } 00074 vtkGetMacro( BlendMode, int ); 00076 00078 00080 vtkSetClampMacro(Cropping,int,0,1); 00081 vtkGetMacro(Cropping,int); 00082 vtkBooleanMacro(Cropping,int); 00084 00086 00089 vtkSetVector6Macro( CroppingRegionPlanes, double ); 00090 vtkGetVectorMacro( CroppingRegionPlanes, double, 6 ); 00092 00094 00096 vtkGetVectorMacro( VoxelCroppingRegionPlanes, double, 6 ); 00098 00100 00109 vtkSetClampMacro( CroppingRegionFlags, int, 0x0, 0x7ffffff ); 00110 vtkGetMacro( CroppingRegionFlags, int ); 00111 void SetCroppingRegionFlagsToSubVolume() 00112 {this->SetCroppingRegionFlags( VTK_CROP_SUBVOLUME );}; 00113 void SetCroppingRegionFlagsToFence() 00114 {this->SetCroppingRegionFlags( VTK_CROP_FENCE );}; 00115 void SetCroppingRegionFlagsToInvertedFence() 00116 {this->SetCroppingRegionFlags( VTK_CROP_INVERTED_FENCE );}; 00117 void SetCroppingRegionFlagsToCross() 00118 {this->SetCroppingRegionFlags( VTK_CROP_CROSS );}; 00119 void SetCroppingRegionFlagsToInvertedCross() 00120 {this->SetCroppingRegionFlags( VTK_CROP_INVERTED_CROSS );}; 00122 00123 //BTX 00124 00127 virtual void Render(vtkRenderer *ren, vtkVolume *vol)=0; 00128 00133 virtual void ReleaseGraphicsResources(vtkWindow *) {} 00134 00135 enum 00136 { 00137 COMPOSITE_BLEND, 00138 MAXIMUM_INTENSITY_BLEND, 00139 MINIMUM_INTENSITY_BLEND, 00140 ADDITIVE_BLEND 00141 }; 00142 //ETX 00143 00144 protected: 00145 vtkVolumeMapper(); 00146 ~vtkVolumeMapper(); 00147 00148 int BlendMode; 00149 00150 // Cropping variables, and a method for converting the world 00151 // coordinate cropping region planes to voxel coordinates 00152 int Cropping; 00153 double CroppingRegionPlanes[6]; 00154 double VoxelCroppingRegionPlanes[6]; 00155 int CroppingRegionFlags; 00156 void ConvertCroppingRegionPlanesToVoxels(); 00157 00158 virtual int FillInputPortInformation(int, vtkInformation*); 00159 00160 private: 00161 vtkVolumeMapper(const vtkVolumeMapper&); // Not implemented. 00162 void operator=(const vtkVolumeMapper&); // Not implemented. 00163 }; 00164 00165 00166 #endif 00167 00168