00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00046 #ifndef __vtkVolumeProperty_h
00047 #define __vtkVolumeProperty_h
00048
00049 #include "vtkObject.h"
00050
00051 class vtkPiecewiseFunction;
00052 class vtkTimeStamp;
00053 class vtkColorTransferFunction;
00054
00055 class VTK_RENDERING_EXPORT vtkVolumeProperty : public vtkObject
00056 {
00057 public:
00058 static vtkVolumeProperty *New();
00059 vtkTypeRevisionMacro(vtkVolumeProperty,vtkObject);
00060 void PrintSelf(ostream& os, vtkIndent indent);
00061 void DeepCopy(vtkVolumeProperty *p);
00062
00065 unsigned long GetMTime();
00066
00068
00082 vtkSetClampMacro( IndependentComponents, int, 0, 1 );
00083 vtkGetMacro( IndependentComponents, int );
00084 vtkBooleanMacro( IndependentComponents, int );
00086
00088
00090 vtkSetClampMacro( InterpolationType, int,
00091 VTK_NEAREST_INTERPOLATION, VTK_LINEAR_INTERPOLATION);
00092 vtkGetMacro(InterpolationType,int);
00093 void SetInterpolationTypeToNearest()
00094 {this->SetInterpolationType(VTK_NEAREST_INTERPOLATION);};
00095 void SetInterpolationTypeToLinear()
00096 {this->SetInterpolationType(VTK_LINEAR_INTERPOLATION);};
00097 const char *GetInterpolationTypeAsString(void);
00099
00101
00102 virtual void SetComponentWeight(int index, double value);
00103 virtual double GetComponentWeight(int index);
00105
00107
00110 void SetColor( int index, vtkPiecewiseFunction *function );
00111 void SetColor( vtkPiecewiseFunction *f ){this->SetColor(0,f);};
00113
00115
00118 void SetColor( int index, vtkColorTransferFunction *function );
00119 void SetColor( vtkColorTransferFunction *f ){this->SetColor(0,f);};
00121
00123
00125 int GetColorChannels( int index );
00126 int GetColorChannels(){return this->GetColorChannels(0);};
00128
00130
00132 vtkPiecewiseFunction *GetGrayTransferFunction( int index );
00133 vtkPiecewiseFunction *GetGrayTransferFunction()
00134 {return this->GetGrayTransferFunction(0);};
00136
00138
00141 vtkColorTransferFunction *GetRGBTransferFunction( int index );
00142 vtkColorTransferFunction *GetRGBTransferFunction()
00143 {return this->GetRGBTransferFunction(0);};
00145
00147
00149 void SetScalarOpacity( int index, vtkPiecewiseFunction *function );
00150 void SetScalarOpacity( vtkPiecewiseFunction *f )
00151 {this->SetScalarOpacity(0,f);};
00153
00155
00158 vtkPiecewiseFunction *GetScalarOpacity( int index );
00159 vtkPiecewiseFunction *GetScalarOpacity()
00160 {return this->GetScalarOpacity(0);};
00162
00164
00169 void SetScalarOpacityUnitDistance( int index, double distance );
00170 void SetScalarOpacityUnitDistance( double distance )
00171 {this->SetScalarOpacityUnitDistance( 0, distance );}
00172 double GetScalarOpacityUnitDistance( int index );
00173 double GetScalarOpacityUnitDistance()
00174 {return this->GetScalarOpacityUnitDistance(0);}
00176
00177
00179
00181 void SetGradientOpacity( int index, vtkPiecewiseFunction *function );
00182 void SetGradientOpacity( vtkPiecewiseFunction *function )
00183 {this->SetGradientOpacity(0,function);}
00185
00187
00191 vtkPiecewiseFunction *GetGradientOpacity( int index );
00192 vtkPiecewiseFunction *GetGradientOpacity()
00193 {return this->GetGradientOpacity( 0 );}
00195
00197
00202 virtual void SetDisableGradientOpacity( int index, int value );
00203 virtual void SetDisableGradientOpacity( int value )
00204 { this->SetDisableGradientOpacity(0, value); }
00205 virtual void DisableGradientOpacityOn( int index )
00206 { this->SetDisableGradientOpacity(index, 1); }
00207 virtual void DisableGradientOpacityOn()
00208 { this->DisableGradientOpacityOn(0); }
00209 virtual void DisableGradientOpacityOff( int index )
00210 { this->SetDisableGradientOpacity(index, 0); }
00211 virtual void DisableGradientOpacityOff()
00212 { this->DisableGradientOpacityOff(0); }
00213 virtual int GetDisableGradientOpacity( int index );
00214 virtual int GetDisableGradientOpacity()
00215 { return this->GetDisableGradientOpacity(0); }
00216 vtkPiecewiseFunction *GetStoredGradientOpacity( int index );
00217 vtkPiecewiseFunction *GetStoredGradientOpacity()
00218 {return this->GetStoredGradientOpacity( 0 );}
00220
00222
00230 void SetShade( int index, int value );
00231 void SetShade( int value ) {this->SetShade(0,value);}
00232 int GetShade( int index );
00233 int GetShade() {return this->GetShade(0);}
00234 void ShadeOn( int index );
00235 void ShadeOn() {this->ShadeOn(0);}
00236 void ShadeOff( int index );
00237 void ShadeOff() {this->ShadeOff(0);}
00239
00241
00242 void SetAmbient( int index, double value );
00243 void SetAmbient( double value ) {this->SetAmbient( 0, value );}
00244 double GetAmbient( int index );
00245 double GetAmbient() {return this->GetAmbient(0);}
00247
00249
00250 void SetDiffuse( int index, double value );
00251 void SetDiffuse( double value ) {this->SetDiffuse( 0, value );}
00252 double GetDiffuse( int index );
00253 double GetDiffuse() {return this->GetDiffuse(0);}
00255
00257
00258 void SetSpecular( int index, double value );
00259 void SetSpecular( double value ) {this->SetSpecular( 0, value );}
00260 double GetSpecular( int index );
00261 double GetSpecular() {return this->GetSpecular(0);}
00263
00265
00266 void SetSpecularPower( int index, double value );
00267 void SetSpecularPower( double value ) {this->SetSpecularPower( 0, value );}
00268 double GetSpecularPower( int index );
00269 double GetSpecularPower() {return this->GetSpecularPower(0);}
00271
00272
00277 void UpdateMTimes();
00278
00280
00282 vtkTimeStamp GetGradientOpacityMTime( int index );
00283 vtkTimeStamp GetGradientOpacityMTime()
00284 { return this->GetGradientOpacityMTime(0); }
00286
00288
00290 vtkTimeStamp GetScalarOpacityMTime( int index );
00291 vtkTimeStamp GetScalarOpacityMTime()
00292 { return this->GetScalarOpacityMTime(0); }
00294
00296
00298 vtkTimeStamp GetRGBTransferFunctionMTime( int index );
00299 vtkTimeStamp GetRGBTransferFunctionMTime()
00300 { return this->GetRGBTransferFunctionMTime(0); }
00302
00304
00306 vtkTimeStamp GetGrayTransferFunctionMTime( int index );
00307 vtkTimeStamp GetGrayTransferFunctionMTime()
00308 { return this->GetGrayTransferFunctionMTime(0); }
00309
00311
00312 protected:
00313 vtkVolumeProperty();
00314 ~vtkVolumeProperty();
00315
00316 int IndependentComponents;
00317 double ComponentWeight[VTK_MAX_VRCOMP];
00318
00319 int InterpolationType;
00320
00321 int ColorChannels[VTK_MAX_VRCOMP];
00322
00323 vtkPiecewiseFunction *GrayTransferFunction[VTK_MAX_VRCOMP];
00324 vtkTimeStamp GrayTransferFunctionMTime[VTK_MAX_VRCOMP];
00325
00326 vtkColorTransferFunction *RGBTransferFunction[VTK_MAX_VRCOMP];
00327 vtkTimeStamp RGBTransferFunctionMTime[VTK_MAX_VRCOMP];
00328
00329 vtkPiecewiseFunction *ScalarOpacity[VTK_MAX_VRCOMP];
00330 vtkTimeStamp ScalarOpacityMTime[VTK_MAX_VRCOMP];
00331 double ScalarOpacityUnitDistance[VTK_MAX_VRCOMP];
00332
00333 vtkPiecewiseFunction *GradientOpacity[VTK_MAX_VRCOMP];
00334 vtkTimeStamp GradientOpacityMTime[VTK_MAX_VRCOMP];
00335 vtkPiecewiseFunction *DefaultGradientOpacity[VTK_MAX_VRCOMP];
00336 int DisableGradientOpacity[VTK_MAX_VRCOMP];
00337
00338 int Shade[VTK_MAX_VRCOMP];
00339 double Ambient[VTK_MAX_VRCOMP];
00340 double Diffuse[VTK_MAX_VRCOMP];
00341 double Specular[VTK_MAX_VRCOMP];
00342 double SpecularPower[VTK_MAX_VRCOMP];
00343
00344 virtual void CreateDefaultGradientOpacity(int index);
00345
00346 private:
00347 vtkVolumeProperty(const vtkVolumeProperty&);
00348 void operator=(const vtkVolumeProperty&);
00349 };
00350
00352 inline const char *vtkVolumeProperty::GetInterpolationTypeAsString(void)
00353 {
00354 if( this->InterpolationType == VTK_NEAREST_INTERPOLATION )
00355 {
00356 return "Nearest Neighbor";
00357 }
00358 else if( this->InterpolationType == VTK_LINEAR_INTERPOLATION )
00359 {
00360 return "Linear";
00361 }
00362 else
00363 {
00364 return "Unknown";
00365 }
00366 }
00367
00368 #endif