00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00053
#ifndef __vtkVolumeProperty_h
00054
#define __vtkVolumeProperty_h
00055
00056
#include "vtkObject.h"
00057
00058
class vtkPiecewiseFunction;
00059
class vtkTimeStamp;
00060
class vtkColorTransferFunction;
00061
00062 class VTK_RENDERING_EXPORT vtkVolumeProperty :
public vtkObject
00063 {
00064
public:
00065
static vtkVolumeProperty *
New();
00066 vtkTypeRevisionMacro(vtkVolumeProperty,
vtkObject);
00067
void PrintSelf(ostream& os,
vtkIndent indent);
00068
00071
unsigned long GetMTime();
00072
00073
00075
00076 vtkSetClampMacro( InterpolationType,
int,
00077 VTK_NEAREST_INTERPOLATION, VTK_LINEAR_INTERPOLATION);
00078 vtkGetMacro(InterpolationType,
int);
00079 void SetInterpolationTypeToNearest()
00080 {this->SetInterpolationType(
VTK_NEAREST_INTERPOLATION);};
00081 void SetInterpolationTypeToLinear()
00082 {this->SetInterpolationType(
VTK_LINEAR_INTERPOLATION);};
00083
const char *GetInterpolationTypeAsString(
void);
00085
00087
00090
void SetColor(
int index,
vtkPiecewiseFunction *function );
00091 void SetColor(
vtkPiecewiseFunction *f ){this->SetColor(0,f);};
00093
00094
00096
00099
void SetColor(
int index,
vtkColorTransferFunction *function );
00100 void SetColor(
vtkColorTransferFunction *f ){this->SetColor(0,f);};
00102
00104
00106
int GetColorChannels(
int index );
00107 int GetColorChannels(){
return this->GetColorChannels(0);};
00109
00111
00112
vtkPiecewiseFunction *GetGrayTransferFunction(
int index );
00113 vtkPiecewiseFunction *GetGrayTransferFunction()
00114 {
return this->GetGrayTransferFunction(0);};
00116
00118
00119
vtkColorTransferFunction *GetRGBTransferFunction(
int index );
00120 vtkColorTransferFunction *GetRGBTransferFunction()
00121 {
return this->GetRGBTransferFunction(0);};
00123
00125
00127
void SetScalarOpacity(
int index,
vtkPiecewiseFunction *function );
00128 void SetScalarOpacity(
vtkPiecewiseFunction *f )
00129 {this->SetScalarOpacity(0,f);};
00131
00133
00134
vtkPiecewiseFunction *GetScalarOpacity(
int index );
00135 vtkPiecewiseFunction *GetScalarOpacity()
00136 {
return this->GetScalarOpacity(0);};
00138
00139
00141
00143
void SetGradientOpacity(
int index,
vtkPiecewiseFunction *function );
00144 void SetGradientOpacity(
vtkPiecewiseFunction *function )
00145 {this->SetGradientOpacity(0,function);}
00147
00149
00151
vtkPiecewiseFunction *GetGradientOpacity(
int index );
00152 vtkPiecewiseFunction *GetGradientOpacity()
00153 {
return this->GetGradientOpacity( 0 );}
00155
00157
00165
void SetShade(
int index,
int value );
00166 void SetShade(
int value ) {this->SetShade(0,value);}
00167
int GetShade(
int index );
00168 int GetShade() {
return this->GetShade(0);}
00169
void ShadeOn(
int index );
00170 void ShadeOn() {this->ShadeOn(0);}
00171
void ShadeOff(
int index );
00172 void ShadeOff() {this->ShadeOff(0);}
00174
00175
00177
00178
void SetAmbient(
int index,
float value );
00179 void SetAmbient(
float value ) {this->SetAmbient( 0, value );}
00180
float GetAmbient(
int index );
00181 float GetAmbient() {
return this->GetAmbient(0);}
00183
00184
00186
00187
void SetDiffuse(
int index,
float value );
00188 void SetDiffuse(
float value ) {this->SetDiffuse( 0, value );}
00189
float GetDiffuse(
int index );
00190 float GetDiffuse() {
return this->GetDiffuse(0);}
00192
00194
00195
void SetSpecular(
int index,
float value );
00196 void SetSpecular(
float value ) {this->SetSpecular( 0, value );}
00197
float GetSpecular(
int index );
00198 float GetSpecular() {
return this->GetSpecular(0);}
00200
00202
00203
void SetSpecularPower(
int index,
float value );
00204 void SetSpecularPower(
float value ) {this->SetSpecularPower( 0, value );}
00205
float GetSpecularPower(
int index );
00206 float GetSpecularPower() {
return this->GetSpecularPower(0);}
00208
00209
00214
void UpdateMTimes();
00215
00217
00219
vtkTimeStamp GetGradientOpacityMTime(
int index );
00220 vtkTimeStamp GetGradientOpacityMTime()
00221 {
return this->GetGradientOpacityMTime(0); }
00223
00225
00227
vtkTimeStamp GetScalarOpacityMTime(
int index );
00228 vtkTimeStamp GetScalarOpacityMTime()
00229 {
return this->GetScalarOpacityMTime(0); }
00231
00233
00235
vtkTimeStamp GetRGBTransferFunctionMTime(
int index );
00236 vtkTimeStamp GetRGBTransferFunctionMTime()
00237 {
return this->GetRGBTransferFunctionMTime(0); }
00239
00241
00243
vtkTimeStamp GetGrayTransferFunctionMTime(
int index );
00244 vtkTimeStamp GetGrayTransferFunctionMTime()
00245 {
return this->GetGrayTransferFunctionMTime(0); }
00247
00248
00249
00250
protected:
00251 vtkVolumeProperty();
00252 ~vtkVolumeProperty();
00253
00254 int InterpolationType;
00255
00256 int ColorChannels[
VTK_MAX_VRCOMP];
00257
00258 vtkPiecewiseFunction *GrayTransferFunction[
VTK_MAX_VRCOMP];
00259 vtkTimeStamp GrayTransferFunctionMTime[
VTK_MAX_VRCOMP];
00260
00261 vtkColorTransferFunction *RGBTransferFunction[
VTK_MAX_VRCOMP];
00262 vtkTimeStamp RGBTransferFunctionMTime[
VTK_MAX_VRCOMP];
00263
00264 vtkPiecewiseFunction *ScalarOpacity[
VTK_MAX_VRCOMP];
00265 vtkTimeStamp ScalarOpacityMTime[
VTK_MAX_VRCOMP];
00266
00267 vtkPiecewiseFunction *GradientOpacity[
VTK_MAX_VRCOMP];
00268 vtkTimeStamp GradientOpacityMTime[
VTK_MAX_VRCOMP];
00269
00270 int Shade[
VTK_MAX_VRCOMP];
00271 float Ambient[
VTK_MAX_VRCOMP];
00272 float Diffuse[
VTK_MAX_VRCOMP];
00273 float Specular[
VTK_MAX_VRCOMP];
00274 float SpecularPower[
VTK_MAX_VRCOMP];
00275
00276
private:
00277 vtkVolumeProperty(
const vtkVolumeProperty&);
00278
void operator=(
const vtkVolumeProperty&);
00279 };
00280
00282 inline const char *
vtkVolumeProperty::GetInterpolationTypeAsString(
void)
00283 {
00284
if( this->
InterpolationType ==
VTK_NEAREST_INTERPOLATION )
00285 {
00286
return "Nearest Neighbor";
00287 }
00288
else if( this->
InterpolationType ==
VTK_LINEAR_INTERPOLATION )
00289 {
00290
return "Linear";
00291 }
00292
else
00293 {
00294
return "Unknown";
00295 }
00296 }
00297
00298
#endif