fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / Util / OSGFileIOUtils.cpp
blob6d72ea37f682ff2871b0ed93567293b4eb7b2aba
1 #include "OSGFileIOUtils.h"
2 #include "OSGAction.h"
3 #include "OSGNameAttachment.h"
4 #include <boost/bind.hpp>
6 OSG_BEGIN_NAMESPACE
8 // ------------------------------------------------
10 FileIONodeFinder::FileIONodeFinder(void)
14 void FileIONodeFinder::traverse(NodeUnrecPtr root)
16 _FoundJoints .clear();
17 _FoundNamedJoints.clear();
18 _FoundNamedNodes .clear();
19 _FoundNodes .clear();
21 OSG::traverse(root, boost::bind(&FileIONodeFinder::check,
22 this, _1));
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
37 return _FoundNodes;
40 const std::vector<Node *> &FileIONodeFinder::getFoundNamedNodes(void) const
42 return _FoundNamedNodes;
45 const std::vector<Node *> &FileIONodeFinder::getFoundJoints(void) const
47 return _FoundJoints;
50 const std::vector<Node *> &FileIONodeFinder::getFoundNamedJoints(void) const
52 return _FoundNamedJoints;
54 void FileIONodeFinder::setSearchName(std::string nodeName)
56 _SearchName = nodeName;
59 OSG_END_NAMESPACE