From 6dbc7703474ab75435da05b0f8eef3fe745b48a7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 24 Mar 2003 08:42:35 +0000 Subject: [PATCH] Made the osgGA::GUIEventHandler sublassed from osg::Object as a virtual inheritence to allow handler to also be used as node callbacks. Fix to UpdateVisitor to make the visitation of Drawable more consistent with the way that nodes are traversed. --- include/osgGA/GUIEventAdapter | 1 - include/osgGA/GUIEventHandler | 15 +++++++++++---- src/osgProducer/OsgCameraGroup.cpp | 2 ++ src/osgUtil/UpdateVisitor.cpp | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/include/osgGA/GUIEventAdapter b/include/osgGA/GUIEventAdapter index 25ec38be4..625842fb0 100644 --- a/include/osgGA/GUIEventAdapter +++ b/include/osgGA/GUIEventAdapter @@ -19,7 +19,6 @@ namespace osgGA{ - /** Pure virtual base class for adapting platform specific events into generic keyboard and mouse events. diff --git a/include/osgGA/GUIEventHandler b/include/osgGA/GUIEventHandler index 5362a2ab4..f2d23396e 100644 --- a/include/osgGA/GUIEventHandler +++ b/include/osgGA/GUIEventHandler @@ -17,6 +17,7 @@ #include #include +#include #include #include @@ -28,6 +29,8 @@ namespace osgGA{ class CompositeGUIEventHandler; + + /** GUIEventHandler provides a basic interface for any class which wants to handle @@ -46,11 +49,15 @@ This request is made via the GUIActionAdapter class. */ -class OSGGA_EXPORT GUIEventHandler : public osg::Referenced +class OSGGA_EXPORT GUIEventHandler : public virtual osg::Object { public: - virtual const char* className() { return "GUIEventHandler"; } + GUIEventHandler() {} + GUIEventHandler(const GUIEventHandler&,const osg::CopyOp&) {} + + META_Object(osgGA,GUIEventHandler) + /** Returns 0 if this GUIEventHandler is not a CompositeGUIEventHandler. */ virtual const CompositeGUIEventHandler* getComposite() const { return 0; } @@ -59,10 +66,10 @@ public: virtual CompositeGUIEventHandler* getComposite() { return 0; } /** Handle events, return true if handled, false otherwise. */ - virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& us)=0; + virtual bool handle(const GUIEventAdapter&,GUIActionAdapter&) { return false; } /** Accept visits from GUIEventHandler visitors */ - virtual void accept(GUIEventHandlerVisitor&) = 0; + virtual void accept(GUIEventHandlerVisitor&) {} /** Get the keyboard and mouse usage of this manipulator.*/ virtual void getUsage(osg::ApplicationUsage&) const {} diff --git a/src/osgProducer/OsgCameraGroup.cpp b/src/osgProducer/OsgCameraGroup.cpp index a3c68133f..07359d5c6 100644 --- a/src/osgProducer/OsgCameraGroup.cpp +++ b/src/osgProducer/OsgCameraGroup.cpp @@ -281,6 +281,8 @@ void OsgCameraGroup::realize( ThreadingModel thread_model) if (_ds->getStencilBuffer()) rs_vc->setStencilSize(_ds->getMinimumNumStencilBits()); if (_ds->getAlphaBuffer()) rs_vc->setAlphaSize(_ds->getMinimumNumAlphaBits()); + rs_vc->setDepthSize(24); + if (numMultiSamples) { #if defined( GLX_SAMPLES_SGIS ) diff --git a/src/osgUtil/UpdateVisitor.cpp b/src/osgUtil/UpdateVisitor.cpp index 4ff273b86..031586ee7 100644 --- a/src/osgUtil/UpdateVisitor.cpp +++ b/src/osgUtil/UpdateVisitor.cpp @@ -15,7 +15,7 @@ using namespace osg; using namespace osgUtil; -UpdateVisitor::UpdateVisitor():NodeVisitor(UPDATE_VISITOR,TRAVERSE_ACTIVE_CHILDREN) +UpdateVisitor::UpdateVisitor():NodeVisitor(UPDATE_VISITOR,TRAVERSE_ALL_CHILDREN) { }