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

graphics/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 
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 =========================================================================*/
00040 
00066 #ifndef __vtkVolumeProperty_h
00067 #define __vtkVolumeProperty_h
00068 
00069 #include "vtkObject.h"
00070 #include "vtkPiecewiseFunction.h"
00071 #include "vtkColorTransferFunction.h"
00072 #include "vtkTimeStamp.h"
00073 
00074 // Constants for InterpolationType
00075 #define  VTK_NEAREST_INTERPOLATION  0
00076 #define  VTK_LINEAR_INTERPOLATION   1
00077 
00078 
00079 class VTK_EXPORT vtkVolumeProperty : public vtkObject
00080 {
00081 public:
00082   static vtkVolumeProperty *New();
00083   vtkTypeMacro(vtkVolumeProperty,vtkObject);
00084   void PrintSelf(ostream& os, vtkIndent indent);
00085 
00088   unsigned long GetMTime();
00089   
00090 
00092   vtkSetClampMacro( InterpolationType, int,
00093    VTK_NEAREST_INTERPOLATION, VTK_LINEAR_INTERPOLATION);
00094   vtkGetMacro(InterpolationType,int);
00095   void SetInterpolationTypeToNearest() 
00096    {this->SetInterpolationType(VTK_NEAREST_INTERPOLATION);};
00097   void SetInterpolationTypeToLinear() 
00098    {this->SetInterpolationType(VTK_LINEAR_INTERPOLATION);};
00099   const char *GetInterpolationTypeAsString(void);
00100 
00103   void SetColor( vtkPiecewiseFunction *function );
00104 
00107   void SetColor( vtkColorTransferFunction *function );
00108 
00110   vtkGetMacro(ColorChannels,int);
00111 
00113   vtkPiecewiseFunction *GetGrayTransferFunction();
00114 
00116   vtkColorTransferFunction *GetRGBTransferFunction();
00117 
00120   void SetScalarOpacity( vtkPiecewiseFunction *function );
00121 
00123   vtkPiecewiseFunction *GetScalarOpacity();
00124 
00127   void SetGradientOpacity( vtkPiecewiseFunction *function );
00128 
00130   vtkPiecewiseFunction *GetGradientOpacity();
00131 
00140   vtkSetMacro(Shade,int);
00141   vtkGetMacro(Shade,int);
00142   vtkBooleanMacro(Shade,int);
00143 
00145   vtkSetClampMacro(Ambient,float,0.0,1.0);
00146   vtkGetMacro(Ambient,float);
00147 
00149   vtkSetClampMacro(Diffuse,float,0.0,1.0);
00150   vtkGetMacro(Diffuse,float);
00151 
00153   vtkSetClampMacro(Specular,float,0.0,1.0);
00154   vtkGetMacro(Specular,float);
00155 
00157   vtkSetClampMacro(SpecularPower,float,0.0,100.0);
00158   vtkGetMacro(SpecularPower,float);
00159 
00164   vtkSetClampMacro(RGBTextureCoefficient,float,0.0,1.0);
00165   vtkGetMacro(RGBTextureCoefficient,float);
00166 
00167 //BTX
00172   void UpdateMTimes(); 
00173 
00176   vtkGetMacro(GradientOpacityMTime, vtkTimeStamp);
00177 
00180   vtkGetMacro(ScalarOpacityMTime, vtkTimeStamp);
00181 
00184   vtkGetMacro(RGBTransferFunctionMTime, vtkTimeStamp);
00185 
00188   vtkGetMacro(GrayTransferFunctionMTime, vtkTimeStamp);
00189 //ETX
00190 
00191 
00192 protected:
00193   vtkVolumeProperty();
00194   ~vtkVolumeProperty();
00195   vtkVolumeProperty(const vtkVolumeProperty&) {};
00196   void operator=(const vtkVolumeProperty&) {};
00197 
00198   int          InterpolationType;
00199 
00200   int          ColorChannels;
00201 
00202   vtkPiecewiseFunction     *GrayTransferFunction;
00203   vtkTimeStamp       GrayTransferFunctionMTime;
00204 
00205   vtkColorTransferFunction *RGBTransferFunction;
00206   vtkTimeStamp       RGBTransferFunctionMTime;
00207 
00208   vtkPiecewiseFunction     *ScalarOpacity;
00209   vtkTimeStamp       ScalarOpacityMTime;
00210 
00211   vtkPiecewiseFunction     *GradientOpacity;
00212   vtkTimeStamp       GradientOpacityMTime;
00213 
00214   int          Shade;
00215   float           Ambient;
00216   float        Diffuse;
00217   float           Specular;
00218   float           SpecularPower;
00219   float                         RGBTextureCoefficient;
00220 };
00221 
00223 inline const char *vtkVolumeProperty::GetInterpolationTypeAsString(void)
00224 {
00225   if( this->InterpolationType == VTK_NEAREST_INTERPOLATION )
00226     {
00227     return "Nearest Neighbor";
00228     }
00229   else if( this->InterpolationType == VTK_LINEAR_INTERPOLATION )
00230     {
00231     return "Linear";
00232     }
00233   else
00234     {
00235     return "Unknown";
00236     }
00237 }
00238 
00239 #endif

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