|
virtual int | IsA (const char *type) |
| Return 1 if this class is the same type of (or a subclass of) the named class. More...
|
|
vtkFunctionParser * | NewInstance () const |
|
void | PrintSelf (ostream &os, vtkIndent indent) override |
| Methods invoked by print to print information about the object including superclasses. More...
|
|
vtkMTimeType | GetMTime () override |
| Return parser's MTime. More...
|
|
void | SetFunction (const char *function) |
| Set/Get input string to evaluate. More...
|
|
virtual char * | GetFunction () |
|
int | IsScalarResult () |
| Check whether the result is a scalar result. More...
|
|
int | IsVectorResult () |
| Check whether the result is a vector result. More...
|
|
double | GetScalarResult () |
| Get a scalar result from evaluating the input function. More...
|
|
double * | GetVectorResult () |
| Get a vector result from evaluating the input function. More...
|
|
void | GetVectorResult (double result[3]) |
|
void | SetScalarVariableValue (const char *variableName, double value) |
| Set the value of a scalar variable. More...
|
|
void | SetScalarVariableValue (int i, double value) |
|
double | GetScalarVariableValue (const char *variableName) |
| Get the value of a scalar variable. More...
|
|
double | GetScalarVariableValue (int i) |
|
void | SetVectorVariableValue (const char *variableName, double xValue, double yValue, double zValue) |
| Set the value of a vector variable. More...
|
|
void | SetVectorVariableValue (const char *variableName, const double values[3]) |
|
void | SetVectorVariableValue (int i, double xValue, double yValue, double zValue) |
|
void | SetVectorVariableValue (int i, const double values[3]) |
|
double * | GetVectorVariableValue (const char *variableName) |
| Get the value of a vector variable. More...
|
|
void | GetVectorVariableValue (const char *variableName, double value[3]) |
|
double * | GetVectorVariableValue (int i) |
|
void | GetVectorVariableValue (int i, double value[3]) |
|
int | GetNumberOfScalarVariables () |
| Get the number of scalar variables. More...
|
|
int | GetNumberOfVectorVariables () |
| Get the number of vector variables. More...
|
|
const char * | GetScalarVariableName (int i) |
| Get the ith scalar variable name. More...
|
|
const char * | GetVectorVariableName (int i) |
| Get the ith vector variable name. More...
|
|
bool | GetScalarVariableNeeded (int i) |
| Returns whether a scalar variable is needed for the function evaluation. More...
|
|
bool | GetScalarVariableNeeded (const char *variableName) |
|
bool | GetVectorVariableNeeded (int i) |
| Returns whether a vector variable is needed for the function evaluation. More...
|
|
bool | GetVectorVariableNeeded (const char *variableName) |
|
void | RemoveAllVariables () |
| Remove all the current variables. More...
|
|
void | RemoveScalarVariables () |
| Remove all the scalar variables. More...
|
|
void | RemoveVectorVariables () |
| Remove all the vector variables. More...
|
|
virtual void | SetReplaceInvalidValues (int) |
| When ReplaceInvalidValues is on, all invalid values (such as sqrt(-2), note that function parser does not handle complex numbers) will be replaced by ReplacementValue. More...
|
|
virtual int | GetReplaceInvalidValues () |
|
virtual void | ReplaceInvalidValuesOn () |
|
virtual void | ReplaceInvalidValuesOff () |
|
virtual void | SetReplacementValue (double) |
|
virtual double | GetReplacementValue () |
|
void | CheckExpression (int &pos, char **error) |
| Check the validity of the function expression. More...
|
|
void | InvalidateFunction () |
| Allow the user to force the function to be re-parsed. More...
|
|
| vtkBaseTypeMacro (vtkObject, vtkObjectBase) |
|
virtual void | DebugOn () |
| Turn debugging output on. More...
|
|
virtual void | DebugOff () |
| Turn debugging output off. More...
|
|
bool | GetDebug () |
| Get the value of the debug flag. More...
|
|
void | SetDebug (bool debugFlag) |
| Set the value of the debug flag. More...
|
|
virtual void | Modified () |
| Update the modification time for this object. More...
|
|
virtual vtkMTimeType | GetMTime () |
| Return this object's modified time. More...
|
|
void | PrintSelf (ostream &os, vtkIndent indent) override |
| Methods invoked by print to print information about the object including superclasses. More...
|
|
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
| Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
|
|
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
|
vtkCommand * | GetCommand (unsigned long tag) |
|
void | RemoveObserver (vtkCommand *) |
|
void | RemoveObservers (unsigned long event, vtkCommand *) |
|
void | RemoveObservers (const char *event, vtkCommand *) |
|
int | HasObserver (unsigned long event, vtkCommand *) |
|
int | HasObserver (const char *event, vtkCommand *) |
|
void | RemoveObserver (unsigned long tag) |
|
void | RemoveObservers (unsigned long event) |
|
void | RemoveObservers (const char *event) |
|
void | RemoveAllObservers () |
|
int | HasObserver (unsigned long event) |
|
int | HasObserver (const char *event) |
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
| Overloads to AddObserver that allow developers to add class member functions as callbacks for events. More...
|
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
|
template<class U , class T > |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
| Allow user to set the AbortFlagOn() with the return value of the callback method. More...
|
|
int | InvokeEvent (unsigned long event, void *callData) |
| This method invokes an event and return whether the event was aborted or not. More...
|
|
int | InvokeEvent (const char *event, void *callData) |
|
int | InvokeEvent (unsigned long event) |
|
int | InvokeEvent (const char *event) |
|
const char * | GetClassName () const |
| Return the class name as a string. More...
|
|
virtual vtkTypeBool | IsA (const char *name) |
| Return 1 if this class is the same type of (or a subclass of) the named class. More...
|
|
virtual void | Delete () |
| Delete a VTK object. More...
|
|
virtual void | FastDelete () |
| Delete a reference to this object. More...
|
|
void | InitializeObjectBase () |
|
void | Print (ostream &os) |
| Print an object to an ostream. More...
|
|
virtual void | PrintSelf (ostream &os, vtkIndent indent) |
| Methods invoked by print to print information about the object including superclasses. More...
|
|
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
|
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
|
virtual void | Register (vtkObjectBase *o) |
| Increase the reference count (mark as used by another object). More...
|
|
virtual void | UnRegister (vtkObjectBase *o) |
| Decrease the reference count (release by another object). More...
|
|
int | GetReferenceCount () |
| Return the current reference count of this object. More...
|
|
void | SetReferenceCount (int) |
| Sets the reference count. More...
|
|
void | PrintRevisions (ostream &) |
| Legacy. More...
|
|
|
virtual vtkObjectBase * | NewInstanceInternal () const |
|
| vtkFunctionParser () |
|
| ~vtkFunctionParser () override |
|
int | Parse () |
|
bool | Evaluate () |
| Evaluate the function, returning true on success, false on failure. More...
|
|
int | CheckSyntax () |
|
void | CopyParseError (int &position, char **error) |
|
void | RemoveSpaces () |
|
char * | RemoveSpacesFrom (const char *variableName) |
|
int | OperatorWithinVariable (int idx) |
|
int | BuildInternalFunctionStructure () |
|
void | BuildInternalSubstringStructure (int beginIndex, int endIndex) |
|
void | AddInternalByte (unsigned char newByte) |
|
int | IsSubstringCompletelyEnclosed (int beginIndex, int endIndex) |
|
int | FindEndOfMathFunction (int beginIndex) |
|
int | FindEndOfMathConstant (int beginIndex) |
|
int | IsVariableName (int currentIndex) |
|
int | IsElementaryOperator (int op) |
|
int | GetMathFunctionNumber (int currentIndex) |
|
int | GetMathFunctionNumberByCheckingParenthesis (int currentIndex) |
|
int | GetMathFunctionStringLength (int mathFunctionNumber) |
|
int | GetMathConstantNumber (int currentIndex) |
|
int | GetMathConstantStringLength (int mathConstantNumber) |
|
unsigned char | GetElementaryOperatorNumber (char op) |
|
unsigned char | GetOperandNumber (int currentIndex) |
|
int | GetVariableNameLength (int variableNumber) |
|
int | DisambiguateOperators () |
|
void | UpdateNeededVariables () |
| Collects meta-data about which variables are needed by the current function. More...
|
|
virtual void | SetParseError (const char *) |
|
int | FindPositionInOriginalFunction (const int &pos) |
|
| vtkObject () |
|
| ~vtkObject () override |
|
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
|
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override |
|
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
| These methods allow a command to exclusively grab all events. More...
|
|
void | InternalReleaseFocus () |
|
| vtkObjectBase () |
|
virtual | ~vtkObjectBase () |
|
virtual void | CollectRevisions (ostream &) |
|
virtual void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) |
|
virtual void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) |
|
virtual void | ReportReferences (vtkGarbageCollector *) |
|
| vtkObjectBase (const vtkObjectBase &) |
|
void | operator= (const vtkObjectBase &) |
|
Parse and evaluate a mathematical expression.
vtkFunctionParser is a class that takes in a mathematical expression as a char string, parses it, and evaluates it at the specified values of the variables in the input string.
You can use the "if" operator to create conditional expressions such as if ( test, trueresult, falseresult). These evaluate the boolean valued test expression and then evaluate either the trueresult or the falseresult expression to produce a final (scalar or vector valued) value. "test" may contain <,>,=,|,&, and () and all three subexpressions can evaluate arbitrary function operators (ln, cos, +, if, etc)
- Thanks:
- Juha Nieminen (juha..nosp@m.niem.nosp@m.inen@.nosp@m.gmai.nosp@m.l.com) for relicensing this branch of the function parser code that this class is based upon under the new BSD license so that it could be used in VTK. Note, the BSD license applies to this version of the function parser only (by permission of the author), and not the original library.
- Thanks:
- Thomas Dunne (thoma.nosp@m.s.du.nosp@m.nne@i.nosp@m.wr.u.nosp@m.ni-he.nosp@m.idel.nosp@m.berg..nosp@m.de) for adding code for two-parameter-parsing and a few functions (sign, min, max).
- Thanks:
- Sid Sydoriak (sxs@l.nosp@m.anl..nosp@m.gov) for adding boolean operations and conditional expressions and for fixing a variety of bugs.
- Tests:
- vtkFunctionParser (Tests)
Definition at line 136 of file vtkFunctionParser.h.