VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
makVrv::DtRegularExpressionVisitor Class Reference

Visitor that matches regular expressions against scene graph node data.

Inheritance diagram for makVrv::DtRegularExpressionVisitor:
Inheritance graph
[legend]

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 NodeVectornodeVector ()
 
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
 

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.

typedef std::vector<boost::regex> makVrv::DtRegularExpressionVisitor::RegexVector

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

DTOR.

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:

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)