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.
This commit is contained in:
parent
91d22f7d23
commit
6dbc770347
@ -19,7 +19,6 @@
|
||||
|
||||
namespace osgGA{
|
||||
|
||||
|
||||
/**
|
||||
Pure virtual base class for adapting platform specific events into
|
||||
generic keyboard and mouse events.
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include <osg/Referenced>
|
||||
#include <osg/Object>
|
||||
#include <osg/ApplicationUsage>
|
||||
|
||||
#include <osgGA/Export>
|
||||
@ -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 {}
|
||||
|
@ -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 )
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user