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

Generated on Mon Jan 21 23:07:38 2008 for VTK by  doxygen 1.4.3-20050530