Parse a mathematical expression and generate a GLSL source code string. More...
#include <vtkKWEFunctionToGLSL.h>


Parse a mathematical expression and generate a GLSL source code string.
vtkKWEFunctionToGLSL parses a mathematical expression conformed to the syntax parsed by vtkFunctionParser. However, instead of evaluating a value by executing the bytecode, it uses the bytecode to generate a GLSL source code used by vtkKWEGPUArrayCalculator.
The functions that this array calculator understands is:
standard operations: + - * / ^ . access vector components: iHat, jHat, kHat abs acos asin atan ceil cos cosh exp floor log mag min max norm sign sin sinh sqrt tan tanh
Note that some of these operations work on scalars, some on vectors, and some on both (e.g., you can multiply a scalar times a vector). The operations are performed tuple-wise (i.e., tuple-by-tuple). The user must specify which arrays to use as vectors and/or scalars, and the name of the output data array.
Definition at line 74 of file vtkKWEFunctionToGLSL.h.
| vtkKWEFunctionToGLSL::vtkKWEFunctionToGLSL | ( | ) | [protected] |
Default constructor. The function expression is a null pointer. The GLSLCode is a null pointer. ParseStatus is false.
| vtkKWEFunctionToGLSL::~vtkKWEFunctionToGLSL | ( | ) | [protected] |
Destructor.
| vtkKWEFunctionToGLSL::vtkTypeRevisionMacro | ( | vtkKWEFunctionToGLSL | , | |
| vtkFunctionParser | ||||
| ) |
| void vtkKWEFunctionToGLSL::PrintSelf | ( | ostream & | os, | |
| vtkIndent | indent | |||
| ) | [virtual] |
Reimplemented from vtkFunctionParser.
| static vtkKWEFunctionToGLSL* vtkKWEFunctionToGLSL::New | ( | ) | [static] |
Reimplemented from vtkFunctionParser.
| virtual bool vtkKWEFunctionToGLSL::GetParseStatus | ( | ) | [virtual] |
Value modified by GenerateGLSL().
| virtual void vtkKWEFunctionToGLSL::GenerateGLSL | ( | ) | [virtual] |
Generate GLSL source code in GLSLCode. Update ParseStatus.
| virtual int vtkKWEFunctionToGLSL::GetResultDimension | ( | ) | [virtual] |
Return the dimension of the result of the expression.
| virtual vtkStdString* vtkKWEFunctionToGLSL::GetGLSLCode | ( | ) | [virtual] |
Return the GLSLCode generated by GenerateGLSL() in a string.
| virtual bool vtkKWEFunctionToGLSL::GetScalarIsUsed | ( | int | index | ) | [virtual] |
Return if a given scalar data array is used in the function expression.
| virtual bool vtkKWEFunctionToGLSL::GetVectorIsUsed | ( | int | index | ) | [virtual] |
Return if a given vector data array is used in the function expression.
| vtkStdString* vtkKWEFunctionToGLSL::GetGLSLScalarName | ( | int | index | ) |
Return the GLSL name attached to the a given scalar data array.
| vtkStdString* vtkKWEFunctionToGLSL::GetGLSLVectorName | ( | int | index | ) |
Return the GLSL name attached to the a given vector data array.
| virtual int vtkKWEFunctionToGLSL::GetNumberOfUsedScalarVariables | ( | ) | [virtual] |
Return the number of scalar variables used in the expression.
| virtual int vtkKWEFunctionToGLSL::GetNumberOfUsedVectorVariables | ( | ) | [virtual] |
Return the number of vector variables used in the expression.
| void vtkKWEFunctionToGLSL::AllocateStringStack | ( | ) | [protected] |
Allocate string stack.
| void vtkKWEFunctionToGLSL::DeleteStringStack | ( | ) | [protected] |
Delete string stack.
| void vtkKWEFunctionToGLSL::BuildGLSLVariableNames | ( | ) | [protected] |
Build the name of the variable for GLSL. Only load the variables used in the function expression.
bool vtkKWEFunctionToGLSL::ParseStatus [protected] |
Definition at line 149 of file vtkKWEFunctionToGLSL.h.
vtkStdString* vtkKWEFunctionToGLSL::GLSLCode [protected] |
Definition at line 150 of file vtkKWEFunctionToGLSL.h.
vtkStdString* vtkKWEFunctionToGLSL::StringStack [protected] |
Definition at line 152 of file vtkKWEFunctionToGLSL.h.
int* vtkKWEFunctionToGLSL::PrecedenceStack [protected] |
Definition at line 153 of file vtkKWEFunctionToGLSL.h.
bool* vtkKWEFunctionToGLSL::ScalarIsUsed [protected] |
Definition at line 155 of file vtkKWEFunctionToGLSL.h.
int vtkKWEFunctionToGLSL::ScalarIsUsedSize [protected] |
Definition at line 156 of file vtkKWEFunctionToGLSL.h.
vtkStdString* vtkKWEFunctionToGLSL::GLSLScalarNames [protected] |
Definition at line 157 of file vtkKWEFunctionToGLSL.h.
int vtkKWEFunctionToGLSL::NumberOfUsedScalarVariables [protected] |
Definition at line 158 of file vtkKWEFunctionToGLSL.h.
bool* vtkKWEFunctionToGLSL::VectorIsUsed [protected] |
Definition at line 160 of file vtkKWEFunctionToGLSL.h.
int vtkKWEFunctionToGLSL::VectorIsUsedSize [protected] |
Definition at line 161 of file vtkKWEFunctionToGLSL.h.
vtkStdString* vtkKWEFunctionToGLSL::GLSLVectorNames [protected] |
Definition at line 162 of file vtkKWEFunctionToGLSL.h.
int vtkKWEFunctionToGLSL::NumberOfUsedVectorVariables [protected] |
Definition at line 163 of file vtkKWEFunctionToGLSL.h.
int vtkKWEFunctionToGLSL::ResultDimension [protected] |
Definition at line 165 of file vtkKWEFunctionToGLSL.h.
1.7.1