Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages
vtkFunctionParser Class Reference
#include <vtkFunctionParser.h>
Inheritance diagram for vtkFunctionParser:
[legend]Collaboration diagram for vtkFunctionParser:
[legend]List of all members.
Detailed Description
Parse and evaluate a mathematical expression.
- Date:
-
2002/01/25 19:25:05
- Revision:
-
1.13
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.
- Created by:
-
- CVS contributions (if > 5%):
-
- Henderson, Amy (82%)
- Gobbi, David (16%)
- CVS logs (CVSweb):
-
- .
cxx
(/Common/vtkFunctionParser.cxx)
- .
h
(/Common/vtkFunctionParser.h)
Definition at line 83 of file vtkFunctionParser.h.
|
Public Types |
typedef vtkObject | Superclass |
Public Methods |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
int | IsScalarResult () |
int | IsVectorResult () |
double | GetScalarResult () |
char * | GetScalarVariableName (int i) |
char * | GetVectorVariableName (int i) |
void | RemoveAllVariables () |
|
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 () |
Static Public Methods |
vtkFunctionParser * | New () |
int | IsTypeOf (const char *type) |
vtkFunctionParser * | SafeDownCast (vtkObject *o) |
Protected Methods |
| vtkFunctionParser () |
| ~vtkFunctionParser () |
int | Parse () |
void | Evaluate () |
int | CheckSyntax () |
void | RemoveSpaces () |
int | BuildInternalFunctionStructure () |
void | BuildInternalSubstringStructure (int beginIndex, int endIndex) |
void | AddInternalByte (unsigned char newByte) |
int | IsSubstringCompletelyEnclosed (int beginIndex, int endIndex) |
int | FindEndOfMathFunction (int beginIndex) |
int | IsVariableName (int currentIndex) |
int | IsElementaryOperator (int op) |
int | GetMathFunctionNumber (int currentIndex) |
int | GetMathFunctionStringLength (int mathFunctionNumber) |
int | GetElementaryOperatorNumber (char op) |
int | GetOperandNumber (int currentIndex) |
int | GetVariableNameLength (int variableNumber) |
int | DisambiguateOperators () |
Protected Attributes |
char * | Function |
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 |
Member Typedef Documentation
typedef vtkObject vtkFunctionParser::Superclass
|
|
Constructor & Destructor Documentation
vtkFunctionParser::vtkFunctionParser |
( |
|
) |
[protected] |
|
vtkFunctionParser::~vtkFunctionParser |
( |
|
) |
[protected] |
|
Member Function Documentation
vtkFunctionParser* vtkFunctionParser::New |
( |
|
) |
[static] |
|
|
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject. |
virtual const char* vtkFunctionParser::GetClassName |
( |
|
) |
[virtual] |
|
int vtkFunctionParser::IsTypeOf |
( |
const char * |
type |
) |
[static] |
|
|
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkObject. |
virtual int vtkFunctionParser::IsA |
( |
const char * |
type |
) |
[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 vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkObject. |
vtkFunctionParser* vtkFunctionParser::SafeDownCast |
( |
vtkObject * |
o |
) |
[static] |
|
void vtkFunctionParser::PrintSelf |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
[virtual] |
|
|
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkObject. |
void vtkFunctionParser::SetFunction |
( |
const char * |
function |
) |
|
|
|
Set/Get input string to evaluate. |
virtual char* vtkFunctionParser::GetFunction |
( |
|
) |
[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. |
void vtkFunctionParser::GetVectorResult |
( |
double |
result[3] |
) |
[inline] |
|
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. |
void vtkFunctionParser::SetScalarVariableValue |
( |
int |
i, |
|
|
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. |
double vtkFunctionParser::GetScalarVariableValue |
( |
const char * |
variableName |
) |
|
|
|
Get the value of a scalar variable. |
double vtkFunctionParser::GetScalarVariableValue |
( |
int |
i |
) |
|
|
|
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. |
void vtkFunctionParser::SetVectorVariableValue |
( |
const char * |
variableName, |
|
|
const double |
values[3] |
|
) |
[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 137 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. |
void vtkFunctionParser::SetVectorVariableValue |
( |
int |
i, |
|
|
const double |
values[3] |
|
) |
[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 142 of file vtkFunctionParser.h. |
double* vtkFunctionParser::GetVectorVariableValue |
( |
const char * |
variableName |
) |
|
|
|
Get the value of a vector variable. |
void vtkFunctionParser::GetVectorVariableValue |
( |
const char * |
variableName, |
|
|
double |
value[3] |
|
) |
[inline] |
|
double* vtkFunctionParser::GetVectorVariableValue |
( |
int |
i |
) |
|
|
|
Get the value of a vector variable. |
void vtkFunctionParser::GetVectorVariableValue |
( |
int |
i, |
|
|
double |
value[3] |
|
) |
[inline] |
|
virtual int vtkFunctionParser::GetNumberOfScalarVariables |
( |
|
) |
[virtual] |
|
|
Get the number of scalar variables. |
virtual int vtkFunctionParser::GetNumberOfVectorVariables |
( |
|
) |
[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. |
int vtkFunctionParser::Parse |
( |
|
) |
[protected] |
|
void vtkFunctionParser::Evaluate |
( |
|
) |
[protected] |
|
int vtkFunctionParser::CheckSyntax |
( |
|
) |
[protected] |
|
void vtkFunctionParser::RemoveSpaces |
( |
|
) |
[protected] |
|
int vtkFunctionParser::BuildInternalFunctionStructure |
( |
|
) |
[protected] |
|
void vtkFunctionParser::BuildInternalSubstringStructure |
( |
int |
beginIndex, |
|
|
int |
endIndex |
|
) |
[protected] |
|
void vtkFunctionParser::AddInternalByte |
( |
unsigned char |
newByte |
) |
[protected] |
|
int vtkFunctionParser::IsSubstringCompletelyEnclosed |
( |
int |
beginIndex, |
|
|
int |
endIndex |
|
) |
[protected] |
|
int vtkFunctionParser::FindEndOfMathFunction |
( |
int |
beginIndex |
) |
[protected] |
|
int vtkFunctionParser::IsVariableName |
( |
int |
currentIndex |
) |
[protected] |
|
int vtkFunctionParser::IsElementaryOperator |
( |
int |
op |
) |
[protected] |
|
int vtkFunctionParser::GetMathFunctionNumber |
( |
int |
currentIndex |
) |
[protected] |
|
int vtkFunctionParser::GetMathFunctionStringLength |
( |
int |
mathFunctionNumber |
) |
[protected] |
|
int vtkFunctionParser::GetElementaryOperatorNumber |
( |
char |
op |
) |
[protected] |
|
int vtkFunctionParser::GetOperandNumber |
( |
int |
currentIndex |
) |
[protected] |
|
int vtkFunctionParser::GetVariableNameLength |
( |
int |
variableNumber |
) |
[protected] |
|
int vtkFunctionParser::DisambiguateOperators |
( |
|
) |
[protected] |
|
Member Data Documentation
char* vtkFunctionParser::Function [protected]
|
|
int vtkFunctionParser::FunctionLength [protected]
|
|
int vtkFunctionParser::NumberOfScalarVariables [protected]
|
|
int vtkFunctionParser::NumberOfVectorVariables [protected]
|
|
char** vtkFunctionParser::ScalarVariableNames [protected]
|
|
char** vtkFunctionParser::VectorVariableNames [protected]
|
|
double* vtkFunctionParser::ScalarVariableValues [protected]
|
|
double** vtkFunctionParser::VectorVariableValues [protected]
|
|
unsigned char* vtkFunctionParser::ByteCode [protected]
|
|
int vtkFunctionParser::ByteCodeSize [protected]
|
|
double* vtkFunctionParser::Immediates [protected]
|
|
int vtkFunctionParser::ImmediatesSize [protected]
|
|
double* vtkFunctionParser::Stack [protected]
|
|
int vtkFunctionParser::StackSize [protected]
|
|
int vtkFunctionParser::StackPointer [protected]
|
|
The documentation for this class was generated from the following file: