18 |
#include <utility> |
#include <utility> |
19 |
#include <algorithm> |
#include <algorithm> |
20 |
#include <GL/glew.h> |
#include <GL/glew.h> |
21 |
#include <iostream> |
|
22 |
namespace usata |
namespace usata |
23 |
{ |
{ |
24 |
|
|
43 |
{ |
{ |
44 |
return it->second; |
return it->second; |
45 |
} |
} |
46 |
|
return Object_sp(); |
47 |
//throw |
//throw |
48 |
|
//! \todo fix this! |
49 |
} |
} |
50 |
bool |
bool |
51 |
GenericNode::has_child(const std::string& n) |
GenericNode::has_child(const std::string& n) |
75 |
return; |
return; |
76 |
|
|
77 |
} |
} |
|
void |
|
|
GenericNode::add_child(const Object_sp& obj, std::string& path) |
|
|
{ |
|
|
if (path.empty()) |
|
|
{ |
|
|
add_child(obj); |
|
|
return; |
|
|
} |
|
|
std::string nname = NodePathPop(path); |
|
|
ChildV::iterator it= |
|
|
std::find_if(children.begin(), children.end(), |
|
|
boost::bind(std::equal_to<std::string>(),nname,bind(&Child::first,_1))); |
|
|
|
|
|
if (it == children.end()) |
|
|
{ |
|
|
// throw! |
|
|
} |
|
|
NodeInterface* ni = dynamic_cast<NodeInterface*>(obj.get());//it->second.get()); |
|
|
if (!ni){ }// throw something! |
|
|
ni->add_child(obj, path); |
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
78 |
|
|
79 |
void |
void |
80 |
GuiNode::create(NodeInterface*XP) |
GuiNode::create(NodeInterface*XP) |