Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound 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 
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 
00070 #ifndef __vtkVolumeProperty_h
00071 #define __vtkVolumeProperty_h
00072 
00073 #include "vtkObject.h"
00074 #include "vtkPiecewiseFunction.h"
00075 #include "vtkColorTransferFunction.h"
00076 #include "vtkTimeStamp.h"
00077 
00078 // Constants for InterpolationType
00079 #define VTK_NEAREST_INTERPOLATION       0
00080 #define VTK_LINEAR_INTERPOLATION        1
00081 
00082 
00083 class VTK_RENDERING_EXPORT vtkVolumeProperty : public vtkObject
00084 {
00085 public:
00086   static vtkVolumeProperty *New();
00087   vtkTypeMacro(vtkVolumeProperty,vtkObject);
00088   void PrintSelf(ostream& os, vtkIndent indent);
00089 
00092   unsigned long GetMTime();
00093   
00094 
00096 
00097   vtkSetClampMacro( InterpolationType, int,
00098         VTK_NEAREST_INTERPOLATION, VTK_LINEAR_INTERPOLATION);
00099   vtkGetMacro(InterpolationType,int);
00100   void SetInterpolationTypeToNearest() 
00101         {this->SetInterpolationType(VTK_NEAREST_INTERPOLATION);};
00102   void SetInterpolationTypeToLinear() 
00103         {this->SetInterpolationType(VTK_LINEAR_INTERPOLATION);};
00104   const char *GetInterpolationTypeAsString(void);
00106 
00109   void SetColor( vtkPiecewiseFunction *function );
00110 
00113   void SetColor( vtkColorTransferFunction *function );
00114 
00116 
00117   vtkGetMacro(ColorChannels,int);
00119 
00121   vtkPiecewiseFunction *GetGrayTransferFunction();
00122 
00124   vtkColorTransferFunction *GetRGBTransferFunction();
00125 
00128   void SetScalarOpacity( vtkPiecewiseFunction *function );
00129 
00131   vtkPiecewiseFunction *GetScalarOpacity();
00132 
00135   void SetGradientOpacity( vtkPiecewiseFunction *function );
00136 
00138   vtkPiecewiseFunction *GetGradientOpacity();
00139 
00141 
00149   vtkSetMacro(Shade,int);
00150   vtkGetMacro(Shade,int);
00151   vtkBooleanMacro(Shade,int);
00153 
00155 
00156   vtkSetClampMacro(Ambient,float,0.0,1.0);
00157   vtkGetMacro(Ambient,float);
00159 
00161 
00162   vtkSetClampMacro(Diffuse,float,0.0,1.0);
00163   vtkGetMacro(Diffuse,float);
00165 
00167 
00168   vtkSetClampMacro(Specular,float,0.0,1.0);
00169   vtkGetMacro(Specular,float);
00171 
00173 
00174   vtkSetClampMacro(SpecularPower,float,0.0,100.0);
00175   vtkGetMacro(SpecularPower,float);
00177 
00179 
00183   vtkSetClampMacro(RGBTextureCoefficient,float,0.0,1.0);
00184   vtkGetMacro(RGBTextureCoefficient,float);
00186 
00187 //BTX
00192   void UpdateMTimes(); 
00193 
00195 
00197   vtkGetMacro(GradientOpacityMTime, vtkTimeStamp);
00199 
00201 
00203   vtkGetMacro(ScalarOpacityMTime, vtkTimeStamp);
00205 
00207 
00209   vtkGetMacro(RGBTransferFunctionMTime, vtkTimeStamp);
00211 
00213 
00215   vtkGetMacro(GrayTransferFunctionMTime, vtkTimeStamp);
00217 //ETX
00218 
00219 
00220 protected:
00221   vtkVolumeProperty();
00222   ~vtkVolumeProperty();
00223 
00224   int                           InterpolationType;
00225 
00226   int                           ColorChannels;
00227 
00228   vtkPiecewiseFunction          *GrayTransferFunction;
00229   vtkTimeStamp                  GrayTransferFunctionMTime;
00230 
00231   vtkColorTransferFunction      *RGBTransferFunction;
00232   vtkTimeStamp                  RGBTransferFunctionMTime;
00233 
00234   vtkPiecewiseFunction          *ScalarOpacity;
00235   vtkTimeStamp                  ScalarOpacityMTime;
00236 
00237   vtkPiecewiseFunction          *GradientOpacity;
00238   vtkTimeStamp                  GradientOpacityMTime;
00239 
00240   int                           Shade;
00241   float                         Ambient;
00242   float                         Diffuse;
00243   float                         Specular;
00244   float                         SpecularPower;
00245   float                         RGBTextureCoefficient;
00246 private:
00247   vtkVolumeProperty(const vtkVolumeProperty&);  // Not implemented.
00248   void operator=(const vtkVolumeProperty&);  // Not implemented.
00249 };
00250 
00252 inline const char *vtkVolumeProperty::GetInterpolationTypeAsString(void)
00253 {
00254   if( this->InterpolationType == VTK_NEAREST_INTERPOLATION )
00255     {
00256     return "Nearest Neighbor";
00257     }
00258   else if( this->InterpolationType == VTK_LINEAR_INTERPOLATION )
00259     {
00260     return "Linear";
00261     }
00262   else
00263     {
00264     return "Unknown";
00265     }
00266 }
00267 
00268 #endif

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