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
00067
unsigned long GetMTime();
00068
00070
00084 vtkSetClampMacro( IndependentComponents,
int, 0, 1 );
00085 vtkGetMacro( IndependentComponents,
int );
00086 vtkBooleanMacro( IndependentComponents,
int );
00088
00090
00091
virtual void SetComponentWeight(
int index,
double value);
00092
virtual double GetComponentWeight(
int index);
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
00108
00111
void SetColor(
int index,
vtkPiecewiseFunction *function );
00112 void SetColor(
vtkPiecewiseFunction *f ){this->SetColor(0,f);};
00114
00116
00119
void SetColor(
int index,
vtkColorTransferFunction *function );
00120 void SetColor(
vtkColorTransferFunction *f ){this->SetColor(0,f);};
00122
00124
00126
int GetColorChannels(
int index );
00127 int GetColorChannels(){
return this->GetColorChannels(0);};
00129
00131
00133
vtkPiecewiseFunction *GetGrayTransferFunction(
int index );
00134 vtkPiecewiseFunction *GetGrayTransferFunction()
00135 {
return this->GetGrayTransferFunction(0);};
00137
00139
00142
vtkColorTransferFunction *GetRGBTransferFunction(
int index );
00143 vtkColorTransferFunction *GetRGBTransferFunction()
00144 {
return this->GetRGBTransferFunction(0);};
00146
00148
00150
void SetScalarOpacity(
int index,
vtkPiecewiseFunction *function );
00151 void SetScalarOpacity(
vtkPiecewiseFunction *f )
00152 {this->SetScalarOpacity(0,f);};
00154
00156
00159
vtkPiecewiseFunction *GetScalarOpacity(
int index );
00160 vtkPiecewiseFunction *GetScalarOpacity()
00161 {
return this->GetScalarOpacity(0);};
00163
00165
00170
void SetScalarOpacityUnitDistance(
int index,
double distance );
00171 void SetScalarOpacityUnitDistance(
double distance )
00172 {this->SetScalarOpacityUnitDistance( 0, distance );}
00173
double GetScalarOpacityUnitDistance(
int index );
00174 double GetScalarOpacityUnitDistance()
00175 {
return this->GetScalarOpacityUnitDistance(0);}
00177
00178
00180
00182
void SetGradientOpacity(
int index,
vtkPiecewiseFunction *function );
00183 void SetGradientOpacity(
vtkPiecewiseFunction *function )
00184 {this->SetGradientOpacity(0,function);}
00186
00188
00192
vtkPiecewiseFunction *GetGradientOpacity(
int index );
00193 vtkPiecewiseFunction *GetGradientOpacity()
00194 {
return this->GetGradientOpacity( 0 );}
00196
00198
00203
virtual void SetDisableGradientOpacity(
int index,
int value );
00204 virtual void SetDisableGradientOpacity(
int value )
00205 { this->SetDisableGradientOpacity(0, value); }
00206 virtual void DisableGradientOpacityOn(
int index )
00207 { this->SetDisableGradientOpacity(index, 1); }
00208 virtual void DisableGradientOpacityOn()
00209 { this->DisableGradientOpacityOn(0); }
00210 virtual void DisableGradientOpacityOff(
int index )
00211 { this->SetDisableGradientOpacity(index, 0); }
00212 virtual void DisableGradientOpacityOff()
00213 { this->DisableGradientOpacityOff(0); }
00214
virtual int GetDisableGradientOpacity(
int index );
00215 virtual int GetDisableGradientOpacity()
00216 {
return this->GetDisableGradientOpacity(0); }
00217
vtkPiecewiseFunction *GetStoredGradientOpacity(
int index );
00218 vtkPiecewiseFunction *GetStoredGradientOpacity()
00219 {
return this->GetStoredGradientOpacity( 0 );}
00221
00223
00231
void SetShade(
int index,
int value );
00232 void SetShade(
int value ) {this->SetShade(0,value);}
00233
int GetShade(
int index );
00234 int GetShade() {
return this->GetShade(0);}
00235
void ShadeOn(
int index );
00236 void ShadeOn() {this->ShadeOn(0);}
00237
void ShadeOff(
int index );
00238 void ShadeOff() {this->ShadeOff(0);}
00240
00242
00243
void SetAmbient(
int index,
double value );
00244 void SetAmbient(
double value ) {this->SetAmbient( 0, value );}
00245
double GetAmbient(
int index );
00246 double GetAmbient() {
return this->GetAmbient(0);}
00248
00250
00251
void SetDiffuse(
int index,
double value );
00252 void SetDiffuse(
double value ) {this->SetDiffuse( 0, value );}
00253
double GetDiffuse(
int index );
00254 double GetDiffuse() {
return this->GetDiffuse(0);}
00256
00258
00259
void SetSpecular(
int index,
double value );
00260 void SetSpecular(
double value ) {this->SetSpecular( 0, value );}
00261
double GetSpecular(
int index );
00262 double GetSpecular() {
return this->GetSpecular(0);}
00264
00266
00267
void SetSpecularPower(
int index,
double value );
00268 void SetSpecularPower(
double value ) {this->SetSpecularPower( 0, value );}
00269
double GetSpecularPower(
int index );
00270 double GetSpecularPower() {
return this->GetSpecularPower(0);}
00272
00273
00278
void UpdateMTimes();
00279
00281
00283
vtkTimeStamp GetGradientOpacityMTime(
int index );
00284 vtkTimeStamp GetGradientOpacityMTime()
00285 {
return this->GetGradientOpacityMTime(0); }
00287
00289
00291
vtkTimeStamp GetScalarOpacityMTime(
int index );
00292 vtkTimeStamp GetScalarOpacityMTime()
00293 {
return this->GetScalarOpacityMTime(0); }
00295
00297
00299
vtkTimeStamp GetRGBTransferFunctionMTime(
int index );
00300 vtkTimeStamp GetRGBTransferFunctionMTime()
00301 {
return this->GetRGBTransferFunctionMTime(0); }
00303
00305
00307
vtkTimeStamp GetGrayTransferFunctionMTime(
int index );
00308 vtkTimeStamp GetGrayTransferFunctionMTime()
00309 {
return this->GetGrayTransferFunctionMTime(0); }
00310
00312
00313
protected:
00314 vtkVolumeProperty();
00315 ~vtkVolumeProperty();
00316
00317 int IndependentComponents;
00318 double ComponentWeight[
VTK_MAX_VRCOMP];
00319
00320 int InterpolationType;
00321
00322 int ColorChannels[
VTK_MAX_VRCOMP];
00323
00324 vtkPiecewiseFunction *GrayTransferFunction[
VTK_MAX_VRCOMP];
00325 vtkTimeStamp GrayTransferFunctionMTime[
VTK_MAX_VRCOMP];
00326
00327 vtkColorTransferFunction *RGBTransferFunction[
VTK_MAX_VRCOMP];
00328 vtkTimeStamp RGBTransferFunctionMTime[
VTK_MAX_VRCOMP];
00329
00330 vtkPiecewiseFunction *ScalarOpacity[
VTK_MAX_VRCOMP];
00331 vtkTimeStamp ScalarOpacityMTime[
VTK_MAX_VRCOMP];
00332 double ScalarOpacityUnitDistance[
VTK_MAX_VRCOMP];
00333
00334 vtkPiecewiseFunction *GradientOpacity[
VTK_MAX_VRCOMP];
00335 vtkTimeStamp GradientOpacityMTime[
VTK_MAX_VRCOMP];
00336 vtkPiecewiseFunction *DefaultGradientOpacity[
VTK_MAX_VRCOMP];
00337 int DisableGradientOpacity[
VTK_MAX_VRCOMP];
00338
00339 int Shade[
VTK_MAX_VRCOMP];
00340 double Ambient[
VTK_MAX_VRCOMP];
00341 double Diffuse[
VTK_MAX_VRCOMP];
00342 double Specular[
VTK_MAX_VRCOMP];
00343 double SpecularPower[
VTK_MAX_VRCOMP];
00344
00345
virtual void CreateDefaultGradientOpacity(
int index);
00346
00347
private:
00348 vtkVolumeProperty(
const vtkVolumeProperty&);
00349
void operator=(
const vtkVolumeProperty&);
00350 };
00351
00353 inline const char *
vtkVolumeProperty::GetInterpolationTypeAsString(
void)
00354 {
00355
if( this->
InterpolationType ==
VTK_NEAREST_INTERPOLATION )
00356 {
00357
return "Nearest Neighbor";
00358 }
00359
else if( this->
InterpolationType ==
VTK_LINEAR_INTERPOLATION )
00360 {
00361
return "Linear";
00362 }
00363
else
00364 {
00365
return "Unknown";
00366 }
00367 }
00368
00369
#endif