Hi Clement,
This is rather easy to do. All you need is to define a NodeVisitor and run it
on the group. Using this way you only need to have an accept call for the Geode
and process the drawables under the Geode.
Code:
class InfoVisitor : public osg::NodeVisitor
{
public:
InfoVisitor()
{
setTraversalMode( osg::NodeVisitor::TRAVERSE_ALL_CHILDREN );
}
void apply( osg::Geode& geode )
{
for ( unsigned int i=0; i<geode.getNumDrawables(); ++i )
{
// Do what you have to do, for example store in a data structure
}
}
};
....
osg::Group * yourGroup = ...;
InfoVisitor visitor;
yourGroup->accept(visitor);
// After it completes you can retrieve your data structure.
Hope this helps.
------------------------
Tony V
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=66628#66628
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org