VTK
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
32#ifndef vtkVolumeRayCastFunction_h
33#define vtkVolumeRayCastFunction_h
34
35#include "vtkRenderingVolumeModule.h" // For export macro
36#include "vtkObject.h"
37
38class vtkRenderer;
39class vtkVolume;
41
42#if !defined(VTK_LEGACY_REMOVE)
43// Define a couple of structures we need to hold all the important information
44// This first structure hold the dynamic information - stuff that changes per
45// ray
46typedef struct
47{
48 // These are the return values - RGBA
49 float Color[4];
51
52 // Ray information transformed into local coordinates
53 float TransformedStart[4];
54 float TransformedEnd[4];
55 float TransformedDirection[4];
56 float TransformedIncrement[3];
57
58 // The number of steps we want to take if this is
59 // a ray caster that takes steps
61
62 // The number of steps we actually take if this is
63 // a ray caster that takes steps
65
67
68// This second structure hold the static information - things that don't
69// change over the whole image
70typedef struct
71{
72 // A pointer to the volume
74
75 // A pointer to the renderer
77
78 // Matrices for switching from view to volume coordinate, and back
82
85
86 // The camera thickness (distance between near and far) is necessary
87 // for computing sampling distance
89
90 // The type of the data and a pointer to it, and the information
91 // about its size, spacing, origin and precomputed increment
94 vtkIdType DataIncrement[3];
95 int DataSize[3];
96 double DataSpacing[3];
97 double DataOrigin[3];
98
99 // Information from the vtkVolumeProperty
102 float Color[3];
104
105 // The shading tables from the vtkEncodedGradientShader
106 // that will be used for shading the volume.
113
114 // Info needed from the gradient estimator
115 unsigned short *EncodedNormals;
116 unsigned char *GradientMagnitudes;
117
118 // Image information
123 unsigned char *Image;
124
126
127 // Is a MIP ray cast function in use? This will control
128 // how subsegments of the ray are combined when non-subvolume
129 // cropping is used. If maximize opacity is used, the color[3]
130 // value is used to find the max othersize the dynamicInfo->ScalarValue
131 // value is used
135
136class VTKRENDERINGVOLUME_EXPORT vtkVolumeRayCastFunction : public vtkObject
137{
138public:
140 void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
141
150 vtkVolume *vol,
151 vtkVolumeRayCastStaticInfo *staticInfo );
152
153 virtual void CastRay( vtkVolumeRayCastDynamicInfo *dynamicInfo,
154 vtkVolumeRayCastStaticInfo *staticInfo )=0;
155
160 virtual float GetZeroOpacityThreshold( vtkVolume *vol )=0;
161
162protected:
164 {
165 VTK_LEGACY_BODY(vtkVolumeRayCastMapper::vtkVolumeRayCastMapper,"VTK 7.0");
166 }
168
174 vtkVolume *vol,
175 vtkVolumeRayCastStaticInfo *staticInfo,
176 vtkVolumeRayCastMapper *mapper )=0;
177
178private:
179 vtkVolumeRayCastFunction(const vtkVolumeRayCastFunction&) VTK_DELETE_FUNCTION;
180 void operator=(const vtkVolumeRayCastFunction&) VTK_DELETE_FUNCTION;
181};
182#endif // VTK_LEGACY_REMOVE
183#endif
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
abstract specification for renderers
Definition: vtkRenderer.h:64
a superclass for ray casting functions
void FunctionInitialize(vtkRenderer *ren, vtkVolume *vol, vtkVolumeRayCastStaticInfo *staticInfo)
Do the basic initialization.
virtual void CastRay(vtkVolumeRayCastDynamicInfo *dynamicInfo, vtkVolumeRayCastStaticInfo *staticInfo)=0
virtual float GetZeroOpacityThreshold(vtkVolume *vol)=0
Get the value below which all scalar values are considered to have 0 opacity.
virtual void SpecificFunctionInitialize(vtkRenderer *ren, vtkVolume *vol, vtkVolumeRayCastStaticInfo *staticInfo, vtkVolumeRayCastMapper *mapper)=0
This method gives the subclass a chance to do any special initialization that it may need to do.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
A slow but accurate mapper for rendering volumes.
represents a volume (data & properties) in a rendered scene
Definition: vtkVolume.h:51
@ Color
Definition: vtkX3D.h:46
int vtkIdType
Definition: vtkType.h:287