Mercurial > hg > Members > kono > Cerium
changeset 1046:8c75060eb153
print_scenegraph
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 08 Dec 2010 02:41:36 +0900 |
parents | ab1378fc4f72 |
children | 6a80ca9a65d9 |
files | Renderer/Engine/SceneGraphRoot.cc |
diffstat | 1 files changed, 31 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/SceneGraphRoot.cc Wed Dec 08 00:39:28 2010 +0900 +++ b/Renderer/Engine/SceneGraphRoot.cc Wed Dec 08 02:41:36 2010 +0900 @@ -496,6 +496,37 @@ return sg_exec_tree; } + +void +printSceneGraph(SceneGraphPtr t) +{ + while (t) { + if (!t->isRemoved()) { + if (t->name) printf("name: %s ",t->name); + printf("x=%g y=%g z=%g\n",t->xyz[0],t->xyz[1],t->xyz[2]); + } + if (t->children != NULL) { + t = t->children; + } else if (t->brother != NULL) { + t = t->brother; + } else { + while (t) { + if (t->brother != NULL) { + t = t->brother; + break; + } else { + if (t->parent == NULL) { + t = NULL; + break; + } else { + t = t->parent; + } + } + } + } + } +} + SceneGraphPtr SceneGraphRoot::getDrawSceneGraph() {