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

Rendering/vtkVolumeProperty.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkVolumeProperty.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00016 
00064 #ifndef __vtkVolumeProperty_h
00065 #define __vtkVolumeProperty_h
00066 
00067 #include "vtkObject.h"
00068 
00069 class vtkPiecewiseFunction;
00070 class vtkTimeStamp;
00071 class vtkColorTransferFunction;
00072 
00073 class VTK_RENDERING_EXPORT vtkVolumeProperty : public vtkObject
00074 {
00075 public:
00076   static vtkVolumeProperty *New();
00077   vtkTypeRevisionMacro(vtkVolumeProperty,vtkObject);
00078   void PrintSelf(ostream& os, vtkIndent indent);
00079 
00082   unsigned long GetMTime();
00083   
00084 
00086 
00087   vtkSetClampMacro( InterpolationType, int,
00088         VTK_NEAREST_INTERPOLATION, VTK_LINEAR_INTERPOLATION);
00089   vtkGetMacro(InterpolationType,int);
00090   void SetInterpolationTypeToNearest() 
00091         {this->SetInterpolationType(VTK_NEAREST_INTERPOLATION);};
00092   void SetInterpolationTypeToLinear() 
00093         {this->SetInterpolationType(VTK_LINEAR_INTERPOLATION);};
00094   const char *GetInterpolationTypeAsString(void);
00096 
00098 
00101   void SetColor( int index, vtkPiecewiseFunction *function );
00102   void SetColor( vtkPiecewiseFunction *f ){this->SetColor(0,f);};
00104   
00105       
00107 
00110   void SetColor( int index, vtkColorTransferFunction *function );
00111   void SetColor( vtkColorTransferFunction *f ){this->SetColor(0,f);};
00113   
00115 
00117   int GetColorChannels( int index );
00118   int GetColorChannels(){return this->GetColorChannels(0);};
00120   
00122 
00123   vtkPiecewiseFunction *GetGrayTransferFunction( int index );
00124   vtkPiecewiseFunction *GetGrayTransferFunction()
00125     {return this->GetGrayTransferFunction(0);};
00127   
00129 
00130   vtkColorTransferFunction *GetRGBTransferFunction( int index );
00131   vtkColorTransferFunction *GetRGBTransferFunction()
00132     {return this->GetRGBTransferFunction(0);};
00134   
00136 
00138   void SetScalarOpacity( int index, vtkPiecewiseFunction *function );
00139   void SetScalarOpacity( vtkPiecewiseFunction *f )
00140     {this->SetScalarOpacity(0,f);};
00142   
00144 
00145   vtkPiecewiseFunction *GetScalarOpacity( int index );
00146   vtkPiecewiseFunction *GetScalarOpacity()
00147     {return this->GetScalarOpacity(0);};
00149   
00150       
00152 
00154   void SetGradientOpacity( int index, vtkPiecewiseFunction *function );
00155   void SetGradientOpacity( vtkPiecewiseFunction *function )
00156     {this->SetGradientOpacity(0,function);}
00158   
00160 
00162   vtkPiecewiseFunction *GetGradientOpacity( int index );
00163   vtkPiecewiseFunction *GetGradientOpacity()
00164     {return this->GetGradientOpacity( 0 );}
00166   
00168 
00176   void SetShade( int index, int value );
00177   void SetShade( int value ) {this->SetShade(0,value);}
00178   int GetShade( int index );
00179   int GetShade() {return this->GetShade(0);}
00180   void ShadeOn( int index );
00181   void ShadeOn() {this->ShadeOn(0);}
00182   void ShadeOff( int index );
00183   void ShadeOff() {this->ShadeOff(0);}
00185   
00186 
00188 
00189   void SetAmbient( int index, float value );
00190   void SetAmbient( float value ) {this->SetAmbient( 0, value );}
00191   float GetAmbient( int index );
00192   float GetAmbient() {return this->GetAmbient(0);}
00194   
00195 
00197 
00198   void SetDiffuse( int index, float value );
00199   void SetDiffuse( float value ) {this->SetDiffuse( 0, value );}
00200   float GetDiffuse( int index );
00201   float GetDiffuse() {return this->GetDiffuse(0);}
00203 
00205 
00206   void SetSpecular( int index, float value );
00207   void SetSpecular( float value ) {this->SetSpecular( 0, value );}
00208   float GetSpecular( int index );
00209   float GetSpecular() {return this->GetSpecular(0);}
00211 
00213 
00214   void SetSpecularPower( int index, float value );
00215   void SetSpecularPower( float value ) {this->SetSpecularPower( 0, value );}
00216   float GetSpecularPower( int index );
00217   float GetSpecularPower() {return this->GetSpecularPower(0);}
00219 
00220 //BTX
00225   void UpdateMTimes(); 
00226 
00228 
00230   vtkTimeStamp GetGradientOpacityMTime( int index );
00231   vtkTimeStamp GetGradientOpacityMTime()
00232     { return this->GetGradientOpacityMTime(0); }  
00234       
00236 
00238   vtkTimeStamp GetScalarOpacityMTime( int index );
00239   vtkTimeStamp GetScalarOpacityMTime()
00240     { return this->GetScalarOpacityMTime(0); }  
00242 
00244 
00246   vtkTimeStamp GetRGBTransferFunctionMTime( int index );
00247   vtkTimeStamp GetRGBTransferFunctionMTime()
00248     { return this->GetRGBTransferFunctionMTime(0); }  
00250 
00252 
00254   vtkTimeStamp GetGrayTransferFunctionMTime( int index );
00255   vtkTimeStamp GetGrayTransferFunctionMTime()
00256     { return this->GetGrayTransferFunctionMTime(0); }  
00258 //ETX
00259 
00260 
00261 protected:
00262   vtkVolumeProperty();
00263   ~vtkVolumeProperty();
00264 
00265   int                           InterpolationType;
00266 
00267   int                           ColorChannels[VTK_MAX_VRCOMP];
00268 
00269   vtkPiecewiseFunction          *GrayTransferFunction[VTK_MAX_VRCOMP];
00270   vtkTimeStamp                  GrayTransferFunctionMTime[VTK_MAX_VRCOMP];
00271 
00272   vtkColorTransferFunction      *RGBTransferFunction[VTK_MAX_VRCOMP];
00273   vtkTimeStamp                  RGBTransferFunctionMTime[VTK_MAX_VRCOMP];
00274 
00275   vtkPiecewiseFunction          *ScalarOpacity[VTK_MAX_VRCOMP];
00276   vtkTimeStamp                  ScalarOpacityMTime[VTK_MAX_VRCOMP];
00277 
00278   vtkPiecewiseFunction          *GradientOpacity[VTK_MAX_VRCOMP];
00279   vtkTimeStamp                  GradientOpacityMTime[VTK_MAX_VRCOMP];
00280 
00281   int                           Shade[VTK_MAX_VRCOMP];
00282   float                         Ambient[VTK_MAX_VRCOMP];
00283   float                         Diffuse[VTK_MAX_VRCOMP];
00284   float                         Specular[VTK_MAX_VRCOMP];
00285   float                         SpecularPower[VTK_MAX_VRCOMP];
00286 
00287 private:
00288   vtkVolumeProperty(const vtkVolumeProperty&);  // Not implemented.
00289   void operator=(const vtkVolumeProperty&);  // Not implemented.
00290 };
00291 
00293 inline const char *vtkVolumeProperty::GetInterpolationTypeAsString(void)
00294 {
00295   if( this->InterpolationType == VTK_NEAREST_INTERPOLATION )
00296     {
00297     return "Nearest Neighbor";
00298     }
00299   else if( this->InterpolationType == VTK_LINEAR_INTERPOLATION )
00300     {
00301     return "Linear";
00302     }
00303   else
00304     {
00305     return "Unknown";
00306     }
00307 }
00308 
00309 #endif