25 #ifndef vtkExprTkFunctionParser_h
26 #define vtkExprTkFunctionParser_h
28 #include "vtkCommonMiscModule.h"
35 VTK_ABI_NAMESPACE_BEGIN
36 struct vtkExprTkTools;
53 vtkGetMacro(ResultSize,
int);
61 void SetFunction(
const char*
function);
83 double GetScalarResult();
92 double* GetVectorResult()
VTK_SIZEHINT(this->GetResultSize());
93 void GetVectorResult(
double* result)
95 double* r = this->GetVectorResult();
96 for (
int i = 0; i < this->ResultSize; ++i)
115 void SetScalarVariableValue(
int i,
double value);
122 double GetScalarVariableValue(
const std::string& variableName);
123 double GetScalarVariableValue(
int i);
138 const std::string& variableName,
double xValue,
double yValue,
double zValue)
140 double values[3] = { xValue, yValue, zValue };
141 this->SetVectorVariableValue(variableName, values, 3);
143 void SetVectorVariableValue(
const std::string& variableName,
double* values,
int size = 3);
146 double values[3] = { xValue, yValue, zValue };
147 this->SetVectorVariableValue(i, values, 3);
149 void SetVectorVariableValue(
int i,
double values[3],
int size = 3);
159 double* r = this->GetVectorVariableValue(variableName);
167 double* r = this->GetVectorVariableValue(i);
179 return static_cast<int>(this->UsedScalarVariableNames.size());
192 return static_cast<int>(this->UsedVectorVariableNames.size());
216 bool GetScalarVariableNeeded(
int i);
217 bool GetScalarVariableNeeded(
const std::string& variableName);
226 bool GetVectorVariableNeeded(
int i);
227 bool GetVectorVariableNeeded(
const std::string& variableName);
233 void RemoveAllVariables();
238 void RemoveScalarVariables();
243 void RemoveVectorVariables();
254 vtkBooleanMacro(ReplaceInvalidValues,
vtkTypeBool);
255 vtkSetMacro(ReplacementValue,
double);
256 vtkGetMacro(ReplacementValue,
double);
262 void InvalidateFunction();
294 int Parse(ParseMode
mode);
314 VectorReturningFunction vectorReturningFunction);
319 bool CheckOldFormatOfDotProductUsage();
330 void UpdateNeededVariables();
379 static SizeModes DetermineSizeMode(
const std::string&
function);
394 vtkGetMacro(SizeMode,
int);
397 VTK_ABI_NAMESPACE_END
std::vector< double > Result
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
std::vector< std::vector< double > * > VectorVariableValues
record modification and/or execution time
std::vector< bool > ScalarVariableNeeded
std::vector< double * > ScalarVariableValues
vtkTypeBool ReplaceInvalidValues
vtkExprTkTools * ExprTkTools
vtkTimeStamp FunctionMTime
void SetVectorVariableValue(int i, double xValue, double yValue, double zValue)
Set the value of a vector variable.
void GetVectorVariableValue(int i, double value[3])
Get the value of a vector variable.
std::vector< std::string > OriginalScalarVariableNames
std::string FunctionWithUsedVariableNames
a simple class to control print indentation
std::vector< std::string > UsedVectorVariableNames
std::vector< std::string > OriginalVectorVariableNames
void SetVectorVariableValue(const std::string &variableName, double xValue, double yValue, double zValue)
Set the value of a vector variable.
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.
std::vector< double > ParserErrorResult
Parse and evaluate a mathematical expression.
const char * GetFunction()
Set/Get input string to evaluate.