22 #ifndef vtkUnstructuredGridPartialPreIntegration_h
23 #define vtkUnstructuredGridPartialPreIntegration_h
26 #include "vtkRenderingVolumeModule.h"
29 VTK_ABI_NAMESPACE_BEGIN
30 class vtkPartialPreIntegrationTransferFunction;
51 static void IntegrateRay(
double length,
double intensity_front,
double attenuation_front,
52 double intensity_back,
double attenuation_back,
float color[4]);
53 static void IntegrateRay(
double length,
const double color_front[3],
double attenuation_front,
54 const double color_back[3],
double attenuation_back,
float color[4]);
64 static float Psi(
float taufD,
float taubD);
65 static float* GetPsiTable(
int&
size);
66 static void BuildPsiTable();
84 static float PsiTable[PSI_TABLE_SIZE * PSI_TABLE_SIZE];
95 float gammaf = taufD / (taufD + 1);
96 float gammab = taubD / (taubD + 1);
109 double intensity_front,
double attenuation_front,
double intensity_back,
double attenuation_back,
112 float taufD = length * attenuation_front;
113 float taubD = length * attenuation_back;
115 float zeta =
static_cast<float>(exp(-0.5 * (taufD + taubD)));
116 float alpha = 1 - zeta;
119 (1 - color[3]) * (intensity_front * (1 - Psi) + intensity_back * (Psi - zeta));
121 color[0] += newintensity;
122 color[1] += newintensity;
123 color[2] += newintensity;
124 color[3] += (1 - color[3]) * alpha;
128 const double color_front[3],
double attenuation_front,
const double color_back[3],
129 double attenuation_back,
float color[4])
131 float taufD = length * attenuation_front;
132 float taubD = length * attenuation_back;
134 float zeta =
static_cast<float>(exp(-0.5 * (taufD + taubD)));
135 float alpha = 1 - zeta;
137 color[0] += (1 - color[3]) * (color_front[0] * (1 - Psi) + color_back[0] * (Psi - zeta));
138 color[1] += (1 - color[3]) * (color_front[1] * (1 - Psi) + color_back[1] * (Psi - zeta));
139 color[2] += (1 - color[3]) * (color_front[2] * (1 - Psi) + color_back[2] * (Psi - zeta));
140 color[3] += (1 - color[3]) * alpha;
143 VTK_ABI_NAMESPACE_END
144 #endif // vtkUnstructuredGridPartialPreIntegration_h
represents a volume (data & properties) in a rendered scene
vtkTimeStamp TransferFunctionsModified
performs piecewise linear ray integration.
virtual void Initialize(vtkVolume *volume, vtkDataArray *scalars)=0
Set up the integrator with the given properties and scalars.
record modification and/or execution time
static float PsiTable[PSI_TABLE_SIZE *PSI_TABLE_SIZE]
vtkPartialPreIntegrationTransferFunction * TransferFunctions
dynamic, self-adjusting array of double
a superclass for volume ray integration functions
static void IntegrateRay(double length, double intensity_front, double attenuation_front, double intensity_back, double attenuation_back, float color[4])
Integrates a single ray segment.
a simple class to control print indentation
static int Floor(double x)
Rounds a double to the nearest integer not greater than itself.
abstract superclass for arrays of numeric data
int NumIndependentComponents
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
represents the common properties for rendering a volume.
vtkVolumeProperty * Property
static float * GetPsiTable(int &size)
Looks up Psi (as defined by Moreland and Angel, "A Fast High Accuracy Volume Renderer for Unstructure...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
static float Psi(float taufD, float taubD)
Looks up Psi (as defined by Moreland and Angel, "A Fast High Accuracy Volume Renderer for Unstructure...
virtual void Integrate(vtkDoubleArray *intersectionLengths, vtkDataArray *nearIntersections, vtkDataArray *farIntersections, float color[4])=0
Given a set of intersections (defined by the three arrays), compute the piecewise integration of the ...