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
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
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
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
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&);
00248 void operator=(const vtkVolumeProperty&);
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