VTK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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);
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 
237  void SetShade(int index, int value);
238  void SetShade(int value)
239  { this->SetShade(0,value); }
240  int GetShade(int index);
241  int GetShade()
242  { return this->GetShade(0); }
243  void ShadeOn(int index);
244  void ShadeOn()
245  { this->ShadeOn(0); }
246  void ShadeOff(int index);
247  void ShadeOff()
248  { this->ShadeOff(0); }
250 
252 
253  void SetAmbient(int index, double value);
254  void SetAmbient(double value)
255  { this->SetAmbient(0, value); }
256  double GetAmbient(int index);
257  double GetAmbient()
258  { return this->GetAmbient(0); }
260 
262 
263  void SetDiffuse(int index, double value);
264  void SetDiffuse(double value)
265  { this->SetDiffuse(0, value); }
266  double GetDiffuse(int index);
267  double GetDiffuse()
268  { return this->GetDiffuse(0); }
270 
272 
273  void SetSpecular(int index, double value);
274  void SetSpecular(double value)
275  { this->SetSpecular(0, value); }
276  double GetSpecular(int index);
277  double GetSpecular()
278  { return this->GetSpecular(0); }
280 
282 
283  void SetSpecularPower(int index, double value);
284  void SetSpecularPower(double value)
285  { this->SetSpecularPower(0, value); }
286  double GetSpecularPower(int index);
288  { return this->GetSpecularPower(0); }
290 
291  //BTX
296  void UpdateMTimes();
297 
299 
301  vtkTimeStamp GetGradientOpacityMTime(int index);
303  { return this->GetGradientOpacityMTime(0); }
305 
307 
309  vtkTimeStamp GetScalarOpacityMTime(int index);
311  { return this->GetScalarOpacityMTime(0); }
313 
315 
317  vtkTimeStamp GetRGBTransferFunctionMTime(int index);
319  { return this->GetRGBTransferFunctionMTime(0); }
321 
323 
325  vtkTimeStamp GetGrayTransferFunctionMTime(int index);
327  { return this->GetGrayTransferFunctionMTime(0); }
328  //ETX
330 
331 protected:
334 
336  double ComponentWeight[VTK_MAX_VRCOMP];
337 
339 
340  int ColorChannels[VTK_MAX_VRCOMP];
341 
342  vtkPiecewiseFunction *GrayTransferFunction[VTK_MAX_VRCOMP];
343  vtkTimeStamp GrayTransferFunctionMTime[VTK_MAX_VRCOMP];
344 
346  vtkTimeStamp RGBTransferFunctionMTime[VTK_MAX_VRCOMP];
347 
349  vtkTimeStamp ScalarOpacityMTime[VTK_MAX_VRCOMP];
350  double ScalarOpacityUnitDistance[VTK_MAX_VRCOMP];
351 
353  vtkTimeStamp GradientOpacityMTime[VTK_MAX_VRCOMP];
354  vtkPiecewiseFunction *DefaultGradientOpacity[VTK_MAX_VRCOMP];
355  int DisableGradientOpacity[VTK_MAX_VRCOMP];
356 
357  int Shade[VTK_MAX_VRCOMP];
358  double Ambient[VTK_MAX_VRCOMP];
359  double Diffuse[VTK_MAX_VRCOMP];
360  double Specular[VTK_MAX_VRCOMP];
361  double SpecularPower[VTK_MAX_VRCOMP];
362 
363  virtual void CreateDefaultGradientOpacity(int index);
364 
365 private:
366  vtkVolumeProperty(const vtkVolumeProperty&); // Not implemented.
367  void operator=(const vtkVolumeProperty&); // Not implemented.
368 };
369 
371 
373 {
375  {
376  return "Nearest Neighbor";
377  }
379  {
380  return "Linear";
381  }
382  return "Unknown";
383 }
385 
386 #endif
vtkColorTransferFunction * GetRGBTransferFunction()
virtual void DisableGradientOpacityOn()
abstract base class for most VTK objects
Definition: vtkObject.h:61
GLuint index
Definition: vtkgl.h:11983
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)
GLsizei const GLfloat * value
Definition: vtkgl.h:12021
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
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()
GLfloat GLfloat p
Definition: vtkgl.h:15717