37 #ifndef vtkExprTkFunctionParser_h
38 #define vtkExprTkFunctionParser_h
40 #include "vtkCommonMiscModule.h"
47 struct vtkExprTkTools;
65 void SetFunction(
const char*
function);
87 double GetScalarResult();
97 void GetVectorResult(
double result[3])
99 double* r = this->GetVectorResult();
118 void SetScalarVariableValue(
int i,
double value);
125 double GetScalarVariableValue(
const std::string& variableName);
126 double GetScalarVariableValue(
int i);
140 void SetVectorVariableValue(
141 const std::string& variableName,
double xValue,
double yValue,
double zValue);
144 this->SetVectorVariableValue(variableName, values[0], values[1], values[2]);
146 void SetVectorVariableValue(
int i,
double xValue,
double yValue,
double zValue);
149 this->SetVectorVariableValue(i, values[0], values[1], values[2]);
160 double* r = this->GetVectorVariableValue(variableName);
168 double* r = this->GetVectorVariableValue(i);
180 return static_cast<int>(this->UsedScalarVariableNames.size());
193 return static_cast<int>(this->UsedVectorVariableNames.size());
217 bool GetScalarVariableNeeded(
int i);
218 bool GetScalarVariableNeeded(
const std::string& variableName);
227 bool GetVectorVariableNeeded(
int i);
228 bool GetVectorVariableNeeded(
const std::string& variableName);
234 void RemoveAllVariables();
239 void RemoveScalarVariables();
244 void RemoveVectorVariables();
255 vtkBooleanMacro(ReplaceInvalidValues,
vtkTypeBool);
256 vtkSetMacro(ReplacementValue,
double);
257 vtkGetMacro(ReplacementValue,
double);
263 void InvalidateFunction();
295 int Parse(ParseMode
mode);
315 VectorReturningFunction vectorReturningFunction);
320 bool CheckOldFormatOfDotProductUsage();
331 void UpdateNeededVariables();
void GetVectorVariableValue(const std::string &variableName, double value[3])
Get the value of a vector variable.
abstract base class for most VTK objects
std::vector< std::string > UsedScalarVariableNames
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeUInt32 vtkMTimeType
record modification and/or execution time
std::vector< bool > ScalarVariableNeeded
std::vector< double * > ScalarVariableValues
vtkTypeBool ReplaceInvalidValues
vtkExprTkTools * ExprTkTools
vtkTimeStamp FunctionMTime
void GetVectorVariableValue(int i, double value[3])
Get the value of a vector variable.
std::vector< std::string > OriginalScalarVariableNames
std::vector< vtkTuple< double, 3 > * > VectorVariableValues
std::string FunctionWithUsedVariableNames
a simple class to control print indentation
std::vector< std::string > UsedVectorVariableNames
std::vector< std::string > OriginalVectorVariableNames
virtual vtkMTimeType GetMTime()
Return this object's modified time.
int GetNumberOfScalarVariables()
Get the number of scalar variables.
#define VTK_SIZEHINT(...)
int GetNumberOfVectorVariables()
Get the number of vector variables.
ParseMode
The first mode parses the function and uses a return statement to identify the ReturnType.
std::string ExpressionString
std::vector< bool > VectorVariableNeeded
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
VectorReturningFunction
Enum that defines the vector returning functions that are not supported by ExprTk.
vtkTuple< double, 3 > Result
void SetVectorVariableValue(int i, double values[3])
Set the value of a vector variable.
Parse and evaluate a mathematical expression.
const char * GetFunction()
Set/Get input string to evaluate.
void SetVectorVariableValue(const std::string &variableName, double values[3])
Set the value of a vector variable.