VTK
vtkVolumeProperty.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkVolumeProperty.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
49 #ifndef __vtkVolumeProperty_h
50 #define __vtkVolumeProperty_h
51 
52 #include "vtkObject.h"
53 
55 class vtkTimeStamp;
57 
59 {
60 public:
61  static vtkVolumeProperty *New();
63  void PrintSelf(ostream& os, vtkIndent indent);
64  void DeepCopy(vtkVolumeProperty *p);
65 
68  unsigned long GetMTime();
69 
71 
85  vtkSetClampMacro( IndependentComponents, int, 0, 1 );
86  vtkGetMacro( IndependentComponents, int );
87  vtkBooleanMacro( IndependentComponents, int );
89 
91 
93  vtkSetClampMacro( InterpolationType, int,
95  vtkGetMacro(InterpolationType,int);
96  void SetInterpolationTypeToNearest()
97  {this->SetInterpolationType(VTK_NEAREST_INTERPOLATION);};
98  void SetInterpolationTypeToLinear()
99  {this->SetInterpolationType(VTK_LINEAR_INTERPOLATION);};
100  const char *GetInterpolationTypeAsString(void);
102 
104 
105  virtual void SetComponentWeight(int index, double value);
106  virtual double GetComponentWeight(int index);
108 
110 
113  void SetColor( int index, vtkPiecewiseFunction *function );
114  void SetColor( vtkPiecewiseFunction *f ){this->SetColor(0,f);};
116 
118 
121  void SetColor( int index, vtkColorTransferFunction *function );
122  void SetColor( vtkColorTransferFunction *f ){this->SetColor(0,f);};
124 
126 
128  int GetColorChannels( int index );
129  int GetColorChannels(){return this->GetColorChannels(0);};
131 
133 
135  vtkPiecewiseFunction *GetGrayTransferFunction( int index );
136  vtkPiecewiseFunction *GetGrayTransferFunction()
137  {return this->GetGrayTransferFunction(0);};
139 
141 
144  vtkColorTransferFunction *GetRGBTransferFunction( int index );
145  vtkColorTransferFunction *GetRGBTransferFunction()
146  {return this->GetRGBTransferFunction(0);};
148 
150 
152  void SetScalarOpacity( int index, vtkPiecewiseFunction *function );
153  void SetScalarOpacity( vtkPiecewiseFunction *f )
154  {this->SetScalarOpacity(0,f);};
156 
158 
161  vtkPiecewiseFunction *GetScalarOpacity( int index );
162  vtkPiecewiseFunction *GetScalarOpacity()
163  {return this->GetScalarOpacity(0);};
165 
167 
172  void SetScalarOpacityUnitDistance( int index, double distance );
173  void SetScalarOpacityUnitDistance( double distance )
174  {this->SetScalarOpacityUnitDistance( 0, distance );}
175  double GetScalarOpacityUnitDistance( int index );
176  double GetScalarOpacityUnitDistance()
177  {return this->GetScalarOpacityUnitDistance(0);}
179 
180 
182 
184  void SetGradientOpacity( int index, vtkPiecewiseFunction *function );
185  void SetGradientOpacity( vtkPiecewiseFunction *function )
186  {this->SetGradientOpacity(0,function);}
188 
190 
194  vtkPiecewiseFunction *GetGradientOpacity( int index );
195  vtkPiecewiseFunction *GetGradientOpacity()
196  {return this->GetGradientOpacity( 0 );}
198 
200 
205  virtual void SetDisableGradientOpacity( int index, int value );
206  virtual void SetDisableGradientOpacity( int value )
207  { this->SetDisableGradientOpacity(0, value); }
208  virtual void DisableGradientOpacityOn( int index )
209  { this->SetDisableGradientOpacity(index, 1); }
210  virtual void DisableGradientOpacityOn()
211  { this->DisableGradientOpacityOn(0); }
212  virtual void DisableGradientOpacityOff( int index )
213  { this->SetDisableGradientOpacity(index, 0); }
214  virtual void DisableGradientOpacityOff()
215  { this->DisableGradientOpacityOff(0); }
216  virtual int GetDisableGradientOpacity( int index );
217  virtual int GetDisableGradientOpacity()
218  { return this->GetDisableGradientOpacity(0); }
219  vtkPiecewiseFunction *GetStoredGradientOpacity( int index );
220  vtkPiecewiseFunction *GetStoredGradientOpacity()
221  {return this->GetStoredGradientOpacity( 0 );}
223 
225 
233  void SetShade( int index, int value );
234  void SetShade( int value ) {this->SetShade(0,value);}
235  int GetShade( int index );
236  int GetShade() {return this->GetShade(0);}
237  void ShadeOn( int index );
238  void ShadeOn() {this->ShadeOn(0);}
239  void ShadeOff( int index );
240  void ShadeOff() {this->ShadeOff(0);}
242 
244 
245  void SetAmbient( int index, double value );
246  void SetAmbient( double value ) {this->SetAmbient( 0, value );}
247  double GetAmbient( int index );
248  double GetAmbient() {return this->GetAmbient(0);}
250 
252 
253  void SetDiffuse( int index, double value );
254  void SetDiffuse( double value ) {this->SetDiffuse( 0, value );}
255  double GetDiffuse( int index );
256  double GetDiffuse() {return this->GetDiffuse(0);}
258 
260 
261  void SetSpecular( int index, double value );
262  void SetSpecular( double value ) {this->SetSpecular( 0, value );}
263  double GetSpecular( int index );
264  double GetSpecular() {return this->GetSpecular(0);}
266 
268 
269  void SetSpecularPower( int index, double value );
270  void SetSpecularPower( double value ) {this->SetSpecularPower( 0, value );}
271  double GetSpecularPower( int index );
272  double GetSpecularPower() {return this->GetSpecularPower(0);}
274 
275  //BTX
280  void UpdateMTimes();
281 
283 
285  vtkTimeStamp GetGradientOpacityMTime( int index );
286  vtkTimeStamp GetGradientOpacityMTime()
287  { return this->GetGradientOpacityMTime(0); }
289 
291 
293  vtkTimeStamp GetScalarOpacityMTime( int index );
294  vtkTimeStamp GetScalarOpacityMTime()
295  { return this->GetScalarOpacityMTime(0); }
297 
299 
301  vtkTimeStamp GetRGBTransferFunctionMTime( int index );
302  vtkTimeStamp GetRGBTransferFunctionMTime()
303  { return this->GetRGBTransferFunctionMTime(0); }
305 
307 
309  vtkTimeStamp GetGrayTransferFunctionMTime( int index );
310  vtkTimeStamp GetGrayTransferFunctionMTime()
311  { return this->GetGrayTransferFunctionMTime(0); }
312  //ETX
314 
315 protected:
318 
320  double ComponentWeight[VTK_MAX_VRCOMP];
321 
323 
324  int ColorChannels[VTK_MAX_VRCOMP];
325 
326  vtkPiecewiseFunction *GrayTransferFunction[VTK_MAX_VRCOMP];
327  vtkTimeStamp GrayTransferFunctionMTime[VTK_MAX_VRCOMP];
328 
330  vtkTimeStamp RGBTransferFunctionMTime[VTK_MAX_VRCOMP];
331 
333  vtkTimeStamp ScalarOpacityMTime[VTK_MAX_VRCOMP];
334  double ScalarOpacityUnitDistance[VTK_MAX_VRCOMP];
335 
337  vtkTimeStamp GradientOpacityMTime[VTK_MAX_VRCOMP];
338  vtkPiecewiseFunction *DefaultGradientOpacity[VTK_MAX_VRCOMP];
339  int DisableGradientOpacity[VTK_MAX_VRCOMP];
340 
341  int Shade[VTK_MAX_VRCOMP];
342  double Ambient[VTK_MAX_VRCOMP];
343  double Diffuse[VTK_MAX_VRCOMP];
344  double Specular[VTK_MAX_VRCOMP];
345  double SpecularPower[VTK_MAX_VRCOMP];
346 
347  virtual void CreateDefaultGradientOpacity(int index);
348 
349 private:
350  vtkVolumeProperty(const vtkVolumeProperty&); // Not implemented.
351  void operator=(const vtkVolumeProperty&); // Not implemented.
352 };
353 
355 
357 {
359  {
360  return "Nearest Neighbor";
361  }
362  else if( this->InterpolationType == VTK_LINEAR_INTERPOLATION )
363  {
364  return "Linear";
365  }
366  else
367  {
368  return "Unknown";
369  }
370 }
372 
373 #endif