Christian Buchner wrote on 2012-09-13: >> How would I use the object's own geometry of the object as the clickable > hot spot? > > I've been trying to implement a geode called DraggableCylinder which > inherits from the dragger. And I want this geode to also implement the > constrain() and receive() functions from osgManipulator::Constraint > and osgManipulator::DraggerCallback. > > My class declaration (inheritance) now looks like this > > class DraggableCylinder : public My2DDragger, private > osgManipulator::DraggerCallback, private osgManipulator::Constraint { }; > > Now I ran into the problem that the DraggableCylinder inherits three > ref() functions from several osg::Object base classes. Is there any > way to resolve this ambiguity easily? ;-) Like providing one > definitive overload of ref()/unref() that calls into the ref()/unref() > functions of the inherited osg::Objects... I realize that this is more > of a C++ question, but maybe someone has solved this issue previously?
This is known as the diamond problem, and can be solved by virtual inheritance (http://en.wikipedia.org/wiki/Virtual_inheritance): class DraggableCylinder: public virtual My2DDragger, private virtual osgManipulator::DraggerCallback, private virtual osgManipulator::Constraint {}; Hope this helps! -- Bryan Thrall Principal Software Engineer FlightSafety International bryan.thr...@flightsafety.com _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org