Introduce new osgGA::Event and osgGA::EventHandler base classes that the old GUIEventAdapter and GUIEventHandler now subclass from.

The new osgGA::Event is written to support more generic events than the original GUIEventAdapter which are written for keyboard and mouse events.
This commit is contained in:
Robert Osfield
2013-10-25 14:54:15 +00:00
parent 2025c511f0
commit 4a660f6266
37 changed files with 511 additions and 397 deletions

View File

@@ -33,14 +33,14 @@ class OSGGA_EXPORT EventQueue : public osg::Referenced
EventQueue(GUIEventAdapter::MouseYOrientation mouseYOrientation=GUIEventAdapter::Y_INCREASING_DOWNWARDS);
typedef std::list< osg::ref_ptr<GUIEventAdapter> > Events;
typedef std::list< osg::ref_ptr<Event> > Events;
bool empty() const
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_eventQueueMutex);
return _eventQueue.empty();
}
/** Set events.*/
void setEvents(Events& events);
@@ -57,7 +57,7 @@ class OSGGA_EXPORT EventQueue : public osg::Referenced
void appendEvents(Events& events);
/** Add an event to the end of the event queue.*/
void addEvent(GUIEventAdapter* event);
void addEvent(Event* event);
/** Specify if mouse coordinates should be transformed into a pre defined input range, or whether they
@@ -70,7 +70,7 @@ class OSGGA_EXPORT EventQueue : public osg::Referenced
/** Set the graphics context associated with this event queue.*/
void setGraphicsContext(osg::GraphicsContext* context) { getCurrentEventState()->setGraphicsContext(context); }
osg::GraphicsContext* getGraphicsContext() { return getCurrentEventState()->getGraphicsContext(); }
const osg::GraphicsContext* getGraphicsContext() const { return getCurrentEventState()->getGraphicsContext(); }