42#ifndef vtkUnstructuredGridPartialPreIntegration_h
43#define vtkUnstructuredGridPartialPreIntegration_h
46#include "vtkRenderingVolumeModule.h"
49class vtkPartialPreIntegrationTransferFunction;
70 static void IntegrateRay(
double length,
double intensity_front,
double attenuation_front,
71 double intensity_back,
double attenuation_back,
float color[4]);
72 static void IntegrateRay(
double length,
const double color_front[3],
double attenuation_front,
73 const double color_back[3],
double attenuation_back,
float color[4]);
83 static float Psi(
float taufD,
float taubD);
84 static float* GetPsiTable(
int&
size);
103 static float PsiTable[PSI_TABLE_SIZE * PSI_TABLE_SIZE];
114 float gammaf = taufD / (taufD + 1);
115 float gammab = taubD / (taubD + 1);
128 double intensity_front,
double attenuation_front,
double intensity_back,
double attenuation_back,
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;
138 (1 -
color[3]) * (intensity_front * (1 -
Psi) + intensity_back * (
Psi - zeta));
140 color[0] += newintensity;
141 color[1] += newintensity;
142 color[2] += newintensity;
147 const double color_front[3],
double attenuation_front,
const double color_back[3],
148 double attenuation_back,
float color[4])
150 float taufD =
length * attenuation_front;
151 float taubD =
length * attenuation_back;
153 float zeta =
static_cast<float>(exp(-0.5 * (taufD + taubD)));
154 float alpha = 1 - zeta;
156 color[0] += (1 -
color[3]) * (color_front[0] * (1 -
Psi) + color_back[0] * (
Psi - zeta));
157 color[1] += (1 -
color[3]) * (color_front[1] * (1 -
Psi) + color_back[1] * (
Psi - zeta));
158 color[2] += (1 -
color[3]) * (color_front[2] * (1 -
Psi) + color_back[2] * (
Psi - zeta));
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