VTK
|
Parse and evaluate a mathematical expression. More...
#include <vtkFunctionParser.h>
Public Types | |
typedef vtkObject | Superclass |
Public Types inherited from vtkObject | |
typedef vtkObjectBase | Superclass |
Public Member Functions | |
virtual int | IsA (const char *type) |
vtkFunctionParser * | NewInstance () const |
void | PrintSelf (ostream &os, vtkIndent indent) |
unsigned long int | GetMTime () |
int | IsScalarResult () |
int | IsVectorResult () |
double | GetScalarResult () |
char * | GetScalarVariableName (int i) |
char * | GetVectorVariableName (int i) |
void | RemoveAllVariables () |
void | RemoveScalarVariables () |
void | RemoveVectorVariables () |
void | CheckExpression (int &pos, char **error) |
void | InvalidateFunction () |
void | SetFunction (const char *function) |
virtual char * | GetFunction () |
double * | GetVectorResult () |
void | GetVectorResult (double result[3]) |
void | SetScalarVariableValue (const char *variableName, double value) |
void | SetScalarVariableValue (int i, double value) |
double | GetScalarVariableValue (const char *variableName) |
double | GetScalarVariableValue (int i) |
void | SetVectorVariableValue (const char *variableName, double xValue, double yValue, double zValue) |
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) |
void | GetVectorVariableValue (const char *variableName, double value[3]) |
double * | GetVectorVariableValue (int i) |
void | GetVectorVariableValue (int i, double value[3]) |
virtual int | GetNumberOfScalarVariables () |
virtual int | GetNumberOfVectorVariables () |
virtual void | SetReplaceInvalidValues (int) |
virtual int | GetReplaceInvalidValues () |
virtual void | ReplaceInvalidValuesOn () |
virtual void | ReplaceInvalidValuesOff () |
virtual void | SetReplacementValue (double) |
virtual double | GetReplacementValue () |
Public Member Functions inherited from vtkObject | |
vtkObject * | NewInstance () const |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
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) |
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) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
Static Public Member Functions | |
static vtkFunctionParser * | New () |
static int | IsTypeOf (const char *type) |
static vtkFunctionParser * | SafeDownCast (vtkObjectBase *o) |
Static Public Member Functions inherited from vtkObject | |
static int | IsTypeOf (const char *type) |
static vtkObject * | SafeDownCast (vtkObjectBase *o) |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
Static Public Member Functions inherited from vtkObjectBase | |
static int | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
Protected Attributes | |
char * | Function |
char * | FunctionWithSpaces |
int | FunctionLength |
int | NumberOfScalarVariables |
int | NumberOfVectorVariables |
char ** | ScalarVariableNames |
char ** | VectorVariableNames |
double * | ScalarVariableValues |
double ** | VectorVariableValues |
unsigned char * | ByteCode |
int | ByteCodeSize |
double * | Immediates |
int | ImmediatesSize |
double * | Stack |
int | StackSize |
int | StackPointer |
vtkTimeStamp | FunctionMTime |
vtkTimeStamp | ParseMTime |
vtkTimeStamp | VariableMTime |
vtkTimeStamp | EvaluateMTime |
vtkTimeStamp | CheckMTime |
int | ReplaceInvalidValues |
double | ReplacementValue |
int | ParseErrorPositon |
char * | ParseError |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
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)
Definition at line 130 of file vtkFunctionParser.h.
Definition at line 134 of file vtkFunctionParser.h.
|
protected |
|
protected |
|
static |
|
static |
|
virtual |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkObject.
|
static |
|
protectedvirtual |
Reimplemented from vtkObject.
vtkFunctionParser* vtkFunctionParser::NewInstance | ( | ) | const |
|
virtual |
|
virtual |
Return parser's MTime
Reimplemented from vtkObject.
void vtkFunctionParser::SetFunction | ( | const char * | function | ) |
Set/Get input string to evaluate.
|
virtual |
Set/Get input string to evaluate.
int vtkFunctionParser::IsScalarResult | ( | ) |
Check whether the result is a scalar result. If it isn't, then either the result is a vector or an error has occurred.
int vtkFunctionParser::IsVectorResult | ( | ) |
Check whether the result is a vector result. If it isn't, then either the result is scalar or an error has occurred.
double vtkFunctionParser::GetScalarResult | ( | ) |
Get a scalar result from evaluating the input function.
double* vtkFunctionParser::GetVectorResult | ( | ) |
Get a vector result from evaluating the input function.
|
inline |
Get a vector result from evaluating the input function.
Definition at line 160 of file vtkFunctionParser.h.
void vtkFunctionParser::SetScalarVariableValue | ( | const char * | variableName, |
double | value | ||
) |
Set the value of a scalar variable. If a variable with this name exists, then its value will be set to the new value. If there is not already a variable with this name, variableName will be added to the list of variables, and its value will be set to the new value.
Set the value of a scalar variable. If a variable with this name exists, then its value will be set to the new value. If there is not already a variable with this name, variableName will be added to the list of variables, and its value will be set to the new value.
double vtkFunctionParser::GetScalarVariableValue | ( | const char * | variableName | ) |
Get the value of a scalar variable.
void vtkFunctionParser::SetVectorVariableValue | ( | const char * | variableName, |
double | xValue, | ||
double | yValue, | ||
double | zValue | ||
) |
Set the value of a vector variable. If a variable with this name exists, then its value will be set to the new value. If there is not already a variable with this name, variableName will be added to the list of variables, and its value will be set to the new value.
|
inline |
Set the value of a vector variable. If a variable with this name exists, then its value will be set to the new value. If there is not already a variable with this name, variableName will be added to the list of variables, and its value will be set to the new value.
Definition at line 187 of file vtkFunctionParser.h.
void vtkFunctionParser::SetVectorVariableValue | ( | int | i, |
double | xValue, | ||
double | yValue, | ||
double | zValue | ||
) |
Set the value of a vector variable. If a variable with this name exists, then its value will be set to the new value. If there is not already a variable with this name, variableName will be added to the list of variables, and its value will be set to the new value.
Set the value of a vector variable. If a variable with this name exists, then its value will be set to the new value. If there is not already a variable with this name, variableName will be added to the list of variables, and its value will be set to the new value.
Definition at line 192 of file vtkFunctionParser.h.
double* vtkFunctionParser::GetVectorVariableValue | ( | const char * | variableName | ) |
Get the value of a vector variable.
|
inline |
Get the value of a vector variable.
Definition at line 199 of file vtkFunctionParser.h.
Get the value of a vector variable.
Definition at line 203 of file vtkFunctionParser.h.
|
virtual |
Get the number of scalar variables.
|
virtual |
Get the number of vector variables.
char* vtkFunctionParser::GetScalarVariableName | ( | int | i | ) |
Get the ith scalar variable name.
char* vtkFunctionParser::GetVectorVariableName | ( | int | i | ) |
Get the ith vector variable name.
void vtkFunctionParser::RemoveAllVariables | ( | ) |
Remove all the current variables.
void vtkFunctionParser::RemoveScalarVariables | ( | ) |
Remove all the scalar variables.
void vtkFunctionParser::RemoveVectorVariables | ( | ) |
Remove all the vector variables.
|
virtual |
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. Otherwise an error will be reported
|
virtual |
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. Otherwise an error will be reported
|
virtual |
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. Otherwise an error will be reported
|
virtual |
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. Otherwise an error will be reported
|
virtual |
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. Otherwise an error will be reported
|
virtual |
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. Otherwise an error will be reported
void vtkFunctionParser::CheckExpression | ( | int & | pos, |
char ** | error | ||
) |
Check the validity of the function expression.
void vtkFunctionParser::InvalidateFunction | ( | ) |
Allow the user to force the function to be re-parsed
|
protected |
|
protected |
Evaluate the function, returning true on success, false on failure.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedvirtual |
|
protected |
Definition at line 294 of file vtkFunctionParser.h.
|
protected |
Definition at line 295 of file vtkFunctionParser.h.
|
protected |
Definition at line 297 of file vtkFunctionParser.h.
|
protected |
Definition at line 298 of file vtkFunctionParser.h.
|
protected |
Definition at line 299 of file vtkFunctionParser.h.
|
protected |
Definition at line 300 of file vtkFunctionParser.h.
|
protected |
Definition at line 301 of file vtkFunctionParser.h.
|
protected |
Definition at line 302 of file vtkFunctionParser.h.
|
protected |
Definition at line 303 of file vtkFunctionParser.h.
|
protected |
Definition at line 304 of file vtkFunctionParser.h.
|
protected |
Definition at line 305 of file vtkFunctionParser.h.
|
protected |
Definition at line 306 of file vtkFunctionParser.h.
|
protected |
Definition at line 307 of file vtkFunctionParser.h.
|
protected |
Definition at line 308 of file vtkFunctionParser.h.
|
protected |
Definition at line 309 of file vtkFunctionParser.h.
|
protected |
Definition at line 310 of file vtkFunctionParser.h.
|
protected |
Definition at line 312 of file vtkFunctionParser.h.
|
protected |
Definition at line 313 of file vtkFunctionParser.h.
|
protected |
Definition at line 314 of file vtkFunctionParser.h.
|
protected |
Definition at line 315 of file vtkFunctionParser.h.
|
protected |
Definition at line 316 of file vtkFunctionParser.h.
|
protected |
Definition at line 318 of file vtkFunctionParser.h.
|
protected |
Definition at line 319 of file vtkFunctionParser.h.
|
protected |
Definition at line 321 of file vtkFunctionParser.h.
|
protected |
Definition at line 322 of file vtkFunctionParser.h.