Hi,

I have a class called A that inherits osgGA::GUIEventHandler and osg::Switch. I 
passed in the viewer from the main class to class A through class A's 
constructor. 

In class A's constructor, i add the eventhandler to itself through the viewer. 

The problem occurs when i try to remove the children through the main class.

What should be the proper way to do it?

class A : public osg::Switch, osgGA::GUIEventHandler
{
  A (osgViewer::Viewer * viewer)
  {
     viewer->addEventHandler(this)
  }
}

class MAIN
{
  osgViewer viewer * viewer = new osgViewer();
  A a = new A(viewer);
  osg::Group * mainGroup = new osg::Group();
  mainGroup->addChild(a);
  viewer->setSceneData(mainGroup);
  
  mainGroup->removeChild(0, mainGroup->getNumChild()-1);
}

Thank you!

Cheers,
James

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=16450#16450





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to