Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/Rendering/vtkVolumeProMapper.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkVolumeProMapper.h,v $ 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 =========================================================================*/ 00047 #ifndef __vtkVolumeProMapper_h 00048 #define __vtkVolumeProMapper_h 00049 00050 #include "vtkVolumeMapper.h" 00051 #include "vtkToolkits.h" // Needed for VTK_HAVE_VP1000 00052 #include "vtkVersion.h" // Needed for VTK_*_VERSION 00053 00054 //BTX 00055 #if defined (VTK_HAVE_VP1000) || defined (VTK_FORCE_COMPILE_VP1000) 00056 namespace vli3 { 00057 #endif 00058 class VLIContext; 00059 class VLIVolume; 00060 class VLILookupTable; 00061 class VLILight; 00062 class VLICutPlane; 00063 #if defined (VTK_HAVE_VP1000) || defined (VTK_FORCE_COMPILE_VP1000) 00064 } 00065 using namespace vli3; 00066 #endif 00067 //ETX 00068 00069 #define VTK_BLEND_MODE_COMPOSITE 0 00070 #define VTK_BLEND_MODE_MAX_INTENSITY 1 00071 #define VTK_BLEND_MODE_MIN_INTENSITY 2 00072 00073 #define VTK_CURSOR_TYPE_CROSSHAIR 0 00074 #define VTK_CURSOR_TYPE_PLANE 1 00075 00076 #define VTK_VOLUME_8BIT 0 00077 #define VTK_VOLUME_12BIT_UPPER 1 00078 #define VTK_VOLUME_12BIT_LOWER 2 00079 //BTX 00080 #if ((VTK_MAJOR_VERSION == 3)&&(VTK_MINOR_VERSION == 2)) 00081 #define VTK_VOLUME_PRO_MAPPER_EXPORT VTK_EXPORT 00082 #else 00083 #define VTK_VOLUME_PRO_MAPPER_EXPORT VTK_RENDERING_EXPORT 00084 #endif 00085 //ETX 00086 00087 class VTK_VOLUME_PRO_MAPPER_EXPORT vtkVolumeProMapper : public vtkVolumeMapper 00088 { 00089 public: 00090 vtkTypeRevisionMacro(vtkVolumeProMapper,vtkVolumeMapper); 00091 void PrintSelf( ostream& os, vtkIndent indent ); 00092 00094 static vtkVolumeProMapper *New(); 00095 00097 virtual void Render( vtkRenderer *, vtkVolume * ) {} 00098 00100 00101 vtkSetClampMacro( BlendMode, int, 00102 VTK_BLEND_MODE_COMPOSITE, VTK_BLEND_MODE_MIN_INTENSITY ); 00103 vtkGetMacro(BlendMode,int); 00104 void SetBlendModeToComposite() 00105 {this->SetBlendMode(VTK_BLEND_MODE_COMPOSITE);}; 00106 void SetBlendModeToMaximumIntensity() 00107 {this->SetBlendMode(VTK_BLEND_MODE_MAX_INTENSITY);}; 00108 void SetBlendModeToMinimumIntensity() 00109 {this->SetBlendMode(VTK_BLEND_MODE_MIN_INTENSITY);}; 00110 const char *GetBlendModeAsString(void); 00112 00114 00115 vtkSetVector6Macro( SubVolume, int ); 00116 vtkGetVectorMacro( SubVolume, int, 6 ); 00118 00120 00121 vtkSetClampMacro( Cursor, int, 0, 1 ); 00122 vtkGetMacro( Cursor, int ); 00123 vtkBooleanMacro( Cursor, int ); 00125 00127 00128 vtkSetClampMacro( CursorType, int, 00129 VTK_CURSOR_TYPE_CROSSHAIR, VTK_CURSOR_TYPE_PLANE ); 00130 vtkGetMacro( CursorType, int ); 00131 void SetCursorTypeToCrossHair() 00132 { this->SetCursorType( VTK_CURSOR_TYPE_CROSSHAIR ); }; 00133 void SetCursorTypeToPlane() 00134 { this->SetCursorType( VTK_CURSOR_TYPE_PLANE ); }; 00135 const char *GetCursorTypeAsString( void ); 00137 00139 00140 vtkSetVector3Macro( CursorPosition, double ); 00141 vtkGetVectorMacro( CursorPosition, double, 3 ); 00143 00145 00146 vtkSetVector3Macro( CursorXAxisColor, double ); 00147 vtkGetVectorMacro( CursorXAxisColor, double, 3 ); 00148 vtkSetVector3Macro( CursorYAxisColor, double ); 00149 vtkGetVectorMacro( CursorYAxisColor, double, 3 ); 00150 vtkSetVector3Macro( CursorZAxisColor, double ); 00151 vtkGetVectorMacro( CursorZAxisColor, double, 3 ); 00153 00155 00156 vtkSetClampMacro( SuperSampling, int, 0, 1 ); 00157 vtkGetMacro( SuperSampling, int ); 00158 vtkBooleanMacro( SuperSampling, int ); 00160 00162 00163 void SetSuperSamplingFactor( double x, double y, double z ); 00164 void SetSuperSamplingFactor( double f[3] ) 00165 { this->SetSuperSamplingFactor( f[0], f[1], f[2] ); }; 00166 vtkGetVectorMacro( SuperSamplingFactor, double, 3 ); 00168 00170 00171 vtkSetClampMacro( CutPlane, int, 0, 1 ); 00172 vtkGetMacro( CutPlane, int ); 00173 vtkBooleanMacro( CutPlane, int ); 00175 00177 00178 vtkSetVector4Macro( CutPlaneEquation, double ); 00179 vtkGetVectorMacro( CutPlaneEquation, double, 4 ); 00181 00183 00184 vtkSetClampMacro( CutPlaneThickness, double, 0.0, 9.99e10 ); 00185 vtkGetMacro( CutPlaneThickness, double ); 00187 00189 00190 vtkSetClampMacro( CutPlaneFallOffDistance, int, 0, 16 ); 00191 vtkGetMacro( CutPlaneFallOffDistance, int ); 00193 00195 00196 vtkSetClampMacro( GradientOpacityModulation, int, 0, 1 ); 00197 vtkGetMacro( GradientOpacityModulation, int ); 00198 vtkBooleanMacro( GradientOpacityModulation, int ); 00200 00202 00203 vtkSetClampMacro( GradientDiffuseModulation, int, 0, 1 ); 00204 vtkGetMacro( GradientDiffuseModulation, int ); 00205 vtkBooleanMacro( GradientDiffuseModulation, int ); 00207 00209 00210 vtkSetClampMacro( GradientSpecularModulation, int, 0, 1 ); 00211 vtkGetMacro( GradientSpecularModulation, int ); 00212 vtkBooleanMacro( GradientSpecularModulation, int ); 00214 00216 00217 vtkGetMacro( NoHardware, int ); 00218 vtkGetMacro( WrongVLIVersion, int ); 00220 00222 00223 vtkGetMacro( NumberOfBoards, int ); 00224 vtkGetMacro( MajorBoardVersion, int ); 00225 vtkGetMacro( MinorBoardVersion, int ); 00226 virtual int GetAvailableBoardMemory() { return 0; } 00227 virtual void GetLockSizesForBoardMemory( unsigned int vtkNotUsed(type), 00228 unsigned int * vtkNotUsed(xSize), 00229 unsigned int * vtkNotUsed(ySize), 00230 unsigned int * vtkNotUsed(zSize)) {}; 00232 00234 00236 vtkSetClampMacro(IntermixIntersectingGeometry, int, 0, 1); 00237 vtkGetMacro(IntermixIntersectingGeometry, int); 00238 vtkBooleanMacro(IntermixIntersectingGeometry, int); 00240 00241 protected: 00242 vtkVolumeProMapper(); 00243 ~vtkVolumeProMapper(); 00244 // Make sure everything is OK for rendering 00245 int StatusOK(); 00246 00247 // The volume context - create it once and keep it around 00248 VLIContext *Context; 00249 00250 // The Volume, and the Input that was used to build the volume 00251 // and the time at which it was last built. 00252 VLIVolume *Volume; 00253 vtkImageData *VolumeInput; 00254 vtkTimeStamp *VolumeBuildTime; 00255 00256 // The type of data in the volume - 8bit, 12bit upper, or 12bit lower 00257 int VolumeDataType; 00258 00259 // The lookup table for RGBA - create it once then modify it as 00260 // necessary 00261 VLILookupTable *LookupTable; 00262 00263 // The blending mode to use 00264 int BlendMode; 00265 00266 // The lights, and how many of them there are. Not all of them 00267 // are turned on or used. 00268 VLILight **Lights; 00269 int NumberOfLights; 00270 00271 // The subvolume extent (xmin, xmax, ymin, ymax, zmin, zmax) 00272 int SubVolume[6]; 00273 00274 // The cursor parameters 00275 int Cursor; 00276 int CursorType; 00277 double CursorPosition[3]; 00278 double CursorXAxisColor[3]; 00279 double CursorYAxisColor[3]; 00280 double CursorZAxisColor[3]; 00281 00282 // The cut plane parameters 00283 int CutPlane; 00284 VLICutPlane *Cut; 00285 double CutPlaneEquation[4]; 00286 double CutPlaneThickness; 00287 int CutPlaneFallOffDistance; 00288 00289 // The supersampling parameters 00290 int SuperSampling; 00291 double SuperSamplingFactor[3]; 00292 00293 // The gradient modulation flags 00294 int GradientOpacityModulation; 00295 int GradientDiffuseModulation; 00296 int GradientSpecularModulation; 00297 00298 // Some board properties 00299 int NumberOfBoards; 00300 int MajorBoardVersion; 00301 int MinorBoardVersion; 00302 int GradientTableSize; 00303 00304 // Some error conditions that may occur during initialization 00305 int NoHardware; 00306 int WrongVLIVersion; 00307 int DisplayedMessage; 00308 00309 // The embedded geometry flag 00310 int IntermixIntersectingGeometry; 00311 00312 //BTX 00313 #if ((VTK_MAJOR_VERSION == 3)&&(VTK_MINOR_VERSION == 2)) 00314 // WARNING: INTERNAL METHOD - NOT FOR GENERAL USE 00315 virtual int GetMapperType() {return VTK_FRAMEBUFFER_VOLUME_MAPPER;}; 00316 #endif 00317 //ETX 00318 00319 private: 00320 vtkVolumeProMapper(const vtkVolumeProMapper&); // Not implemented. 00321 void operator=(const vtkVolumeProMapper&); // Not implemented. 00322 }; 00323 00325 inline const char *vtkVolumeProMapper::GetBlendModeAsString() 00326 { 00327 switch ( this->BlendMode ) 00328 { 00329 case VTK_BLEND_MODE_COMPOSITE: 00330 return "Composite"; 00331 case VTK_BLEND_MODE_MAX_INTENSITY: 00332 return "Maximum Intensity"; 00333 case VTK_BLEND_MODE_MIN_INTENSITY: 00334 return "Minimum Intensity"; 00335 default: 00336 return "Unknown Blend Mode"; 00337 } 00338 } 00339 00341 inline const char *vtkVolumeProMapper::GetCursorTypeAsString() 00342 { 00343 switch ( this->CursorType ) 00344 { 00345 case VTK_CURSOR_TYPE_CROSSHAIR: 00346 return "Crosshair"; 00347 case VTK_CURSOR_TYPE_PLANE: 00348 return "Plane"; 00349 default: 00350 return "Unknown Cursor Type"; 00351 } 00352 } 00353 00354 #endif 00355