Removed osgGA::GUIEventHandlerVisitor and osgGA::SetSceneVistor classes/headers as
this classes weren't being actively used the distribution, effectively being noops.
This commit is contained in:
@@ -23,14 +23,12 @@
|
||||
#include <osgGA/Export>
|
||||
#include <osgGA/GUIEventAdapter>
|
||||
#include <osgGA/GUIActionAdapter>
|
||||
#include <osgGA/GUIEventHandlerVisitor>
|
||||
|
||||
|
||||
// #define COMPILE_COMPOSITE_EVENTHANDLER
|
||||
|
||||
namespace osgGA{
|
||||
|
||||
class CompositeGUIEventHandler;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
GUIEventHandler provides a basic interface for any class which wants to handle
|
||||
@@ -64,91 +62,25 @@ public:
|
||||
/** Event traversal drawable callback method.*/
|
||||
virtual void event(osg::NodeVisitor* nv, osg::Drawable* drawable);
|
||||
|
||||
|
||||
/** Returns 0 if this GUIEventHandler is not a CompositeGUIEventHandler. */
|
||||
virtual const CompositeGUIEventHandler* getComposite() const { return 0; }
|
||||
|
||||
/** Returns 0 if this GUIEventHandler is not a CompositeGUIEventHandler. */
|
||||
virtual CompositeGUIEventHandler* getComposite() { return 0; }
|
||||
|
||||
/** Handle events, return true if handled, false otherwise. */
|
||||
virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& aa, osg::Object*, osg::NodeVisitor*) { return handle(ea,aa); }
|
||||
|
||||
/** deprecated, Handle events, return true if handled, false otherwise. */
|
||||
virtual bool handle(const GUIEventAdapter&,GUIActionAdapter&) { return false; }
|
||||
|
||||
/** Accept visits from GUIEventHandler visitors */
|
||||
virtual void accept(GUIEventHandlerVisitor&) {}
|
||||
|
||||
/** Get the keyboard and mouse usage of this manipulator.*/
|
||||
virtual void getUsage(osg::ApplicationUsage&) const {}
|
||||
};
|
||||
|
||||
#ifdef USE_DEPRECATED_API
|
||||
// keep for backwards compatibility
|
||||
class GUIEventHandlerVisitor
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
CompositeGUIEventHandler allows GUIEventHandlers to be composed into hierarchies.
|
||||
*/
|
||||
|
||||
class OSGGA_EXPORT CompositeGUIEventHandler : public GUIEventHandler
|
||||
{
|
||||
public:
|
||||
|
||||
typedef std::vector< osg::ref_ptr<GUIEventHandler> > ChildList;
|
||||
|
||||
virtual const char* className() const { return "CompositeGUIEventHandler"; }
|
||||
|
||||
virtual const CompositeGUIEventHandler* getComposite() const { return this; }
|
||||
|
||||
virtual CompositeGUIEventHandler* getComposite() { return this; }
|
||||
|
||||
virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& aa, osg::Object* object, osg::NodeVisitor* nv);
|
||||
|
||||
virtual void accept(GUIEventHandlerVisitor& v) { v.visit(*this); }
|
||||
|
||||
/** Get the keyboard and mouse usage of this manipulator.*/
|
||||
virtual void getUsage(osg::ApplicationUsage& usage) const;
|
||||
|
||||
|
||||
// Composite-specific methods below
|
||||
|
||||
virtual bool addChild(GUIEventHandler *geh);
|
||||
|
||||
virtual bool removeChild(GUIEventHandler *geh);
|
||||
|
||||
unsigned int getNumChildren() const { return _children.size(); }
|
||||
|
||||
GUIEventHandler *getChild( unsigned int i) { return _children[i].get(); }
|
||||
|
||||
const GUIEventHandler *getChild( unsigned int i ) const { return _children[i].get(); }
|
||||
|
||||
bool containsNode( const GUIEventHandler* node ) const
|
||||
{
|
||||
for (ChildList::const_iterator itr=_children.begin();
|
||||
itr!=_children.end();
|
||||
++itr)
|
||||
{
|
||||
if (itr->get()==node) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ChildList::iterator findChild( const GUIEventHandler* node )
|
||||
{
|
||||
for (ChildList::iterator itr=_children.begin();
|
||||
itr!=_children.end();
|
||||
++itr)
|
||||
{
|
||||
if (itr->get()==node) return itr;
|
||||
}
|
||||
return _children.end();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
ChildList _children;
|
||||
|
||||
};
|
||||
|
||||
void visit(GUIEventHandler&) {}
|
||||
};
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,70 +0,0 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
#ifndef OSGGA_GUIEVENTHANDLERVISITOR
|
||||
#define OSGGA_GUIEVENTHANDLERVISITOR 1
|
||||
|
||||
#include <osgGA/Export>
|
||||
#include <osgGA/GUIEventAdapter>
|
||||
#include <osg/ref_ptr>
|
||||
|
||||
namespace osgGA{
|
||||
|
||||
// Some forward declarations
|
||||
class GUIActionAdapter;
|
||||
class GUIEventHandler;
|
||||
class CompositeGUIEventHandler;
|
||||
class MatrixManipulator;
|
||||
class StateSetManipulator;
|
||||
|
||||
/**
|
||||
Base class for visiting GUIEventHandlers.
|
||||
|
||||
A Default Visitor, (Might want to make it an Extrinsic Visitor at some point).
|
||||
By default, it does nothing to the things it visits. Sub classes of this Visitor
|
||||
need only override visit operations for the types of object they're interested in.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
class OSGGA_EXPORT GUIEventHandlerVisitor
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void visit(GUIEventHandler&) {}
|
||||
virtual void visit(CompositeGUIEventHandler&);
|
||||
virtual void visit(MatrixManipulator&) {};
|
||||
virtual void visit(StateSetManipulator&) {};
|
||||
|
||||
// Accessors
|
||||
|
||||
/** Get the GUI EventAdapter associated with this GUIEventHandlerVisitor */
|
||||
const GUIEventAdapter *getGUIEventAdapter() { return _gea.get(); }
|
||||
|
||||
/** Get the GUI Action Adapter associated with this GEH Visitor */
|
||||
GUIActionAdapter *getGUIActionAdapter() { return _gaa; }
|
||||
|
||||
protected:
|
||||
|
||||
GUIEventHandlerVisitor(GUIEventAdapter* in, GUIActionAdapter* out):_gea(in),_gaa(out) {}
|
||||
virtual ~GUIEventHandlerVisitor() {}
|
||||
|
||||
private:
|
||||
|
||||
osg::ref_ptr<GUIEventAdapter> _gea;
|
||||
GUIActionAdapter* _gaa; // Just a pointer. NOT owned by this object.
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -17,7 +17,6 @@
|
||||
#include <osgGA/Export>
|
||||
#include <osgGA/MatrixManipulator>
|
||||
#include <osgGA/GUIEventHandler>
|
||||
#include <osgGA/GUIEventHandlerVisitor>
|
||||
|
||||
namespace osgGA{
|
||||
|
||||
|
||||
@@ -181,9 +181,6 @@ public:
|
||||
/** Handle events, return true if handled, false otherwise. */
|
||||
virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& us);
|
||||
|
||||
/** Handle visitations */
|
||||
virtual void accept(GUIEventHandlerVisitor& v) { v.visit(*this); }
|
||||
|
||||
protected:
|
||||
|
||||
MatrixManipulator();
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
* (at your option) any later version. The full license is in LICENSE file
|
||||
* included with this distribution, and on the openscenegraph.org website.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGGA_SETSCENEVIEWGEHVISITOR
|
||||
#define OSGGA_SETSCENEVIEWGEHVISITOR 1
|
||||
|
||||
#include <osgGA/GUIEventHandlerVisitor>
|
||||
#include <osgUtil/SceneView>
|
||||
|
||||
namespace osgGA{
|
||||
|
||||
// Some forward declarations
|
||||
class GUIEventHandler;
|
||||
class MatrixManipulator;
|
||||
|
||||
/**
|
||||
SetSceneViewGUIEventHandlerVisitor which visits various types of
|
||||
GUIEventHandler and sets them up appropriately, given a new scene
|
||||
view.
|
||||
*/
|
||||
class OSGGA_EXPORT SetSceneViewVisitor: public GUIEventHandlerVisitor
|
||||
{
|
||||
public:
|
||||
|
||||
SetSceneViewVisitor(GUIEventAdapter* in,
|
||||
GUIActionAdapter* out,
|
||||
osgUtil::SceneView* sv):
|
||||
GUIEventHandlerVisitor(in,out),
|
||||
_sceneView(sv) {}
|
||||
|
||||
virtual ~SetSceneViewVisitor() {}
|
||||
|
||||
virtual void visit(MatrixManipulator& cm);
|
||||
virtual void visit(StateSetManipulator& cm);
|
||||
|
||||
private:
|
||||
|
||||
osg::ref_ptr<osgUtil::SceneView> _sceneView;
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -11,8 +11,8 @@
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef OSGGA_GEOSTATE_MANIPULATOR
|
||||
#define OSGGA_GEOSTATE_MANIPULATOR 1
|
||||
#ifndef OSGGA_STATESTATE_MANIPULATOR
|
||||
#define OSGGA_STATESTATE_MANIPULATOR 1
|
||||
|
||||
#include <osgGA/Export>
|
||||
#include <osgGA/GUIEventAdapter>
|
||||
@@ -38,21 +38,18 @@ public:
|
||||
|
||||
virtual const char* className() const { return "StateSetManipulator"; }
|
||||
|
||||
/** attach a geostate to the manipulator to be used for specifying view.*/
|
||||
/** attach a STATESTATE to the manipulator to be used for specifying view.*/
|
||||
virtual void setStateSet(osg::StateSet*);
|
||||
|
||||
/** get the attached a geostate.*/
|
||||
/** get the attached a STATESTATE.*/
|
||||
virtual osg::StateSet * getStateSet();
|
||||
|
||||
/** get the attached a geostate.*/
|
||||
/** get the attached a STATESTATE.*/
|
||||
virtual const osg::StateSet * getStateSet() const;
|
||||
|
||||
/** Handle events, return true if handled, false otherwise.*/
|
||||
virtual bool handle(const GUIEventAdapter& ea,GUIActionAdapter& us);
|
||||
|
||||
/** Handle visitations */
|
||||
virtual void accept(GUIEventHandlerVisitor&);
|
||||
|
||||
/** Get the keyboard and mouse usage of this manipulator.*/
|
||||
virtual void getUsage(osg::ApplicationUsage& usage) const;
|
||||
|
||||
@@ -75,7 +72,7 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
// Reference pointer to a geostate
|
||||
// Reference pointer to a STATESTATE
|
||||
osg::ref_ptr<osg::StateSet> _drawState;
|
||||
|
||||
bool _backface;
|
||||
|
||||
@@ -27,8 +27,6 @@ class OSGPRODUCER_EXPORT ViewerEventHandler : public osgGA::GUIEventHandler
|
||||
|
||||
virtual bool handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa);
|
||||
|
||||
virtual void accept(osgGA::GUIEventHandlerVisitor& gehv);
|
||||
|
||||
/** Get the keyboard and mouse usage of this manipulator.*/
|
||||
virtual void getUsage(osg::ApplicationUsage& usage) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user