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