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

Rendering/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 #include "vtkToolkits.h"
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_RENDERING_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   
00112 
00113   vtkSetClampMacro( BlendMode, int,
00114         VTK_BLEND_MODE_COMPOSITE, VTK_BLEND_MODE_MIN_INTENSITY );
00115   vtkGetMacro(BlendMode,int);
00116   void SetBlendModeToComposite() 
00117         {this->SetBlendMode(VTK_BLEND_MODE_COMPOSITE);};
00118   void SetBlendModeToMaximumIntensity() 
00119         {this->SetBlendMode(VTK_BLEND_MODE_MAX_INTENSITY);};
00120   void SetBlendModeToMinimumIntensity() 
00121         {this->SetBlendMode(VTK_BLEND_MODE_MIN_INTENSITY);};
00122   const char *GetBlendModeAsString(void);
00124 
00126 
00127   vtkSetVector6Macro( SubVolume, int );
00128   vtkGetVectorMacro( SubVolume, int, 6 );
00130 
00132 
00133   vtkSetClampMacro( Cursor, int, 0, 1 );
00134   vtkGetMacro( Cursor, int );
00135   vtkBooleanMacro( Cursor, int );
00137 
00139 
00140   vtkSetClampMacro( CursorType, int, 
00141                     VTK_CURSOR_TYPE_CROSSHAIR, VTK_CURSOR_TYPE_PLANE );
00142   vtkGetMacro( CursorType, int );
00143   void SetCursorTypeToCrossHair()
00144     { this->SetCursorType( VTK_CURSOR_TYPE_CROSSHAIR ); };
00145   void SetCursorTypeToPlane()
00146     { this->SetCursorType( VTK_CURSOR_TYPE_PLANE ); };
00147   const char *GetCursorTypeAsString( void );
00149 
00151 
00152   vtkSetVector3Macro( CursorPosition, double );
00153   vtkGetVectorMacro( CursorPosition, double, 3 );
00155 
00157 
00158   vtkSetVector3Macro( CursorXAxisColor, double );
00159   vtkGetVectorMacro(  CursorXAxisColor, double, 3 );
00160   vtkSetVector3Macro( CursorYAxisColor, double );
00161   vtkGetVectorMacro(  CursorYAxisColor, double, 3 );
00162   vtkSetVector3Macro( CursorZAxisColor, double );
00163   vtkGetVectorMacro(  CursorZAxisColor, double, 3 );
00165 
00167 
00168   vtkSetClampMacro( SuperSampling, int, 0, 1 );
00169   vtkGetMacro( SuperSampling, int );
00170   vtkBooleanMacro( SuperSampling, int );
00172 
00174 
00175   void SetSuperSamplingFactor( double x, double y, double z );
00176   void SetSuperSamplingFactor( double f[3] )
00177     { this->SetSuperSamplingFactor( f[0], f[1], f[2] ); };
00178   vtkGetVectorMacro( SuperSamplingFactor, double, 3 );
00180 
00182 
00183   vtkSetClampMacro( CutPlane, int, 0, 1 );
00184   vtkGetMacro( CutPlane, int );
00185   vtkBooleanMacro( CutPlane, int );
00187 
00189 
00190   vtkSetVector4Macro( CutPlaneEquation, double );
00191   vtkGetVectorMacro( CutPlaneEquation, double, 4 );
00193   
00195 
00196   vtkSetClampMacro( CutPlaneThickness, double, 0.0, 9.99e10 );
00197   vtkGetMacro( CutPlaneThickness, double );
00199 
00201 
00202   vtkSetClampMacro( CutPlaneFallOffDistance, int, 0, 16 );
00203   vtkGetMacro( CutPlaneFallOffDistance, int );
00205 
00207 
00208   vtkSetClampMacro( GradientOpacityModulation, int, 0, 1 );
00209   vtkGetMacro( GradientOpacityModulation, int );
00210   vtkBooleanMacro( GradientOpacityModulation, int );
00212 
00214 
00215   vtkSetClampMacro( GradientDiffuseModulation, int, 0, 1 );
00216   vtkGetMacro( GradientDiffuseModulation, int );
00217   vtkBooleanMacro( GradientDiffuseModulation, int );
00219 
00221 
00222   vtkSetClampMacro( GradientSpecularModulation, int, 0, 1 );
00223   vtkGetMacro( GradientSpecularModulation, int );
00224   vtkBooleanMacro( GradientSpecularModulation, int );
00226 
00228 
00229   vtkGetMacro( NoHardware, int );
00230   vtkGetMacro( WrongVLIVersion, int );
00232   
00234 
00235   vtkGetMacro( NumberOfBoards, int );
00236   vtkGetMacro( MajorBoardVersion, int );
00237   vtkGetMacro( MinorBoardVersion, int );
00238   virtual int GetAvailableBoardMemory() { return 0; }
00239   virtual void GetLockSizesForBoardMemory( unsigned int vtkNotUsed(type),
00240                                            unsigned int * vtkNotUsed(xSize),
00241                                            unsigned int * vtkNotUsed(ySize),
00242                                            unsigned int * vtkNotUsed(zSize)) {};
00244 
00246 
00248   vtkSetClampMacro(IntermixIntersectingGeometry, int, 0, 1);
00249   vtkGetMacro(IntermixIntersectingGeometry, int);
00250   vtkBooleanMacro(IntermixIntersectingGeometry, int);
00252   
00253 protected:
00254   vtkVolumeProMapper();
00255   ~vtkVolumeProMapper();
00256  // Make sure everything is OK for rendering
00257   int StatusOK();
00258 
00259   // The volume context - create it once and keep it around
00260   VLIContext           *Context;
00261 
00262   // The Volume, and the Input that was used to build the volume
00263   // and the time at which it was last built.
00264   VLIVolume            *Volume;
00265   vtkImageData         *VolumeInput;
00266   vtkTimeStamp         *VolumeBuildTime;
00267 
00268   // The type of data in the volume - 8bit, 12bit upper, or 12bit lower
00269   int                  VolumeDataType;
00270 
00271   // The lookup table for RGBA - create it once then modify it as 
00272   // necessary
00273   VLILookupTable       *LookupTable;
00274 
00275   // The blending mode to use
00276   int                  BlendMode;
00277 
00278   // The lights, and how many of them there are. Not all of them
00279   // are turned on or used.
00280   VLILight             **Lights;
00281   int                  NumberOfLights;
00282 
00283   // The subvolume extent (xmin, xmax, ymin, ymax, zmin, zmax)
00284   int                  SubVolume[6];
00285 
00286   // The cursor parameters
00287   int                  Cursor;
00288   int                  CursorType;
00289   double               CursorPosition[3];
00290   double               CursorXAxisColor[3];
00291   double               CursorYAxisColor[3];
00292   double               CursorZAxisColor[3];
00293   
00294   // The cut plane parameters
00295   int                  CutPlane;
00296   VLICutPlane          *Cut;
00297   double               CutPlaneEquation[4];
00298   double               CutPlaneThickness;
00299   int                  CutPlaneFallOffDistance;
00300 
00301   // The supersampling parameters
00302   int                  SuperSampling;
00303   double               SuperSamplingFactor[3];
00304 
00305   // The gradient modulation flags
00306   int                  GradientOpacityModulation;
00307   int                  GradientDiffuseModulation;
00308   int                  GradientSpecularModulation;
00309 
00310   // Some board properties
00311   int                  NumberOfBoards;
00312   int                  MajorBoardVersion;
00313   int                  MinorBoardVersion;
00314   int                  GradientTableSize;
00315 
00316   // Some error conditions that may occur during initialization
00317   int                  NoHardware;
00318   int                  WrongVLIVersion;
00319   int                  DisplayedMessage;
00320 
00321   // The embedded geometry flag
00322   int IntermixIntersectingGeometry;
00323   
00324 private:
00325   vtkVolumeProMapper(const vtkVolumeProMapper&);  // Not implemented.
00326   void operator=(const vtkVolumeProMapper&);  // Not implemented.
00327 };
00328 
00330 inline const char *vtkVolumeProMapper::GetBlendModeAsString()
00331 {
00332   switch ( this->BlendMode )
00333     {
00334     case VTK_BLEND_MODE_COMPOSITE:
00335       return "Composite";
00336     case VTK_BLEND_MODE_MAX_INTENSITY:
00337       return "Maximum Intensity";
00338     case VTK_BLEND_MODE_MIN_INTENSITY:
00339       return "Minimum Intensity";
00340     default:
00341       return "Unknown Blend Mode";
00342     }
00343 }
00344 
00346 inline const char *vtkVolumeProMapper::GetCursorTypeAsString()
00347 {
00348   switch ( this->CursorType )
00349     {
00350     case VTK_CURSOR_TYPE_CROSSHAIR:
00351       return "Crosshair";
00352     case VTK_CURSOR_TYPE_PLANE:
00353       return "Plane";
00354     default:
00355       return "Unknown Cursor Type";
00356     }
00357 }
00358 
00359 #endif
00360 

Generated on Thu Mar 28 14:19:34 2002 for VTK by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001