update on design of scenegraph
This commit is contained in:
parent
f7043fc0cb
commit
62b2302a32
18 changed files with 342 additions and 136 deletions
|
@ -23,6 +23,20 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
|
||||
void print_node_path(pw::node::ref node) {
|
||||
|
||||
auto parents = node->path();
|
||||
|
||||
std::cout << node->name() << " - ";
|
||||
for (auto p : node->path()) {
|
||||
std::cout << " p:'" << p->name() << "'";
|
||||
}
|
||||
|
||||
std::cout << std::endl;
|
||||
|
||||
}
|
||||
int main(int argc,char **argv) {
|
||||
|
||||
using namespace pw;
|
||||
|
@ -32,15 +46,19 @@ int main(int argc,char **argv) {
|
|||
|
||||
node::ref sub_2_1 = std::make_shared<node>("sub-2-1");
|
||||
|
||||
root->add_child(std::make_shared<node>("sub-2"))->add_child(std::make_shared<node>("sub-2-1"));
|
||||
root->add_child(std::make_shared<node>("sub-3"))->add_child(sub_2_1);
|
||||
root->add_child(std::make_shared<node>("sub-2"))->add_child(std::make_shared<node>("sub-2-2"));
|
||||
|
||||
std::cout << "sub-2-1 parent count: " << sub_2_1->parents().size() << std::endl;
|
||||
// std::cout << "sub-2-1 parent count: " << sub_2_1->parents().size() << std::endl;
|
||||
|
||||
|
||||
traverser tv;
|
||||
// traverser tv;
|
||||
// tv.bfs(root);
|
||||
|
||||
|
||||
// print_node_path(sub_2_1);
|
||||
// print_node_path(root->children()[2]->children().front());
|
||||
|
||||
tv.bfs(root);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue