Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages
Rendering/vtkVolumeProperty.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00065 #ifndef __vtkVolumeProperty_h
00066 #define __vtkVolumeProperty_h
00067
00068 #include "vtkObject.h"
00069
00070 class vtkPiecewiseFunction;
00071 class vtkTimeStamp;
00072 class vtkColorTransferFunction;
00073
00074 class VTK_RENDERING_EXPORT vtkVolumeProperty : public vtkObject
00075 {
00076 public:
00077 static vtkVolumeProperty *New();
00078 vtkTypeRevisionMacro(vtkVolumeProperty,vtkObject);
00079 void PrintSelf(ostream& os, vtkIndent indent);
00080
00083 unsigned long GetMTime();
00084
00085
00087
00088 vtkSetClampMacro( InterpolationType, int,
00089 VTK_NEAREST_INTERPOLATION, VTK_LINEAR_INTERPOLATION);
00090 vtkGetMacro(InterpolationType,int);
00091 void SetInterpolationTypeToNearest()
00092 {this->SetInterpolationType(VTK_NEAREST_INTERPOLATION);};
00093 void SetInterpolationTypeToLinear()
00094 {this->SetInterpolationType(VTK_LINEAR_INTERPOLATION);};
00095 const char *GetInterpolationTypeAsString(void);
00097
00099
00102 void SetColor( int index, vtkPiecewiseFunction *function );
00103 void SetColor( vtkPiecewiseFunction *f ){this->SetColor(0,f);};
00105
00106
00108
00111 void SetColor( int index, vtkColorTransferFunction *function );
00112 void SetColor( vtkColorTransferFunction *f ){this->SetColor(0,f);};
00114
00116
00118 int GetColorChannels( int index );
00119 int GetColorChannels(){return this->GetColorChannels(0);};
00121
00123
00124 vtkPiecewiseFunction *GetGrayTransferFunction( int index );
00125 vtkPiecewiseFunction *GetGrayTransferFunction()
00126 {return this->GetGrayTransferFunction(0);};
00128
00130
00131 vtkColorTransferFunction *GetRGBTransferFunction( int index );
00132 vtkColorTransferFunction *GetRGBTransferFunction()
00133 {return this->GetRGBTransferFunction(0);};
00135
00137
00139 void SetScalarOpacity( int index, vtkPiecewiseFunction *function );
00140 void SetScalarOpacity( vtkPiecewiseFunction *f )
00141 {this->SetScalarOpacity(0,f);};
00143
00145
00146 vtkPiecewiseFunction *GetScalarOpacity( int index );
00147 vtkPiecewiseFunction *GetScalarOpacity()
00148 {return this->GetScalarOpacity(0);};
00150
00151
00153
00155 void SetGradientOpacity( int index, vtkPiecewiseFunction *function );
00156 void SetGradientOpacity( vtkPiecewiseFunction *function )
00157 {this->SetGradientOpacity(0,function);}
00159
00161
00163 vtkPiecewiseFunction *GetGradientOpacity( int index );
00164 vtkPiecewiseFunction *GetGradientOpacity()
00165 {return this->GetGradientOpacity( 0 );}
00167
00169
00177 void SetShade( int index, int value );
00178 void SetShade( int value ) {this->SetShade(0,value);}
00179 int GetShade( int index );
00180 int GetShade() {return this->GetShade(0);}
00181 void ShadeOn( int index );
00182 void ShadeOn() {this->ShadeOn(0);}
00183 void ShadeOff( int index );
00184 void ShadeOff() {this->ShadeOff(0);}
00186
00187
00189
00190 void SetAmbient( int index, float value );
00191 void SetAmbient( float value ) {this->SetAmbient( 0, value );}
00192 float GetAmbient( int index );
00193 float GetAmbient() {return this->GetAmbient(0);}
00195
00196
00198
00199 void SetDiffuse( int index, float value );
00200 void SetDiffuse( float value ) {this->SetDiffuse( 0, value );}
00201 float GetDiffuse( int index );
00202 float GetDiffuse() {return this->GetDiffuse(0);}
00204
00206
00207 void SetSpecular( int index, float value );
00208 void SetSpecular( float value ) {this->SetSpecular( 0, value );}
00209 float GetSpecular( int index );
00210 float GetSpecular() {return this->GetSpecular(0);}
00212
00214
00215 void SetSpecularPower( int index, float value );
00216 void SetSpecularPower( float value ) {this->SetSpecularPower( 0, value );}
00217 float GetSpecularPower( int index );
00218 float GetSpecularPower() {return this->GetSpecularPower(0);}
00220
00221
00226 void UpdateMTimes();
00227
00229
00231 vtkTimeStamp GetGradientOpacityMTime( int index );
00232 vtkTimeStamp GetGradientOpacityMTime()
00233 { return this->GetGradientOpacityMTime(0); }
00235
00237
00239 vtkTimeStamp GetScalarOpacityMTime( int index );
00240 vtkTimeStamp GetScalarOpacityMTime()
00241 { return this->GetScalarOpacityMTime(0); }
00243
00245
00247 vtkTimeStamp GetRGBTransferFunctionMTime( int index );
00248 vtkTimeStamp GetRGBTransferFunctionMTime()
00249 { return this->GetRGBTransferFunctionMTime(0); }
00251
00253
00255 vtkTimeStamp GetGrayTransferFunctionMTime( int index );
00256 vtkTimeStamp GetGrayTransferFunctionMTime()
00257 { return this->GetGrayTransferFunctionMTime(0); }
00259
00260
00261
00262 protected:
00263 vtkVolumeProperty();
00264 ~vtkVolumeProperty();
00265
00266 int InterpolationType;
00267
00268 int ColorChannels[VTK_MAX_VRCOMP];
00269
00270 vtkPiecewiseFunction *GrayTransferFunction[VTK_MAX_VRCOMP];
00271 vtkTimeStamp GrayTransferFunctionMTime[VTK_MAX_VRCOMP];
00272
00273 vtkColorTransferFunction *RGBTransferFunction[VTK_MAX_VRCOMP];
00274 vtkTimeStamp RGBTransferFunctionMTime[VTK_MAX_VRCOMP];
00275
00276 vtkPiecewiseFunction *ScalarOpacity[VTK_MAX_VRCOMP];
00277 vtkTimeStamp ScalarOpacityMTime[VTK_MAX_VRCOMP];
00278
00279 vtkPiecewiseFunction *GradientOpacity[VTK_MAX_VRCOMP];
00280 vtkTimeStamp GradientOpacityMTime[VTK_MAX_VRCOMP];
00281
00282 int Shade[VTK_MAX_VRCOMP];
00283 float Ambient[VTK_MAX_VRCOMP];
00284 float Diffuse[VTK_MAX_VRCOMP];
00285 float Specular[VTK_MAX_VRCOMP];
00286 float SpecularPower[VTK_MAX_VRCOMP];
00287
00288 private:
00289 vtkVolumeProperty(const vtkVolumeProperty&);
00290 void operator=(const vtkVolumeProperty&);
00291 };
00292
00294 inline const char *vtkVolumeProperty::GetInterpolationTypeAsString(void)
00295 {
00296 if( this->InterpolationType == VTK_NEAREST_INTERPOLATION )
00297 {
00298 return "Nearest Neighbor";
00299 }
00300 else if( this->InterpolationType == VTK_LINEAR_INTERPOLATION )
00301 {
00302 return "Linear";
00303 }
00304 else
00305 {
00306 return "Unknown";
00307 }
00308 }
00309
00310 #endif