1 #include "OSGFileIOUtils.h"
3 #include "OSGNameAttachment.h"
4 #include <boost/bind.hpp>
8 // ------------------------------------------------
10 FileIONodeFinder::FileIONodeFinder(void)
14 void FileIONodeFinder::traverse(NodeUnrecPtr root
)
16 _FoundJoints
.clear();
17 _FoundNamedJoints
.clear();
18 _FoundNamedNodes
.clear();
21 OSG::traverse(root
, boost::bind(&FileIONodeFinder::check
,
25 Action::ResultE
FileIONodeFinder::check(Node
* &node
)
27 if(OSG::getName(node
) && OSG::getName(node
) == _SearchName
)
29 _FoundNamedNodes
.push_back(node
);
32 return Action::Continue
;
35 const std::vector
<Node
*> &FileIONodeFinder::getFoundNodes(void) const
40 const std::vector
<Node
*> &FileIONodeFinder::getFoundNamedNodes(void) const
42 return _FoundNamedNodes
;
45 const std::vector
<Node
*> &FileIONodeFinder::getFoundJoints(void) const
50 const std::vector
<Node
*> &FileIONodeFinder::getFoundNamedJoints(void) const
52 return _FoundNamedJoints
;
54 void FileIONodeFinder::setSearchName(std::string nodeName
)
56 _SearchName
= nodeName
;