VTK
vtkVolume.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkVolume.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 =========================================================================*/
36 #ifndef vtkVolume_h
37 #define vtkVolume_h
38 
39 #include "vtkRenderingCoreModule.h" // For export macro
40 #include "vtkProp3D.h"
41 
42 class vtkRenderer;
43 class vtkPropCollection;
45 class vtkWindow;
46 class vtkVolumeProperty;
48 
50 {
51 public:
53  void PrintSelf(ostream& os, vtkIndent indent);
54 
58  static vtkVolume *New();
59 
61 
65 
67 
68  void SetProperty(vtkVolumeProperty *property);
71 
76 
78  void Update();
79 
81 
83  double *GetBounds();
84  void GetBounds(double bounds[6])
85  { this->vtkProp3D::GetBounds(bounds); }
86  double GetMinXBound();
87  double GetMaxXBound();
88  double GetMinYBound();
89  double GetMaxYBound();
90  double GetMinZBound();
91  double GetMaxZBound();
93 
95  unsigned long int GetMTime();
96 
101  unsigned long GetRedrawMTime();
102 
104  void ShallowCopy(vtkProp *prop);
105 
106 //BTX
113 
119 
121 
125  { return this->GetCorrectedScalarOpacityArray(0); }
127 
129 
133  { return this->GetScalarOpacityArray(0); }
135 
137 
141  { return this->GetGradientOpacityArray(0); }
143 
145 
147  float *GetGrayArray(int);
148  float *GetGrayArray()
149  { return this->GetGrayArray(0); }
151 
153 
155  float *GetRGBArray(int);
156  float *GetRGBArray()
157  { return this->GetRGBArray(0); }
159 
161 
165  { return this->GetGradientOpacityConstant(0); }
167 
169 
171  float GetArraySize()
172  { return static_cast<float>(this->ArraySize); }
174 
178 
180 
183  float sample_distance);
185 
186 //ETX
187 
188 protected:
191 
194 
195  // The rgb transfer function array - for unsigned char data this
196  // is 256 elements, for short or unsigned short it is 65536 elements
197  // This is a sample at each scalar value of the rgb transfer
198  // function. A time stamp is kept to know when it needs rebuilding
199  float *RGBArray[VTK_MAX_VRCOMP];
200  vtkTimeStamp RGBArrayMTime[VTK_MAX_VRCOMP];
201 
202  // The gray transfer function array - for unsigned char data this
203  // is 256 elements, for short or unsigned short it is 65536 elements
204  // This is a sample at each scalar value of the gray transfer
205  // function. A time stamp is kept to know when it needs rebuilding
206  float *GrayArray[VTK_MAX_VRCOMP];
207  vtkTimeStamp GrayArrayMTime[VTK_MAX_VRCOMP];
208 
209  // The scalar opacity transfer function array - for unsigned char data this
210  // is 256 elements, for short or unsigned short it is 65536 elements
211  // This is a sample at each scalar value of the opacity transfer
212  // function. A time stamp is kept to know when it needs rebuilding
213  float *ScalarOpacityArray[VTK_MAX_VRCOMP];
214  vtkTimeStamp ScalarOpacityArrayMTime[VTK_MAX_VRCOMP];
215 
216  // The corrected scalar opacity transfer function array - this is identical
217  // to the opacity transfer function array when the step size is 1.
218  // In other cases, it is corrected to reflect the new material thickness
219  // modelled by a step size different than 1.
220  float *CorrectedScalarOpacityArray[VTK_MAX_VRCOMP];
221  vtkTimeStamp CorrectedScalarOpacityArrayMTime[VTK_MAX_VRCOMP];
222 
223  // CorrectedStepSize is the step size currently modelled by
224  // CorrectedArray. It is used to determine when the
225  // CorrectedArray needs to be updated to match SampleDistance
226  // in the volume mapper.
228 
229  // Number of elements in the rgb, gray, and opacity transfer function arrays
231 
232  // The magnitude of gradient opacity transfer function array
233  float GradientOpacityArray[VTK_MAX_VRCOMP][256];
234  float GradientOpacityConstant[VTK_MAX_VRCOMP];
235  vtkTimeStamp GradientOpacityArrayMTime[VTK_MAX_VRCOMP];
236 
237  // Function to compute screen coverage of this volume
239 
240 private:
241  vtkVolume(const vtkVolume&); // Not implemented.
242  void operator=(const vtkVolume&); // Not implemented.
243 };
244 
245 #endif
vtkVolume::GetMaxZBound
double GetMaxZBound()
vtkVolumeCollection
a list of volumes
Definition: vtkVolumeCollection.h:35
vtkVolume::GetVolumes
void GetVolumes(vtkPropCollection *vc)
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkVolume::ArraySize
int ArraySize
Definition: vtkVolume.h:230
vtkVolume::GetRedrawMTime
unsigned long GetRedrawMTime()
vtkVolume
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:50
vtkProp3D
represents an 3D object for placement in a rendered scene
Definition: vtkProp3D.h:43
vtkVolume::GetArraySize
float GetArraySize()
Definition: vtkVolume.h:171
vtkVolume::GetMaxXBound
double GetMaxXBound()
vtkVolume::GetScalarOpacityArray
float * GetScalarOpacityArray()
Definition: vtkVolume.h:132
vtkVolume::vtkVolume
vtkVolume()
vtkVolume::Update
void Update()
vtkTimeStamp
record modification and/or execution time
Definition: vtkTimeStamp.h:35
vtkVolume::RenderVolumetricGeometry
int RenderVolumetricGeometry(vtkViewport *viewport)
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkVolume::GetRGBArray
float * GetRGBArray()
Definition: vtkVolume.h:156
vtkVolume::GetMinYBound
double GetMinYBound()
vtkVolume::UpdateTransferFunctions
void UpdateTransferFunctions(vtkRenderer *ren)
vtkVolume::GetMinZBound
double GetMinZBound()
vtkVolume::GetBounds
double * GetBounds()
vtkVolume::GetScalarOpacityArray
float * GetScalarOpacityArray(int)
vtkVolume::Property
vtkVolumeProperty * Property
Definition: vtkVolume.h:193
vtkVolume::SetProperty
void SetProperty(vtkVolumeProperty *property)
vtkVolume::GetGrayArray
float * GetGrayArray()
Definition: vtkVolume.h:148
vtkVolume::CorrectedStepSize
float CorrectedStepSize
Definition: vtkVolume.h:227
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkVolume::GetMaxYBound
double GetMaxYBound()
vtkVolume::~vtkVolume
~vtkVolume()
vtkVolume::GetCorrectedScalarOpacityArray
float * GetCorrectedScalarOpacityArray(int)
vtkVolume::GetGradientOpacityArray
float * GetGradientOpacityArray()
Definition: vtkVolume.h:140
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkRenderingCoreModule.h
vtkVolume::GetMinXBound
double GetMinXBound()
vtkVolume::SetMapper
void SetMapper(vtkAbstractVolumeMapper *mapper)
vtkVolume::Mapper
vtkAbstractVolumeMapper * Mapper
Definition: vtkVolume.h:192
vtkVolume::GetRGBArray
float * GetRGBArray(int)
vtkVolume::New
static vtkVolume * New()
vtkVolume::GetProperty
vtkVolumeProperty * GetProperty()
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkVolume::GetGradientOpacityArray
float * GetGradientOpacityArray(int)
vtkVolume::GetCorrectedScalarOpacityArray
float * GetCorrectedScalarOpacityArray()
Definition: vtkVolume.h:124
vtkVolume::ComputeScreenCoverage
double ComputeScreenCoverage(vtkViewport *vp)
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:50
vtkVolume::UpdateScalarOpacityforSampleSize
void UpdateScalarOpacityforSampleSize(vtkRenderer *ren, float sample_distance)
vtkVolume::GetGrayArray
float * GetGrayArray(int)
vtkAbstractVolumeMapper
Abstract class for a volume mapper.
Definition: vtkAbstractVolumeMapper.h:38
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:64
vtkVolume::ShallowCopy
void ShallowCopy(vtkProp *prop)
vtkVolume::GetMTime
unsigned long int GetMTime()
VTKRENDERINGCORE_EXPORT
#define VTKRENDERINGCORE_EXPORT
Definition: vtkRenderingCoreModule.h:15
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:38
vtkVolume::GetGradientOpacityConstant
float GetGradientOpacityConstant()
Definition: vtkVolume.h:164
vtkVolume::ReleaseGraphicsResources
void ReleaseGraphicsResources(vtkWindow *)
vtkVolume::GetGradientOpacityConstant
float GetGradientOpacityConstant(int)
vtkVolumeProperty
represents the common properties for rendering a volume.
Definition: vtkVolumeProperty.h:60
vtkVolume::GetBounds
void GetBounds(double bounds[6])
Definition: vtkVolume.h:84
VTK_MAX_VRCOMP
#define VTK_MAX_VRCOMP
Definition: vtkSystemIncludes.h:114
vtkProp3D.h
vtkVolume::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkProp3D::GetBounds
virtual double * GetBounds()=0