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

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