00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00049 #ifndef __vtkVolumeProperty_h
00050 #define __vtkVolumeProperty_h
00051
00052 #include "vtkObject.h"
00053
00054 class vtkPiecewiseFunction;
00055 class vtkTimeStamp;
00056 class vtkColorTransferFunction;
00057
00058 class VTK_RENDERING_EXPORT vtkVolumeProperty : public vtkObject
00059 {
00060 public:
00061 static vtkVolumeProperty *New();
00062 vtkTypeRevisionMacro(vtkVolumeProperty,vtkObject);
00063 void PrintSelf(ostream& os, vtkIndent indent);
00064 void DeepCopy(vtkVolumeProperty *p);
00065
00068 unsigned long GetMTime();
00069
00071
00085 vtkSetClampMacro( IndependentComponents, int, 0, 1 );
00086 vtkGetMacro( IndependentComponents, int );
00087 vtkBooleanMacro( IndependentComponents, int );
00089
00091
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);
00101
00103
00104 virtual void SetComponentWeight(int index, double value);
00105 virtual double GetComponentWeight(int index);
00107
00109
00112 void SetColor( int index, vtkPiecewiseFunction *function );
00113 void SetColor( vtkPiecewiseFunction *f ){this->SetColor(0,f);};
00115
00117
00120 void SetColor( int index, vtkColorTransferFunction *function );
00121 void SetColor( vtkColorTransferFunction *f ){this->SetColor(0,f);};
00123
00125
00127 int GetColorChannels( int index );
00128 int GetColorChannels(){return this->GetColorChannels(0);};
00130
00132
00134 vtkPiecewiseFunction *GetGrayTransferFunction( int index );
00135 vtkPiecewiseFunction *GetGrayTransferFunction()
00136 {return this->GetGrayTransferFunction(0);};
00138
00140
00143 vtkColorTransferFunction *GetRGBTransferFunction( int index );
00144 vtkColorTransferFunction *GetRGBTransferFunction()
00145 {return this->GetRGBTransferFunction(0);};
00147
00149
00151 void SetScalarOpacity( int index, vtkPiecewiseFunction *function );
00152 void SetScalarOpacity( vtkPiecewiseFunction *f )
00153 {this->SetScalarOpacity(0,f);};
00155
00157
00160 vtkPiecewiseFunction *GetScalarOpacity( int index );
00161 vtkPiecewiseFunction *GetScalarOpacity()
00162 {return this->GetScalarOpacity(0);};
00164
00166
00171 void SetScalarOpacityUnitDistance( int index, double distance );
00172 void SetScalarOpacityUnitDistance( double distance )
00173 {this->SetScalarOpacityUnitDistance( 0, distance );}
00174 double GetScalarOpacityUnitDistance( int index );
00175 double GetScalarOpacityUnitDistance()
00176 {return this->GetScalarOpacityUnitDistance(0);}
00178
00179
00181
00183 void SetGradientOpacity( int index, vtkPiecewiseFunction *function );
00184 void SetGradientOpacity( vtkPiecewiseFunction *function )
00185 {this->SetGradientOpacity(0,function);}
00187
00189
00193 vtkPiecewiseFunction *GetGradientOpacity( int index );
00194 vtkPiecewiseFunction *GetGradientOpacity()
00195 {return this->GetGradientOpacity( 0 );}
00197
00199
00204 virtual void SetDisableGradientOpacity( int index, int value );
00205 virtual void SetDisableGradientOpacity( int value )
00206 { this->SetDisableGradientOpacity(0, value); }
00207 virtual void DisableGradientOpacityOn( int index )
00208 { this->SetDisableGradientOpacity(index, 1); }
00209 virtual void DisableGradientOpacityOn()
00210 { this->DisableGradientOpacityOn(0); }
00211 virtual void DisableGradientOpacityOff( int index )
00212 { this->SetDisableGradientOpacity(index, 0); }
00213 virtual void DisableGradientOpacityOff()
00214 { this->DisableGradientOpacityOff(0); }
00215 virtual int GetDisableGradientOpacity( int index );
00216 virtual int GetDisableGradientOpacity()
00217 { return this->GetDisableGradientOpacity(0); }
00218 vtkPiecewiseFunction *GetStoredGradientOpacity( int index );
00219 vtkPiecewiseFunction *GetStoredGradientOpacity()
00220 {return this->GetStoredGradientOpacity( 0 );}
00222
00224
00232 void SetShade( int index, int value );
00233 void SetShade( int value ) {this->SetShade(0,value);}
00234 int GetShade( int index );
00235 int GetShade() {return this->GetShade(0);}
00236 void ShadeOn( int index );
00237 void ShadeOn() {this->ShadeOn(0);}
00238 void ShadeOff( int index );
00239 void ShadeOff() {this->ShadeOff(0);}
00241
00243
00244 void SetAmbient( int index, double value );
00245 void SetAmbient( double value ) {this->SetAmbient( 0, value );}
00246 double GetAmbient( int index );
00247 double GetAmbient() {return this->GetAmbient(0);}
00249
00251
00252 void SetDiffuse( int index, double value );
00253 void SetDiffuse( double value ) {this->SetDiffuse( 0, value );}
00254 double GetDiffuse( int index );
00255 double GetDiffuse() {return this->GetDiffuse(0);}
00257
00259
00260 void SetSpecular( int index, double value );
00261 void SetSpecular( double value ) {this->SetSpecular( 0, value );}
00262 double GetSpecular( int index );
00263 double GetSpecular() {return this->GetSpecular(0);}
00265
00267
00268 void SetSpecularPower( int index, double value );
00269 void SetSpecularPower( double value ) {this->SetSpecularPower( 0, value );}
00270 double GetSpecularPower( int index );
00271 double GetSpecularPower() {return this->GetSpecularPower(0);}
00273
00274
00279 void UpdateMTimes();
00280
00282
00284 vtkTimeStamp GetGradientOpacityMTime( int index );
00285 vtkTimeStamp GetGradientOpacityMTime()
00286 { return this->GetGradientOpacityMTime(0); }
00288
00290
00292 vtkTimeStamp GetScalarOpacityMTime( int index );
00293 vtkTimeStamp GetScalarOpacityMTime()
00294 { return this->GetScalarOpacityMTime(0); }
00296
00298
00300 vtkTimeStamp GetRGBTransferFunctionMTime( int index );
00301 vtkTimeStamp GetRGBTransferFunctionMTime()
00302 { return this->GetRGBTransferFunctionMTime(0); }
00304
00306
00308 vtkTimeStamp GetGrayTransferFunctionMTime( int index );
00309 vtkTimeStamp GetGrayTransferFunctionMTime()
00310 { return this->GetGrayTransferFunctionMTime(0); }
00311
00313
00314 protected:
00315 vtkVolumeProperty();
00316 ~vtkVolumeProperty();
00317
00318 int IndependentComponents;
00319 double ComponentWeight[VTK_MAX_VRCOMP];
00320
00321 int InterpolationType;
00322
00323 int ColorChannels[VTK_MAX_VRCOMP];
00324
00325 vtkPiecewiseFunction *GrayTransferFunction[VTK_MAX_VRCOMP];
00326 vtkTimeStamp GrayTransferFunctionMTime[VTK_MAX_VRCOMP];
00327
00328 vtkColorTransferFunction *RGBTransferFunction[VTK_MAX_VRCOMP];
00329 vtkTimeStamp RGBTransferFunctionMTime[VTK_MAX_VRCOMP];
00330
00331 vtkPiecewiseFunction *ScalarOpacity[VTK_MAX_VRCOMP];
00332 vtkTimeStamp ScalarOpacityMTime[VTK_MAX_VRCOMP];
00333 double ScalarOpacityUnitDistance[VTK_MAX_VRCOMP];
00334
00335 vtkPiecewiseFunction *GradientOpacity[VTK_MAX_VRCOMP];
00336 vtkTimeStamp GradientOpacityMTime[VTK_MAX_VRCOMP];
00337 vtkPiecewiseFunction *DefaultGradientOpacity[VTK_MAX_VRCOMP];
00338 int DisableGradientOpacity[VTK_MAX_VRCOMP];
00339
00340 int Shade[VTK_MAX_VRCOMP];
00341 double Ambient[VTK_MAX_VRCOMP];
00342 double Diffuse[VTK_MAX_VRCOMP];
00343 double Specular[VTK_MAX_VRCOMP];
00344 double SpecularPower[VTK_MAX_VRCOMP];
00345
00346 virtual void CreateDefaultGradientOpacity(int index);
00347
00348 private:
00349 vtkVolumeProperty(const vtkVolumeProperty&);
00350 void operator=(const vtkVolumeProperty&);
00351 };
00352
00354 inline const char *vtkVolumeProperty::GetInterpolationTypeAsString(void)
00355 {
00356 if( this->InterpolationType == VTK_NEAREST_INTERPOLATION )
00357 {
00358 return "Nearest Neighbor";
00359 }
00360 else if( this->InterpolationType == VTK_LINEAR_INTERPOLATION )
00361 {
00362 return "Linear";
00363 }
00364 else
00365 {
00366 return "Unknown";
00367 }
00368 }
00369
00370 #endif