Re: [osg-users] Noob question: how to change osg::Group to osg::Switch

2010-06-17 Thread Roman Grigoriev
Hi, OSG is very powerful toolkit so I wirte simple nodevisitor class ReplaceGrouptoSwitchVisitor: public osg::NodeVisitor { public: ReplaceGrouptoSwitchVisitor(const std::string& name) : osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), _name(name) { }

Re: [osg-users] Noob question: how to change osg::Group to osg::Switch

2010-06-17 Thread Trajce (Nick) Nikolov
have a look at osg::Group::replaceChild. Get the parents list from the group you want to replace and call parent->replaceChild(group,switch) -Nick On Thu, Jun 17, 2010 at 2:11 PM, Vincent Bourdier < vincent.bourd...@gmail.com> wrote: > Hi, > > You just have to create a new Switch, attach the ge

Re: [osg-users] Noob question: how to change osg::Group to osg::Switch

2010-06-17 Thread Vincent Bourdier
Hi, You just have to create a new Switch, attach the geodes to it, and get the parent of the group to attach the switch and remove the group. Next just check that the geode only have one parent, but I think this would be enought Regards, Vincent. Le 17/06/2010 12:58, Roman Grigoriev a éc

[osg-users] Noob question: how to change osg::Group to osg::Switch

2010-06-17 Thread Roman Grigoriev
Hi, Sorry for noob question but maybe there is example how to change this scenegraph group -| |-geode |-geode to switch-| |-geode |-geode ... Thank you! Cheers, Roman -- Read this topic online here: http://forum.openscenegraph.org/viewt