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:
64  void PrintSelf(ostream& os, vtkIndent indent);
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 
125  { this->SetColor(0, function); }
127 
129 
133  { return this->GetColorChannels(0); }
135 
137 
141  { return this->GetGrayTransferFunction(0); }
143 
145 
150  { return this->GetRGBTransferFunction(0); }
152 
154 
158  { this->SetScalarOpacity(0, function); }
160 
162 
167  { return this->GetScalarOpacity(0); }
169 
171 
176  void SetScalarOpacityUnitDistance(int index, double distance);
177  void SetScalarOpacityUnitDistance(double distance)
178  { this->SetScalarOpacityUnitDistance(0, distance); }
181  { return this->GetScalarOpacityUnitDistance(0); }
183 
184 
186 
190  { this->SetGradientOpacity(0, function); }
192 
194 
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); }
222  { return this->GetDisableGradientOpacity(0); }
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 
314  { return this->GetGradientOpacityMTime(0); }
316 
318 
322  { return this->GetScalarOpacityMTime(0); }
324 
326 
330  { return this->GetRGBTransferFunctionMTime(0); }
332 
334 
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 
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
vtkVolumeProperty::SetScalarOpacityUnitDistance
void SetScalarOpacityUnitDistance(int index, double distance)
vtkVolumeProperty::GetSpecular
double GetSpecular(int index)
vtkVolumeProperty::GetScalarOpacity
vtkPiecewiseFunction * GetScalarOpacity(int index)
vtkVolumeProperty::DisableGradientOpacityOn
virtual void DisableGradientOpacityOn(int index)
Definition: vtkVolumeProperty.h:212
vtkVolumeProperty::DisableGradientOpacityOff
virtual void DisableGradientOpacityOff()
Definition: vtkVolumeProperty.h:218
vtkVolumeProperty::GetSpecular
double GetSpecular()
Definition: vtkVolumeProperty.h:288
vtkVolumeProperty::SetScalarOpacityUnitDistance
void SetScalarOpacityUnitDistance(double distance)
Definition: vtkVolumeProperty.h:177
vtkVolumeProperty::GetGradientOpacity
vtkPiecewiseFunction * GetGradientOpacity()
Definition: vtkVolumeProperty.h:199
vtkVolumeProperty::GetMTime
unsigned long GetMTime()
vtkVolumeProperty::SetDiffuse
void SetDiffuse(int index, double value)
vtkVolumeProperty::SetGradientOpacity
void SetGradientOpacity(int index, vtkPiecewiseFunction *function)
vtkVolumeProperty::GetGrayTransferFunction
vtkPiecewiseFunction * GetGrayTransferFunction()
Definition: vtkVolumeProperty.h:140
vtkVolumeProperty::GetComponentWeight
virtual double GetComponentWeight(int index)
vtkVolumeProperty::GetScalarOpacityUnitDistance
double GetScalarOpacityUnitDistance(int index)
vtkVolumeProperty::New
static vtkVolumeProperty * New()
vtkVolumeProperty::SetAmbient
void SetAmbient(int index, double value)
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkVolumeProperty::GetShade
int GetShade()
Definition: vtkVolumeProperty.h:252
vtkVolumeProperty::GetRGBTransferFunction
vtkColorTransferFunction * GetRGBTransferFunction()
Definition: vtkVolumeProperty.h:149
vtkVolumeProperty::SetSpecularPower
void SetSpecularPower(double value)
Definition: vtkVolumeProperty.h:295
vtkVolumeProperty::ShadeOff
void ShadeOff(int index)
vtkVolumeProperty::SetColor
void SetColor(vtkColorTransferFunction *function)
Definition: vtkVolumeProperty.h:124
vtkVolumeProperty::DisableGradientOpacityOn
virtual void DisableGradientOpacityOn()
Definition: vtkVolumeProperty.h:214
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkVolumeProperty::SetShade
void SetShade(int index, int value)
vtkVolumeProperty::vtkVolumeProperty
vtkVolumeProperty()
vtkVolumeProperty::GetRGBTransferFunctionMTime
vtkTimeStamp GetRGBTransferFunctionMTime()
Definition: vtkVolumeProperty.h:329
vtkVolumeProperty::SetScalarOpacity
void SetScalarOpacity(vtkPiecewiseFunction *function)
Definition: vtkVolumeProperty.h:157
vtkVolumeProperty::SetComponentWeight
virtual void SetComponentWeight(int index, double value)
VTK_NEAREST_INTERPOLATION
#define VTK_NEAREST_INTERPOLATION
Definition: vtkSystemIncludes.h:103
vtkColorTransferFunction
Defines a transfer function for mapping a property to an RGB color value.
Definition: vtkColorTransferFunction.h:58
vtkVolumeProperty::SetGradientOpacity
void SetGradientOpacity(vtkPiecewiseFunction *function)
Definition: vtkVolumeProperty.h:189
vtkVolumeProperty::GetScalarOpacityMTime
vtkTimeStamp GetScalarOpacityMTime(int index)
vtkVolumeProperty::GetRGBTransferFunctionMTime
vtkTimeStamp GetRGBTransferFunctionMTime(int index)
vtkVolumeProperty::GetScalarOpacity
vtkPiecewiseFunction * GetScalarOpacity()
Definition: vtkVolumeProperty.h:166
vtkVolumeProperty::GetScalarOpacityUnitDistance
double GetScalarOpacityUnitDistance()
Definition: vtkVolumeProperty.h:180
vtkVolumeProperty::GetRGBTransferFunction
vtkColorTransferFunction * GetRGBTransferFunction(int index)
vtkVolumeProperty::ShadeOn
void ShadeOn(int index)
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkVolumeProperty::GetScalarOpacityMTime
vtkTimeStamp GetScalarOpacityMTime()
Definition: vtkVolumeProperty.h:321
vtkVolumeProperty::GetShade
int GetShade(int index)
vtkgl::value
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
vtkVolumeProperty::InterpolationType
int InterpolationType
Definition: vtkVolumeProperty.h:349
vtkVolumeProperty::SetColor
void SetColor(vtkPiecewiseFunction *function)
Definition: vtkVolumeProperty.h:115
vtkVolumeProperty::DeepCopy
void DeepCopy(vtkVolumeProperty *p)
vtkVolumeProperty::GetSpecularPower
double GetSpecularPower(int index)
vtkVolumeProperty::HasGradientOpacity
bool HasGradientOpacity(int index=0)
Definition: vtkVolumeProperty.h:234
vtkVolumeProperty::IndependentComponents
int IndependentComponents
Definition: vtkVolumeProperty.h:346
vtkVolumeProperty::GetGrayTransferFunction
vtkPiecewiseFunction * GetGrayTransferFunction(int index)
vtkVolumeProperty::SetSpecular
void SetSpecular(int index, double value)
vtkVolumeProperty::GetStoredGradientOpacity
vtkPiecewiseFunction * GetStoredGradientOpacity()
Definition: vtkVolumeProperty.h:224
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkRenderingCoreModule.h
vtkVolumeProperty::SetColor
void SetColor(int index, vtkColorTransferFunction *function)
vtkVolumeProperty::ShadeOff
void ShadeOff()
Definition: vtkVolumeProperty.h:258
vtkVolumeProperty::GetGrayTransferFunctionMTime
vtkTimeStamp GetGrayTransferFunctionMTime()
Definition: vtkVolumeProperty.h:337
vtkVolumeProperty::SetColor
void SetColor(int index, vtkPiecewiseFunction *function)
vtkVolumeProperty::GetColorChannels
int GetColorChannels()
Definition: vtkVolumeProperty.h:132
VTK_LINEAR_INTERPOLATION
#define VTK_LINEAR_INTERPOLATION
Definition: vtkSystemIncludes.h:104
vtkVolumeProperty::SetDisableGradientOpacity
virtual void SetDisableGradientOpacity(int value)
Definition: vtkVolumeProperty.h:210
vtkVolumeProperty::GetDisableGradientOpacity
virtual int GetDisableGradientOpacity(int index)
vtkVolumeProperty::SetSpecular
void SetSpecular(double value)
Definition: vtkVolumeProperty.h:285
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkVolumeProperty::GetInterpolationTypeAsString
const char * GetInterpolationTypeAsString(void)
Definition: vtkVolumeProperty.h:383
vtkObject.h
vtkPiecewiseFunction
Defines a 1D piecewise function.
Definition: vtkPiecewiseFunction.h:51
vtkVolumeProperty::SetScalarOpacity
void SetScalarOpacity(int index, vtkPiecewiseFunction *function)
vtkVolumeProperty::GetColorChannels
int GetColorChannels(int index)
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkVolumeProperty::SetSpecularPower
void SetSpecularPower(int index, double value)
vtkVolumeProperty::~vtkVolumeProperty
~vtkVolumeProperty()
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkVolumeProperty::GetGradientOpacityMTime
vtkTimeStamp GetGradientOpacityMTime()
Definition: vtkVolumeProperty.h:313
vtkVolumeProperty::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkVolumeProperty::DisableGradientOpacityOff
virtual void DisableGradientOpacityOff(int index)
Definition: vtkVolumeProperty.h:216
vtkVolumeProperty::GetGradientOpacityMTime
vtkTimeStamp GetGradientOpacityMTime(int index)
vtkVolumeProperty::GetStoredGradientOpacity
vtkPiecewiseFunction * GetStoredGradientOpacity(int index)
vtkVolumeProperty::SetInterpolationTypeToNearest
void SetInterpolationTypeToNearest()
Definition: vtkVolumeProperty.h:97
vtkVolumeProperty::GetGrayTransferFunctionMTime
vtkTimeStamp GetGrayTransferFunctionMTime(int index)
vtkVolumeProperty::GetDisableGradientOpacity
virtual int GetDisableGradientOpacity()
Definition: vtkVolumeProperty.h:221
vtkgl::p
GLfloat GLfloat p
Definition: vtkgl.h:15717
vtkVolumeProperty::UpdateMTimes
void UpdateMTimes()
vtkVolumeProperty::SetShade
void SetShade(int value)
Definition: vtkVolumeProperty.h:249
VTKRENDERINGCORE_EXPORT
#define VTKRENDERINGCORE_EXPORT
Definition: vtkRenderingCoreModule.h:15
vtkVolumeProperty::CreateDefaultGradientOpacity
virtual void CreateDefaultGradientOpacity(int index)
vtkVolumeProperty::SetInterpolationTypeToLinear
void SetInterpolationTypeToLinear()
Definition: vtkVolumeProperty.h:99
vtkVolumeProperty::GetDiffuse
double GetDiffuse(int index)
vtkVolumeProperty::GetAmbient
double GetAmbient()
Definition: vtkVolumeProperty.h:268
vtkVolumeProperty::GetSpecularPower
double GetSpecularPower()
Definition: vtkVolumeProperty.h:298
vtkVolumeProperty::GetGradientOpacity
vtkPiecewiseFunction * GetGradientOpacity(int index)
vtkVolumeProperty::SetDisableGradientOpacity
virtual void SetDisableGradientOpacity(int index, int value)
vtkVolumeProperty::GetDiffuse
double GetDiffuse()
Definition: vtkVolumeProperty.h:278
vtkVolumeProperty
represents the common properties for rendering a volume.
Definition: vtkVolumeProperty.h:60
vtkVolumeProperty::GetAmbient
double GetAmbient(int index)
vtkVolumeProperty::ShadeOn
void ShadeOn()
Definition: vtkVolumeProperty.h:255
vtkVolumeProperty::SetAmbient
void SetAmbient(double value)
Definition: vtkVolumeProperty.h:265
VTK_MAX_VRCOMP
#define VTK_MAX_VRCOMP
Definition: vtkSystemIncludes.h:114
vtkVolumeProperty::SetDiffuse
void SetDiffuse(double value)
Definition: vtkVolumeProperty.h:275