Node that calls a function. More...
#include <SeExprNode.h>
Classes | |
struct | Data |
base class for custom instance data More... | |
Public Member Functions | |
SeExprFuncNode (const SeExpression *expr, const char *name) | |
virtual | ~SeExprFuncNode () |
virtual bool | prep (bool wantVec) |
virtual void | eval (SeVec3d &result) const |
Evaluation method. Note: v[1] and v[2] are undefined if !isVec. | |
void | setIsVec (bool isVec) |
const char * | name () const |
int | nargs () const |
return the number of arguments | |
double * | scalarArgs () const |
SeVec3d * | vecArgs () const |
SeVec3d * | evalArgs () const |
eval all arguments (use in eval()) | |
SeVec3d | evalArg (int n) const |
eval an argument (use in eval()) | |
bool | isStrArg (int n) const |
returns whether the nth argument is a string (use in prep) | |
std::string | getStrArg (int n) const |
get nth string argument (use in prep) | |
void | setData (Data *data) const |
associate blind data with this node (subsequently owned by this object) | |
Data * | getData () const |
get associated blind data (returns 0 if none) | |
Private Attributes | |
std::string | _name |
const SeExprFunc * | _func |
int | _nargs |
std::vector< double > | _scalarArgs |
std::vector< SeVec3d > | _vecArgs |
Data * | _data |
Node that calls a function.
Definition at line 431 of file SeExprNode.h.
SeExprFuncNode::SeExprFuncNode | ( | const SeExpression * | expr, | |
const char * | name | |||
) | [inline] |
Definition at line 434 of file SeExprNode.h.
References SeExpression::addFunc().
virtual SeExprFuncNode::~SeExprFuncNode | ( | ) | [inline, virtual] |
Definition at line 439 of file SeExprNode.h.
References _data.
void SeExprFuncNode::eval | ( | SeVec3d & | v | ) | const [virtual] |
Evaluation method. Note: v[1] and v[2] are undefined if !isVec.
Reimplemented from SeExprNode.
Definition at line 763 of file SeExprNode.cpp.
References _func, SeExprNode::_isVec, _nargs, a, SeExprFuncX::eval(), evalArgs(), SeExprFunc::func0(), SeExprFunc::FUNC0, SeExprFunc::func1(), SeExprFunc::FUNC1, SeExprFunc::func1v(), SeExprFunc::FUNC1V, SeExprFunc::func1vv(), SeExprFunc::FUNC1VV, SeExprFunc::func2(), SeExprFunc::FUNC2, SeExprFunc::func2v(), SeExprFunc::FUNC2V, SeExprFunc::func2vv(), SeExprFunc::FUNC2VV, SeExprFunc::func3(), SeExprFunc::FUNC3, SeExprFunc::func4(), SeExprFunc::FUNC4, SeExprFunc::func5(), SeExprFunc::FUNC5, SeExprFunc::func6(), SeExprFunc::FUNC6, SeExprFunc::funcn(), SeExprFunc::FUNCN, SeExprFunc::funcnv(), SeExprFunc::FUNCNV, SeExprFunc::funcnvv(), SeExprFunc::FUNCNVV, SeExprFunc::funcx(), SeExprFunc::FUNCX, SeExprFunc::isVec(), scalarArgs(), and SeExprFunc::type().
SeVec3d SeExprFuncNode::evalArg | ( | int | n | ) | const |
eval an argument (use in eval())
Definition at line 738 of file SeExprNode.cpp.
References SeExprNode::child(), SeExprNode::eval(), and SeExprNode::isVec().
SeVec3d * SeExprFuncNode::evalArgs | ( | ) | const |
eval all arguments (use in eval())
Definition at line 725 of file SeExprNode.cpp.
References _nargs, a, SeExprNode::child(), SeExprNode::eval(), SeExprNode::isVec(), and vecArgs().
Referenced by eval().
Data* SeExprFuncNode::getData | ( | ) | const [inline] |
get associated blind data (returns 0 if none)
Definition at line 483 of file SeExprNode.h.
References _data.
Referenced by SeExpr::PrintFuncX::eval(), SeExpr::CCurveFuncX::eval(), SeExpr::CurveFuncX::eval(), and SeExpr::CachedVoronoiFunc::eval().
std::string SeExprFuncNode::getStrArg | ( | int | n | ) | const |
get nth string argument (use in prep)
Definition at line 754 of file SeExprNode.cpp.
References _nargs, and SeExprNode::child().
Referenced by SeExpr::PrintFuncX::prep().
bool SeExprFuncNode::isStrArg | ( | int | n | ) | const |
returns whether the nth argument is a string (use in prep)
Definition at line 748 of file SeExprNode.cpp.
References SeExprNode::child().
Referenced by SeExprEdExpression::DummyFuncX::prep(), and SeExpr::PrintFuncX::prep().
const char* SeExprFuncNode::name | ( | ) | const [inline] |
Definition at line 444 of file SeExprNode.h.
References _name.
int SeExprFuncNode::nargs | ( | ) | const [inline] |
return the number of arguments
Definition at line 448 of file SeExprNode.h.
References _nargs.
Referenced by SeExpr::PrintFuncX::prep(), SeExpr::CCurveFuncX::prep(), and SeExpr::CurveFuncX::prep().
bool SeExprFuncNode::prep | ( | bool | wantVec | ) | [virtual] |
Prepare the node (for parser use only). See the discussion at the start of SeExprNode.cpp for more info.
Reimplemented from SeExprNode.
Definition at line 674 of file SeExprNode.cpp.
References SeExprNode::_expr, _func, SeExprNode::_isVec, _name, _nargs, _scalarArgs, _vecArgs, SeExprNode::addError(), SeExprNode::child(), SeExprFunc::funcx(), SeExprFunc::FUNCX, SeExprFunc::hasVecArgs(), SeExprFuncX::isThreadSafe(), SeExprNode::isVec(), SeExprFunc::isVec(), SeExprFunc::lookup(), SeExprFunc::maxArgs(), SeExprNode::numChildren(), SeExprNode::prep(), SeExprFuncX::prep(), SeExpression::resolveFunc(), SeExpression::setThreadUnsafe(), and SeExprFunc::type().
double* SeExprFuncNode::scalarArgs | ( | ) | const [inline] |
void SeExprFuncNode::setData | ( | Data * | data | ) | const [inline] |
associate blind data with this node (subsequently owned by this object)
Definition at line 476 of file SeExprNode.h.
References _data.
Referenced by SeExpr::PrintFuncX::prep(), SeExpr::CCurveFuncX::prep(), SeExpr::CurveFuncX::prep(), and SeExpr::CachedVoronoiFunc::prep().
void SeExprFuncNode::setIsVec | ( | bool | isVec | ) | [inline] |
Definition at line 443 of file SeExprNode.h.
References SeExprNode::_isVec.
SeVec3d* SeExprFuncNode::vecArgs | ( | ) | const [inline] |
Data* SeExprFuncNode::_data [mutable, private] |
Definition at line 491 of file SeExprNode.h.
Referenced by getData(), setData(), and ~SeExprFuncNode().
const SeExprFunc* SeExprFuncNode::_func [private] |
Definition at line 487 of file SeExprNode.h.
std::string SeExprFuncNode::_name [private] |
Definition at line 486 of file SeExprNode.h.
int SeExprFuncNode::_nargs [private] |
Definition at line 488 of file SeExprNode.h.
Referenced by eval(), evalArgs(), getStrArg(), nargs(), and prep().
std::vector<double> SeExprFuncNode::_scalarArgs [mutable, private] |
Definition at line 489 of file SeExprNode.h.
Referenced by prep(), and scalarArgs().
std::vector<SeVec3d> SeExprFuncNode::_vecArgs [mutable, private] |
Definition at line 490 of file SeExprNode.h.