22#ifndef vtkUnstructuredGridPartialPreIntegration_h
23#define vtkUnstructuredGridPartialPreIntegration_h
26#include "vtkRenderingVolumeModule.h"
29VTK_ABI_NAMESPACE_BEGIN
30class vtkPartialPreIntegrationTransferFunction;
44 vtkDataArray* farIntersections,
float color[4])
override;
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);
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;
abstract superclass for arrays of numeric data
dynamic, self-adjusting array of double
a simple class to control print indentation
static int Floor(double x)
Rounds a double to the nearest integer not greater than itself.
record modification and/or execution time
performs piecewise linear ray integration.
void Integrate(vtkDoubleArray *intersectionLengths, vtkDataArray *nearIntersections, vtkDataArray *farIntersections, float color[4]) override
Given a set of intersections (defined by the three arrays), compute the piecewise integration of the ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPartialPreIntegrationTransferFunction * TransferFunctions
vtkVolumeProperty * Property
void Initialize(vtkVolume *volume, vtkDataArray *scalars) override
Set up the integrator with the given properties and scalars.
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.
vtkTimeStamp TransferFunctionsModified
~vtkUnstructuredGridPartialPreIntegration() override
static float * GetPsiTable(int &size)
Looks up Psi (as defined by Moreland and Angel, "A Fast High Accuracy Volume Renderer for Unstructure...
vtkUnstructuredGridPartialPreIntegration()
static void BuildPsiTable()
Looks up Psi (as defined by Moreland and Angel, "A Fast High Accuracy Volume Renderer for Unstructure...
static float Psi(float taufD, float taubD)
Looks up Psi (as defined by Moreland and Angel, "A Fast High Accuracy Volume Renderer for Unstructure...
int NumIndependentComponents
static float PsiTable[PSI_TABLE_SIZE *PSI_TABLE_SIZE]
static vtkUnstructuredGridPartialPreIntegration * New()
a superclass for volume ray integration functions
represents the common properties for rendering a volume.
represents a volume (data & properties) in a rendered scene