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 "vtkRenderingCoreModule.h" // For export macro
53 #include "vtkObject.h"
54 
56 class vtkTimeStamp;
58 
60 {
61 public:
62  static vtkVolumeProperty *New();
63  vtkTypeMacro(vtkVolumeProperty, vtkObject);
64  void PrintSelf(ostream& os, vtkIndent indent);
65  void DeepCopy(vtkVolumeProperty *p);
66 
69  unsigned long GetMTime();
70 
72 
86  vtkSetClampMacro(IndependentComponents, int, 0, 1);
87  vtkGetMacro(IndependentComponents, int);
88  vtkBooleanMacro(IndependentComponents, int);
90 
92 
94  vtkSetClampMacro(InterpolationType, int,
96  vtkGetMacro(InterpolationType, int);
98  { this->SetInterpolationType(VTK_NEAREST_INTERPOLATION); }
100  { this->SetInterpolationType(VTK_LINEAR_INTERPOLATION); }
101  const char *GetInterpolationTypeAsString(void);
103 
105 
106  virtual void SetComponentWeight(int index, double value);
107  virtual double GetComponentWeight(int index);
109 
111 
114  void SetColor(int index, vtkPiecewiseFunction *function);
116  { this->SetColor(0, function); }
118 
120 
123  void SetColor(int index, vtkColorTransferFunction *function);
125  { this->SetColor(0, function); }
127 
129 
131  int GetColorChannels(int index);
133  { return this->GetColorChannels(0); }
135 
137 
139  vtkPiecewiseFunction *GetGrayTransferFunction(int index);
141  { return this->GetGrayTransferFunction(0); }
143 
145 
148  vtkColorTransferFunction *GetRGBTransferFunction(int index);
150  { return this->GetRGBTransferFunction(0); }
152 
154 
156  void SetScalarOpacity(int index, vtkPiecewiseFunction *function);
158  { this->SetScalarOpacity(0, function); }
160 
162 
165  vtkPiecewiseFunction *GetScalarOpacity(int index);
167  { return this->GetScalarOpacity(0); }
169 
171 
176  void SetScalarOpacityUnitDistance(int index, double distance);
177  void SetScalarOpacityUnitDistance(double distance)
178  { this->SetScalarOpacityUnitDistance(0, distance); }
179  double GetScalarOpacityUnitDistance(int index);
181  { return this->GetScalarOpacityUnitDistance(0); }
183 
184 
186 
188  void SetGradientOpacity(int index, vtkPiecewiseFunction *function);
190  { this->SetGradientOpacity(0, function); }
192 
194 
198  vtkPiecewiseFunction *GetGradientOpacity(int index);
200  { return this->GetGradientOpacity(0); }
202 
204 
209  virtual void SetDisableGradientOpacity(int index, int value);
211  { this->SetDisableGradientOpacity(0, value); }
212  virtual void DisableGradientOpacityOn(int index )
213  { this->SetDisableGradientOpacity(index, 1); }
215  { this->DisableGradientOpacityOn(0); }
217  { this->SetDisableGradientOpacity(index, 0); }
219  { this->DisableGradientOpacityOff(0); }
220  virtual int GetDisableGradientOpacity(int index);
222  { return this->GetDisableGradientOpacity(0); }
223  vtkPiecewiseFunction *GetStoredGradientOpacity(int index);
225  { return this->GetStoredGradientOpacity(0); }
227 
229 
234  bool HasGradientOpacity(int index=0) {
235  return (this->GradientOpacity[index] != NULL);
236  }
238 
240 
248  void SetShade(int index, int value);
249  void SetShade(int value)
250  { this->SetShade(0,value); }
251  int GetShade(int index);
252  int GetShade()
253  { return this->GetShade(0); }
254  void ShadeOn(int index);
255  void ShadeOn()
256  { this->ShadeOn(0); }
257  void ShadeOff(int index);
258  void ShadeOff()
259  { this->ShadeOff(0); }
261 
263 
264  void SetAmbient(int index, double value);
265  void SetAmbient(double value)
266  { this->SetAmbient(0, value); }
267  double GetAmbient(int index);
268  double GetAmbient()
269  { return this->GetAmbient(0); }
271 
273 
274  void SetDiffuse(int index, double value);
275  void SetDiffuse(double value)
276  { this->SetDiffuse(0, value); }
277  double GetDiffuse(int index);
278  double GetDiffuse()
279  { return this->GetDiffuse(0); }
281 
283 
284  void SetSpecular(int index, double value);
285  void SetSpecular(double value)
286  { this->SetSpecular(0, value); }
287  double GetSpecular(int index);
288  double GetSpecular()
289  { return this->GetSpecular(0); }
291 
293 
294  void SetSpecularPower(int index, double value);
295  void SetSpecularPower(double value)
296  { this->SetSpecularPower(0, value); }
297  double GetSpecularPower(int index);
299  { return this->GetSpecularPower(0); }
301 
302  //BTX
307  void UpdateMTimes();
308 
310 
312  vtkTimeStamp GetGradientOpacityMTime(int index);
314  { return this->GetGradientOpacityMTime(0); }
316 
318 
320  vtkTimeStamp GetScalarOpacityMTime(int index);
322  { return this->GetScalarOpacityMTime(0); }
324 
326 
328  vtkTimeStamp GetRGBTransferFunctionMTime(int index);
330  { return this->GetRGBTransferFunctionMTime(0); }
332 
334 
336  vtkTimeStamp GetGrayTransferFunctionMTime(int index);
338  { return this->GetGrayTransferFunctionMTime(0); }
339  //ETX
341 
342 protected:
345 
347  double ComponentWeight[VTK_MAX_VRCOMP];
348 
350 
351  int ColorChannels[VTK_MAX_VRCOMP];
352 
353  vtkPiecewiseFunction *GrayTransferFunction[VTK_MAX_VRCOMP];
354  vtkTimeStamp GrayTransferFunctionMTime[VTK_MAX_VRCOMP];
355 
357  vtkTimeStamp RGBTransferFunctionMTime[VTK_MAX_VRCOMP];
358 
360  vtkTimeStamp ScalarOpacityMTime[VTK_MAX_VRCOMP];
361  double ScalarOpacityUnitDistance[VTK_MAX_VRCOMP];
362 
364  vtkTimeStamp GradientOpacityMTime[VTK_MAX_VRCOMP];
365  vtkPiecewiseFunction *DefaultGradientOpacity[VTK_MAX_VRCOMP];
366  int DisableGradientOpacity[VTK_MAX_VRCOMP];
367 
368  int Shade[VTK_MAX_VRCOMP];
369  double Ambient[VTK_MAX_VRCOMP];
370  double Diffuse[VTK_MAX_VRCOMP];
371  double Specular[VTK_MAX_VRCOMP];
372  double SpecularPower[VTK_MAX_VRCOMP];
373 
374  virtual void CreateDefaultGradientOpacity(int index);
375 
376 private:
377  vtkVolumeProperty(const vtkVolumeProperty&); // Not implemented.
378  void operator=(const vtkVolumeProperty&); // Not implemented.
379 };
380 
382 
384 {
386  {
387  return "Nearest Neighbor";
388  }
390  {
391  return "Linear";
392  }
393  return "Unknown";
394 }
396 
397 #endif
vtkColorTransferFunction * GetRGBTransferFunction()
virtual void DisableGradientOpacityOn()
abstract base class for most VTK objects
Definition: vtkObject.h:61
void SetAmbient(double value)
Defines a 1D piecewise function.
void SetSpecularPower(double value)
void SetColor(vtkColorTransferFunction *function)
vtkPiecewiseFunction * GetGrayTransferFunction()
record modification and/or execution time
Definition: vtkTimeStamp.h:34
#define VTK_LINEAR_INTERPOLATION
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
void SetScalarOpacity(vtkPiecewiseFunction *function)
void SetGradientOpacity(vtkPiecewiseFunction *function)
void SetColor(vtkPiecewiseFunction *function)
double GetScalarOpacityUnitDistance()
#define VTK_MAX_VRCOMP
vtkPiecewiseFunction * GetScalarOpacity()
vtkTimeStamp GetRGBTransferFunctionMTime()
virtual void PrintSelf(ostream &os, vtkIndent indent)
const char * GetInterpolationTypeAsString(void)
vtkPiecewiseFunction * GetStoredGradientOpacity()
vtkTimeStamp GetScalarOpacityMTime()
virtual unsigned long GetMTime()
a simple class to control print indentation
Definition: vtkIndent.h:38
bool HasGradientOpacity(int index=0)
vtkTimeStamp GetGrayTransferFunctionMTime()
void SetInterpolationTypeToNearest()
represents the common properties for rendering a volume.
virtual void SetDisableGradientOpacity(int value)
void SetSpecular(double value)
void SetShade(int value)
Defines a transfer function for mapping a property to an RGB color value.
#define VTKRENDERINGCORE_EXPORT
void SetDiffuse(double value)
void SetInterpolationTypeToLinear()
static vtkObject * New()
virtual int GetDisableGradientOpacity()
vtkTimeStamp GetGradientOpacityMTime()
virtual void DisableGradientOpacityOff(int index)
virtual void DisableGradientOpacityOn(int index)
#define VTK_NEAREST_INTERPOLATION
virtual void DisableGradientOpacityOff()
void SetScalarOpacityUnitDistance(double distance)
vtkPiecewiseFunction * GetGradientOpacity()