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

contrib/vtkVolumeProMapper.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkVolumeProMapper.h,v $
00005   Language:  C++
00006 
00007 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 All rights reserved.
00010 
00011 Redistribution and use in source and binary forms, with or without
00012 modification, are permitted provided that the following conditions are met:
00013 
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016 
00017  * Redistributions in binary form must reproduce the above copyright notice,
00018    this list of conditions and the following disclaimer in the documentation
00019    and/or other materials provided with the distribution.
00020 
00021  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00022    of any contributors may be used to endorse or promote products derived
00023    from this software without specific prior written permission.
00024 
00025  * Modified source versions must be plainly marked as such, and must not be
00026    misrepresented as being the original software.
00027 
00028 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00029 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00030 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00031 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00032 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00033 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00034 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00035 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00036 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00037 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038 
00039 =========================================================================*/
00075 #ifndef __vtkVolumeProMapper_h
00076 #define __vtkVolumeProMapper_h
00077 
00078 #include "vtkVolumeMapper.h"
00079 
00080 //BTX
00081 class VLIContext;
00082 class VLIVolume;
00083 class VLILookupTable;
00084 class VLILight;
00085 class VLICutPlane;
00086 //ETX
00087 
00088 #define VTK_BLEND_MODE_COMPOSITE        0
00089 #define VTK_BLEND_MODE_MAX_INTENSITY    1
00090 #define VTK_BLEND_MODE_MIN_INTENSITY    2
00091 
00092 #define VTK_CURSOR_TYPE_CROSSHAIR       0
00093 #define VTK_CURSOR_TYPE_PLANE           1
00094 
00095 #define VTK_VOLUME_8BIT                 0
00096 #define VTK_VOLUME_12BIT_UPPER          1
00097 #define VTK_VOLUME_12BIT_LOWER          2
00098 
00099 class VTK_EXPORT vtkVolumeProMapper : public vtkVolumeMapper
00100 {
00101 public:
00102   vtkTypeMacro(vtkVolumeProMapper,vtkVolumeMapper);
00103   void PrintSelf( ostream& os, vtkIndent index );
00104 
00106   static vtkVolumeProMapper *New();
00107 
00109   virtual void Render( vtkRenderer *, vtkVolume * ) {}
00110   
00113   int GetMapperType() { return VTK_FRAMEBUFFER_VOLUME_MAPPER; };
00114 
00116   vtkSetClampMacro( BlendMode, int,
00117    VTK_BLEND_MODE_COMPOSITE, VTK_BLEND_MODE_MIN_INTENSITY );
00118   vtkGetMacro(BlendMode,int);
00119   void SetBlendModeToComposite() 
00120    {this->SetBlendMode(VTK_BLEND_MODE_COMPOSITE);};
00121   void SetBlendModeToMaximumIntensity() 
00122    {this->SetBlendMode(VTK_BLEND_MODE_MAX_INTENSITY);};
00123   void SetBlendModeToMinimumIntensity() 
00124    {this->SetBlendMode(VTK_BLEND_MODE_MIN_INTENSITY);};
00125   const char *GetBlendModeAsString(void);
00126 
00128   vtkSetVector6Macro( SubVolume, int );
00129   vtkGetVectorMacro( SubVolume, int, 6 );
00130 
00132   vtkSetClampMacro( Cursor, int, 0, 1 );
00133   vtkGetMacro( Cursor, int );
00134   vtkBooleanMacro( Cursor, int );
00135 
00137   vtkSetClampMacro( CursorType, int, 
00138           VTK_CURSOR_TYPE_CROSSHAIR, VTK_CURSOR_TYPE_PLANE );
00139   vtkGetMacro( CursorType, int );
00140   void SetCursorTypeToCrossHair()
00141     { this->SetCursorType( VTK_CURSOR_TYPE_CROSSHAIR ); };
00142   void SetCursorTypeToPlane()
00143     { this->SetCursorType( VTK_CURSOR_TYPE_PLANE ); };
00144   const char *GetCursorTypeAsString( void );
00145 
00147   vtkSetVector3Macro( CursorPosition, double );
00148   vtkGetVectorMacro( CursorPosition, double, 3 );
00149 
00151   vtkSetVector3Macro( CursorXAxisColor, double );
00152   vtkGetVectorMacro(  CursorXAxisColor, double, 3 );
00153   vtkSetVector3Macro( CursorYAxisColor, double );
00154   vtkGetVectorMacro(  CursorYAxisColor, double, 3 );
00155   vtkSetVector3Macro( CursorZAxisColor, double );
00156   vtkGetVectorMacro(  CursorZAxisColor, double, 3 );
00157 
00159   vtkSetClampMacro( SuperSampling, int, 0, 1 );
00160   vtkGetMacro( SuperSampling, int );
00161   vtkBooleanMacro( SuperSampling, int );
00162 
00164   void SetSuperSamplingFactor( double x, double y, double z );
00165   void SetSuperSamplingFactor( double f[3] )
00166     { this->SetSuperSamplingFactor( f[0], f[1], f[2] ); };
00167   vtkGetVectorMacro( SuperSamplingFactor, double, 3 );
00168 
00170   vtkSetClampMacro( CutPlane, int, 0, 1 );
00171   vtkGetMacro( CutPlane, int );
00172   vtkBooleanMacro( CutPlane, int );
00173 
00175   vtkSetVector4Macro( CutPlaneEquation, double );
00176   vtkGetVectorMacro( CutPlaneEquation, double, 4 );
00177   
00179   vtkSetClampMacro( CutPlaneThickness, double, 0.0, 9.99e10 );
00180   vtkGetMacro( CutPlaneThickness, double );
00181 
00183   vtkSetClampMacro( CutPlaneFallOffDistance, int, 0, 16 );
00184   vtkGetMacro( CutPlaneFallOffDistance, int );
00185 
00187   vtkSetClampMacro( GradientOpacityModulation, int, 0, 1 );
00188   vtkGetMacro( GradientOpacityModulation, int );
00189   vtkBooleanMacro( GradientOpacityModulation, int );
00190 
00192   vtkSetClampMacro( GradientDiffuseModulation, int, 0, 1 );
00193   vtkGetMacro( GradientDiffuseModulation, int );
00194   vtkBooleanMacro( GradientDiffuseModulation, int );
00195 
00197   vtkSetClampMacro( GradientSpecularModulation, int, 0, 1 );
00198   vtkGetMacro( GradientSpecularModulation, int );
00199   vtkBooleanMacro( GradientSpecularModulation, int );
00200 
00202   vtkGetMacro( NoHardware, int );
00203   vtkGetMacro( WrongVLIVersion, int );
00204   
00206   vtkGetMacro( NumberOfBoards, int );
00207   vtkGetMacro( MajorBoardVersion, int );
00208   vtkGetMacro( MinorBoardVersion, int );
00209   virtual int GetAvailableBoardMemory() { return 0; }
00210   virtual void GetLockSizesForBoardMemory( unsigned int vtkNotUsed(type),
00211                   unsigned int * vtkNotUsed(xSize),
00212                   unsigned int * vtkNotUsed(ySize),
00213                   unsigned int * vtkNotUsed(zSize)) {};
00214  
00215 protected:
00216   vtkVolumeProMapper();
00217   ~vtkVolumeProMapper();
00218   vtkVolumeProMapper(const vtkVolumeProMapper&) {};
00219   void operator=(const vtkVolumeProMapper&) {};
00220  // Make sure everything is OK for rendering
00221   int StatusOK();
00222 
00223   // The volume context - create it once and keep it around
00224   VLIContext           *Context;
00225 
00226   // The Volume, and the Input that was used to build the volume
00227   // and the time at which it was last built.
00228   VLIVolume            *Volume;
00229   vtkImageData         *VolumeInput;
00230   vtkTimeStamp         *VolumeBuildTime;
00231 
00232   // The type of data in the volume - 8bit, 12bit upper, or 12bit lower
00233   int                  VolumeDataType;
00234 
00235   // The lookup table for RGBA - create it once then modify it as 
00236   // necessary
00237   VLILookupTable       *LookupTable;
00238 
00239   // The blending mode to use
00240   int                  BlendMode;
00241 
00242   // The lights, and how many of them there are. Not all of them
00243   // are turned on or used.
00244   VLILight             **Lights;
00245   int                  NumberOfLights;
00246 
00247   // The subvolume extent (xmin, xmax, ymin, ymax, zmin, zmax)
00248   int                  SubVolume[6];
00249 
00250   // The cursor parameters
00251   int                  Cursor;
00252   int                  CursorType;
00253   double               CursorPosition[3];
00254   double               CursorXAxisColor[3];
00255   double               CursorYAxisColor[3];
00256   double               CursorZAxisColor[3];
00257   
00258   // The cut plane parameters
00259   int                  CutPlane;
00260   VLICutPlane          *Cut;
00261   double               CutPlaneEquation[4];
00262   double               CutPlaneThickness;
00263   int                  CutPlaneFallOffDistance;
00264 
00265   // The supersampling parameters
00266   int                  SuperSampling;
00267   double               SuperSamplingFactor[3];
00268 
00269   // The gradient modulation flags
00270   int                  GradientOpacityModulation;
00271   int                  GradientDiffuseModulation;
00272   int                  GradientSpecularModulation;
00273 
00274   // Some board properties
00275   int                  NumberOfBoards;
00276   int                  MajorBoardVersion;
00277   int                  MinorBoardVersion;
00278   int                  GradientTableSize;
00279 
00280   // Some error conditions that may occur during initialization
00281   int                  NoHardware;
00282   int                  WrongVLIVersion;
00283   int                  DisplayedMessage;
00284 
00285 };
00286 
00288 inline const char *vtkVolumeProMapper::GetBlendModeAsString()
00289 {
00290   switch ( this->BlendMode )
00291     {
00292     case VTK_BLEND_MODE_COMPOSITE:
00293       return "Composite";
00294     case VTK_BLEND_MODE_MAX_INTENSITY:
00295       return "Maximum Intensity";
00296     case VTK_BLEND_MODE_MIN_INTENSITY:
00297       return "Minimum Intensity";
00298     default:
00299       return "Unknown Blend Mode";
00300     }
00301 }
00302 
00304 inline const char *vtkVolumeProMapper::GetCursorTypeAsString()
00305 {
00306   switch ( this->CursorType )
00307     {
00308     case VTK_CURSOR_TYPE_CROSSHAIR:
00309       return "Crosshair";
00310     case VTK_CURSOR_TYPE_PLANE:
00311       return "Plane";
00312     default:
00313       return "Unknown Cursor Type";
00314     }
00315 }
00316 
00317 #endif
00318 

Generated on Wed Nov 21 12:26:56 2001 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001