00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
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
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
00172 void UpdateMTimes();
00173
00176 vtkGetMacro(GradientOpacityMTime, vtkTimeStamp);
00177
00180 vtkGetMacro(ScalarOpacityMTime, vtkTimeStamp);
00181
00184 vtkGetMacro(RGBTransferFunctionMTime, vtkTimeStamp);
00185
00188 vtkGetMacro(GrayTransferFunctionMTime, vtkTimeStamp);
00189
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