Visitor that matches regular expressions against scene graph node data.
More...
Public Types |
typedef std::vector
< ExpressionNodeData > | NodeVector |
| | typedef a vector of osg ref node pointers for convenience.
|
| typedef std::vector< boost::regex > | RegexVector |
| | typdef a vector of regex for convenience
|
Public Member Functions |
| | DtRegularExpressionVisitor (bool isRegEx=true) |
| | Default constructor.
|
| | DtRegularExpressionVisitor (const std::string &searchExpression, bool isRegEx=true) |
| | Constructor that accepts string argument.
|
| | DtRegularExpressionVisitor (const std::vector< std::string > &searchExpressions, bool isRegEx=true) |
| | Constructor that accepts string vector argument.
|
| virtual | ~DtRegularExpressionVisitor () |
| | DTOR.
|
| void | setSearchNames (bool flag) |
| | Set to true to include node names.
|
| void | setSearchDescriptions (bool flag) |
| | Set to true to include description.
|
| void | setSearchFilenames (bool flag) |
| | Set to true to include proxy node file names.
|
| virtual void | apply (osg::ProxyNode &searchNode) |
| | The 'apply' method for 'ProxyNode' type instances.
|
| virtual void | apply (osg::Node &searchNode) |
| | Compare the 'mySearchForRegularExpressions' data member against the node's name and description list (depending on the values of member control variables).
|
| virtual void | setExpressionToFind (const std::string &searchExpression) |
| | Set the mySearchForRegularExpressions to user-defined string.
|
| virtual NodeVector & | nodeVector () |
| | return a reference to the ProxyNodeVector of Groups we found.
|
| virtual void | setCutTraversal (bool b) |
| | Set value of cutTraversal.
|
| virtual void | reset () |
| | Reset the visitor; Must be called after a traversal if the visitor will be used more than once.
|
Protected Member Functions |
| virtual bool | regexSearchAndAdd (const std::string &target, osg::Node *node) |
| | Test the target against mySearchForRegularExpressions.
|
| virtual bool | searchNames (osg::Node *node) |
| | Search the node's name(s) for the target expressions.
|
| virtual bool | searchDescriptions (osg::Node *node) |
| | Search the node's description(s) for the target expressions.
|
| virtual bool | searchFilenames (osg::ProxyNode *proxyNode) |
| | Search the proxy node's filename(s) for the target expressions.
|
Detailed Description
Visitor that matches regular expressions against scene graph node data.
Member Typedef Documentation
typedef a vector of osg ref node pointers for convenience.
This way if you use this visitor to store nodes for removal, as you remove them they aren't actually deleted until the visitor is. I've had weird problems when extracting nodes and just keeping osg::node* around where removing the child causes it to be deleted but it's really some other node's parent.
typdef a vector of regex for convenience
Constructor & Destructor Documentation
| makVrv::DtRegularExpressionVisitor::DtRegularExpressionVisitor |
( |
bool |
isRegEx = true | ) |
|
Default constructor.
Initialize mySearchForRegularExpressions to "" and set the traversal mode to TRAVERSE_ALL_CHILDREN
| makVrv::DtRegularExpressionVisitor::DtRegularExpressionVisitor |
( |
const std::string & |
searchExpression, |
|
|
bool |
isRegEx = true |
|
) |
| |
Constructor that accepts string argument.
Initializes mySearchForRegularExpressions to user string set the traversal mode to TRAVERSE_ALL_CHILDREN
| makVrv::DtRegularExpressionVisitor::DtRegularExpressionVisitor |
( |
const std::vector< std::string > & |
searchExpressions, |
|
|
bool |
isRegEx = true |
|
) |
| |
Constructor that accepts string vector argument.
Initializes mySearchForRegularExpressions to user strings set the traversal mode to TRAVERSE_ALL_CHILDREN
| virtual makVrv::DtRegularExpressionVisitor::~DtRegularExpressionVisitor |
( |
| ) |
|
|
virtual |
Member Function Documentation
| void makVrv::DtRegularExpressionVisitor::setSearchNames |
( |
bool |
flag | ) |
|
Set to true to include node names.
| void makVrv::DtRegularExpressionVisitor::setSearchDescriptions |
( |
bool |
flag | ) |
|
Set to true to include description.
| void makVrv::DtRegularExpressionVisitor::setSearchFilenames |
( |
bool |
flag | ) |
|
Set to true to include proxy node file names.
| virtual void makVrv::DtRegularExpressionVisitor::apply |
( |
osg::ProxyNode & |
searchNode | ) |
|
|
virtual |
The 'apply' method for 'ProxyNode' type instances.
Compare the 'mySearchForRegularExpressions' data member against the node's name, description, and filename list (depending on the values of member control variables). If the strings match, add this node to our list
| virtual void makVrv::DtRegularExpressionVisitor::apply |
( |
osg::Node & |
searchNode | ) |
|
|
virtual |
Compare the 'mySearchForRegularExpressions' data member against the node's name and description list (depending on the values of member control variables).
| virtual void makVrv::DtRegularExpressionVisitor::setExpressionToFind |
( |
const std::string & |
searchExpression | ) |
|
|
virtual |
Set the mySearchForRegularExpressions to user-defined string.
| virtual NodeVector& makVrv::DtRegularExpressionVisitor::nodeVector |
( |
| ) |
|
|
virtual |
return a reference to the ProxyNodeVector of Groups we found.
Nodes are returned in the order they are found.
| virtual void makVrv::DtRegularExpressionVisitor::setCutTraversal |
( |
bool |
b | ) |
|
|
virtual |
Set value of cutTraversal.
| virtual void makVrv::DtRegularExpressionVisitor::reset |
( |
| ) |
|
|
virtual |
Reset the visitor; Must be called after a traversal if the visitor will be used more than once.
| virtual bool makVrv::DtRegularExpressionVisitor::regexSearchAndAdd |
( |
const std::string & |
target, |
|
|
osg::Node * |
node |
|
) |
| |
|
protectedvirtual |
Test the target against mySearchForRegularExpressions.
| virtual bool makVrv::DtRegularExpressionVisitor::searchNames |
( |
osg::Node * |
node | ) |
|
|
protectedvirtual |
Search the node's name(s) for the target expressions.
| virtual bool makVrv::DtRegularExpressionVisitor::searchDescriptions |
( |
osg::Node * |
node | ) |
|
|
protectedvirtual |
Search the node's description(s) for the target expressions.
| virtual bool makVrv::DtRegularExpressionVisitor::searchFilenames |
( |
osg::ProxyNode * |
proxyNode | ) |
|
|
protectedvirtual |
Search the proxy node's filename(s) for the target expressions.
Member Data Documentation
| std::vector<std::string> makVrv::DtRegularExpressionVisitor::mySearchForStrings |
|
protected |
| std::string makVrv::DtRegularExpressionVisitor::myOriginalCacheFileString |
|
protected |
| std::string makVrv::DtRegularExpressionVisitor::myOriginalFileString |
|
protected |
| RegexVector makVrv::DtRegularExpressionVisitor::mySearchForRegularExpressions |
|
protected |
the names we are looking for
| bool makVrv::DtRegularExpressionVisitor::myExpressionIsRegEx |
|
protected |
| NodeVector makVrv::DtRegularExpressionVisitor::myFoundNodeVector |
|
protected |
Vector of nodes with names that match the searchForName string.
| bool makVrv::DtRegularExpressionVisitor::cutTraversal |
|
protected |
Switch to make traversal stop after one node is matched.
| bool makVrv::DtRegularExpressionVisitor::mySearchNames |
|
protected |
| bool makVrv::DtRegularExpressionVisitor::mySearchDescriptions |
|
protected |
| bool makVrv::DtRegularExpressionVisitor::mySearchFilenames |
|
protected |
The documentation for this class was generated from the following file: