VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
VolumeRendering
vtkVolumeRayCastFunction.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkVolumeRayCastFunction.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
30
#ifndef __vtkVolumeRayCastFunction_h
31
#define __vtkVolumeRayCastFunction_h
32
33
#include "
vtkObject.h
"
34
35
class
vtkRenderer
;
36
class
vtkVolume
;
37
class
vtkVolumeRayCastMapper
;
38
39
// Define a couple of structures we need to hold all the important information
40
// This first structure hold the dynamic information - stuff that changes per
41
// ray
42
typedef
struct
43
{
44
// These are the return values - RGBA
45
float
Color
[4];
46
float
ScalarValue
;
47
48
// Ray information transformed into local coordinates
49
float
TransformedStart[4];
50
float
TransformedEnd[4];
51
float
TransformedDirection[4];
52
float
TransformedIncrement[3];
53
54
// The number of steps we want to take if this is
55
// a ray caster that takes steps
56
int
NumberOfStepsToTake
;
57
58
// The number of steps we actually take if this is
59
// a ray caster that takes steps
60
int
NumberOfStepsTaken
;
61
62
}
vtkVolumeRayCastDynamicInfo
;
63
64
// This second structure hold the static information - things that don't
65
// change over the whole image
66
typedef
struct
67
{
68
// A pointer to the volume
69
vtkVolume
*
Volume
;
70
71
// A pointer to the renderer
72
vtkRenderer
*
Renderer
;
73
74
// Matrices for switching from view to volume coordinate, and back
75
float
WorldToVoxelsMatrix[16];
76
float
VoxelsToWorldMatrix[16];
77
float
ViewToVoxelsMatrix[16];
78
79
float
*
ClippingPlane
;
80
int
NumberOfClippingPlanes
;
81
82
// The camera thickness (distance between near and far) is necessary
83
// for computing sampling distance
84
float
CameraThickness
;
85
86
// The type of the data and a pointer to it, and the information
87
// about its size, spacing, origin and precomputed increment
88
int
ScalarDataType
;
89
void
*
ScalarDataPointer
;
90
int
DataIncrement[3];
91
int
DataSize[3];
92
double
DataSpacing[3];
93
double
DataOrigin[3];
94
95
// Information from the vtkVolumeProperty
96
int
Shading
;
97
int
ColorChannels
;
98
float
Color
[3];
99
int
InterpolationType
;
100
101
// The shading tables from the vtkEncodedGradientShader
102
// that will be used for shading the volume.
103
float
*
RedDiffuseShadingTable
;
104
float
*
GreenDiffuseShadingTable
;
105
float
*
BlueDiffuseShadingTable
;
106
float
*
RedSpecularShadingTable
;
107
float
*
GreenSpecularShadingTable
;
108
float
*
BlueSpecularShadingTable
;
109
110
// Info needed from the gradient estimator
111
unsigned
short
*
EncodedNormals
;
112
unsigned
char
*
GradientMagnitudes
;
113
114
// Image information
115
int
ImageInUseSize[2];
116
int
ImageMemorySize[2];
117
int
ImageViewportSize[2];
118
int
ImageOrigin[2];
119
unsigned
char
*
Image
;
120
121
int
*
RowBounds
;
122
123
// Is a MIP ray cast function in use? This will control
124
// how subsegments of the ray are combined when non-subvolume
125
// cropping is used. If maximize opacity is used, the color[3]
126
// value is used to find the max othersize the dynamicInfo->ScalarValue
127
// value is used
128
int
MIPFunction
;
129
int
MaximizeOpacity
;
130
}
vtkVolumeRayCastStaticInfo
;
131
132
class
VTK_VOLUMERENDERING_EXPORT
vtkVolumeRayCastFunction
:
public
vtkObject
133
{
134
public
:
135
vtkTypeMacro(
vtkVolumeRayCastFunction
,
vtkObject
);
136
virtual
void
PrintSelf
(ostream& os,
vtkIndent
indent);
137
138
//BTX
140
145
void
FunctionInitialize(
vtkRenderer
*ren,
146
vtkVolume
*vol,
147
vtkVolumeRayCastStaticInfo
*staticInfo );
149
150
virtual
void
CastRay(
vtkVolumeRayCastDynamicInfo
*dynamicInfo,
151
vtkVolumeRayCastStaticInfo
*staticInfo )=0;
152
//ETX
153
156
virtual
float
GetZeroOpacityThreshold(
vtkVolume
*vol )=0;
157
158
protected
:
159
vtkVolumeRayCastFunction
() {};
160
~vtkVolumeRayCastFunction
() {};
161
162
//BTX
164
166
virtual
void
SpecificFunctionInitialize(
vtkRenderer
*ren,
167
vtkVolume
*vol,
168
vtkVolumeRayCastStaticInfo
*staticInfo,
169
vtkVolumeRayCastMapper
*mapper )=0;
170
//ETX
171
private
:
172
vtkVolumeRayCastFunction
(
const
vtkVolumeRayCastFunction
&);
// Not implemented.
173
void
operator=(
const
vtkVolumeRayCastFunction
&);
// Not implemented.
174
};
176
177
#endif
Generated on Fri Aug 2 2013 12:20:03 for VTK by
1.8.4