25 #ifndef vtkExprTkFunctionParser_h
26 #define vtkExprTkFunctionParser_h
28 #include "vtkCommonMiscModule.h"
35 VTK_ABI_NAMESPACE_BEGIN
36 struct vtkExprTkTools;
54 void SetFunction(
const char*
function);
76 double GetScalarResult();
86 void GetVectorResult(
double result[3])
88 double* r = this->GetVectorResult();
107 void SetScalarVariableValue(
int i,
double value);
114 double GetScalarVariableValue(
const std::string& variableName);
115 double GetScalarVariableValue(
int i);
129 void SetVectorVariableValue(
130 const std::string& variableName,
double xValue,
double yValue,
double zValue);
133 this->SetVectorVariableValue(variableName, values[0], values[1], values[2]);
135 void SetVectorVariableValue(
int i,
double xValue,
double yValue,
double zValue);
138 this->SetVectorVariableValue(i, values[0], values[1], values[2]);
149 double* r = this->GetVectorVariableValue(variableName);
157 double* r = this->GetVectorVariableValue(i);
169 return static_cast<int>(this->UsedScalarVariableNames.size());
182 return static_cast<int>(this->UsedVectorVariableNames.size());
206 bool GetScalarVariableNeeded(
int i);
207 bool GetScalarVariableNeeded(
const std::string& variableName);
216 bool GetVectorVariableNeeded(
int i);
217 bool GetVectorVariableNeeded(
const std::string& variableName);
223 void RemoveAllVariables();
228 void RemoveScalarVariables();
233 void RemoveVectorVariables();
244 vtkBooleanMacro(ReplaceInvalidValues,
vtkTypeBool);
245 vtkSetMacro(ReplacementValue,
double);
246 vtkGetMacro(ReplacementValue,
double);
252 void InvalidateFunction();
284 int Parse(ParseMode
mode);
304 VectorReturningFunction vectorReturningFunction);
309 bool CheckOldFormatOfDotProductUsage();
320 void UpdateNeededVariables();
357 VTK_ABI_NAMESPACE_END
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.