![]() |
VR-Forces 5.0.1 Developer's Guide
|
Visitor that matches regular expressions against scene graph node data.

Classes | |
| struct | ExpressionNodeData |
Public Types | |
| typedef std::vector < ExpressionNodeData > | NodeVector |
| typedef std::vector< boost::regex > | RegexVector |
Public Member Functions | |
| DtRegularExpressionVisitor (bool isRegEx=true) | |
| DtRegularExpressionVisitor (const std::string &searchExpression, bool isRegEx=true) | |
| DtRegularExpressionVisitor (const std::vector< std::string > &searchExpressions, bool isRegEx=true) | |
| virtual | ~DtRegularExpressionVisitor () |
| void | setSearchNames (bool flag) |
| void | setSearchDescriptions (bool flag) |
| void | setSearchFilenames (bool flag) |
| virtual void | apply (osg::ProxyNode &searchNode) |
| virtual void | apply (osg::Node &searchNode) |
| virtual void | setExpressionToFind (const std::string &searchExpression) |
| virtual NodeVector & | nodeVector () |
| virtual void | setCutTraversal (bool b) |
| virtual void | reset () |
Protected Member Functions | |
| virtual bool | regexSearchAndAdd (const std::string &target, osg::Node *node) |
| virtual bool | searchNames (osg::Node *node) |
| virtual bool | searchDescriptions (osg::Node *node) |
| virtual bool | searchFilenames (osg::ProxyNode *proxyNode) |
Protected Attributes | |
| std::vector< std::string > | mySearchForStrings |
| std::string | myOriginalCacheFileString |
| std::string | myOriginalFileString |
| RegexVector | mySearchForRegularExpressions |
| bool | myExpressionIsRegEx |
| NodeVector | myFoundNodeVector |
| bool | cutTraversal |
| bool | mySearchNames |
| bool | mySearchDescriptions |
| bool | mySearchFilenames |
| typedef std::vector< ExpressionNodeData > makVrv::DtRegularExpressionVisitor::NodeVector |
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.
| typedef std::vector<boost::regex> makVrv::DtRegularExpressionVisitor::RegexVector |
typdef a vector of regex for convenience
| 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 |
DTOR.
| 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 |
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 |
Compare the 'mySearchForRegularExpressions' data member against the node's name and description list (depending on the values of member control variables).
|
virtual |
Set the mySearchForRegularExpressions to user-defined string.
|
virtual |
return a reference to the ProxyNodeVector of Groups we found. Nodes are returned in the order they are found.
|
virtual |
Set value of cutTraversal.
|
virtual |
Reset the visitor; Must be called after a traversal if the visitor will be used more than once.
|
protectedvirtual |
Test the target against mySearchForRegularExpressions.
|
protectedvirtual |
Search the node's name(s) for the target expressions.
|
protectedvirtual |
Search the node's description(s) for the target expressions.
|
protectedvirtual |
Search the proxy node's filename(s) for the target expressions.
|
protected |
|
protected |
|
protected |
|
protected |
the names we are looking for
|
protected |
|
protected |
Vector of nodes with names that match the searchForName string.
|
protected |
Switch to make traversal stop after one node is matched.
|
protected |
|
protected |
|
protected |