14#ifndef OSGGA_EVENTQUEUE
15#define OSGGA_EVENTQUEUE 1
22#include <OpenThreads/Mutex>
36 typedef std::list< osg::ref_ptr<Event> >
Events;
unsigned long long Timer_t
Definition Timer:24
The 'GA' in osgGA stands for 'GUI Abstraction'; the osgGA namespace provides facilities to help devel...
Definition Callback:21
Base class for providing Windowing API agnostic access to creating and managing graphics context.
Definition GraphicsContext:30
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Base class for providing reference counted objects.
Definition Referenced:44
static Timer * instance()
double delta_s(Timer_t t1, Timer_t t2) const
Get the time in seconds between timer ticks t1 and t2.
Definition Timer:59
Base Event class.
Definition Event:27
osgGA::GUIEventAdapter * mouseScroll2D(float x, float y)
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue.
Definition EventQueue:101
osgGA::GUIEventAdapter * penPressure(float pressure, double time)
Method for adapting pen pressure events, placing this event on the back of the event queue,...
GUIEventAdapter * userEvent(osg::Referenced *userEventData, double time)
Method for adapting user defined events with specified event time.
void setCurrentEventState(GUIEventAdapter *ea)
Definition EventQueue:224
bool takeEvents(Events &events, double cutOffTime)
Take the events that were recorded before with specified time queue.
osgGA::GUIEventAdapter * penOrientation(float tiltX, float tiltY, float rotation, double time)
Method for adapting pen orientation events, placing this event on the back of the event queue,...
void setUseFixedMouseInputRange(bool useFixedMouseInputRange)
Specify if mouse coordinates should be transformed into a pre defined input range,...
Definition EventQueue:65
GUIEventAdapter * touchBegan(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time)
void clear()
clear all events from queue.
osgGA::GUIEventAdapter * mouseScroll(GUIEventAdapter::ScrollingMotion sm)
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue.
Definition EventQueue:94
osgGA::GUIEventAdapter * keyRelease(int key, double time, int unmodifiedKey=0)
Method for adapting keyboard press events.
bool _useFixedMouseInputRange
Definition EventQueue:246
GUIEventAdapter * touchMoved(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time)
void setFirstTouchEmulatesMouse(bool b)
Definition EventQueue:234
osgGA::GUIEventAdapter * penProximity(GUIEventAdapter::TabletPointerType pt, bool isEntering)
Method for adapting pen proximity events, placing this event on the back of the event queue.
Definition EventQueue:120
bool _firstTouchEmulatesMouse
Definition EventQueue:251
GUIEventAdapter * userEvent(osg::Referenced *userEventData)
Method for adapting user defined events.
Definition EventQueue:229
GUIEventAdapter * touchEnded(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count)
Definition EventQueue:188
osg::Timer_t getStartTick() const
Definition EventQueue:213
std::list< osg::ref_ptr< Event > > Events
Definition EventQueue:36
osgGA::GUIEventAdapter * keyPress(int key, double time, int unmodifiedKey=0)
Method for adapting keyboard press events.
osgGA::GUIEventAdapter * keyPress(int key, int unmodifiedKey=0)
Method for adapting keyboard press events.
Definition EventQueue:165
bool getUseFixedMouseInputRange()
Get whether the mouse coordinates should be transformed into a pre defined input range.
Definition EventQueue:68
GUIEventAdapter * getCurrentEventState()
Definition EventQueue:225
osgGA::GUIEventAdapter * keyRelease(int key, int unmodifiedKey=0)
Method for adapting keyboard press events.
Definition EventQueue:172
osgGA::GUIEventAdapter * closeWindow()
Method for adapting close window events.
Definition EventQueue:195
GUIEventAdapter * touchEnded(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count, double time)
bool empty() const
Definition EventQueue:38
void addEvent(Event *event)
Add an event to the end of the event queue.
osgGA::GUIEventAdapter * mouseButtonRelease(float x, float y, unsigned int button, double time)
Method for adapting mouse button release events, placing this event on the back of the event queue,...
osgGA::GUIEventAdapter * mouseMotion(float x, float y, double time)
Method for adapting mouse motion events, placing this event on the back of the event queue,...
osgGA::GUIEventAdapter * penOrientation(float tiltX, float tiltY, float rotation)
Method for adapting pen orientation events, placing this event on the back of the event queue.
Definition EventQueue:114
osgGA::GUIEventAdapter * mouseDoubleButtonPress(float x, float y, unsigned int button)
Method for adapting mouse button pressed events, placing this event on the back of the event queue.
Definition EventQueue:148
osgGA::GUIEventAdapter * windowResize(int x, int y, int width, int height, double time)
Method for adapting window resize event, placing this event on the back of the event queue,...
osgGA::GUIEventAdapter * mouseButtonPress(float x, float y, unsigned int button)
Method for adapting mouse button pressed events, placing this event on the back of the event queue.
Definition EventQueue:139
GUIEventAdapter * touchMoved(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y)
Definition EventQueue:183
osgGA::GUIEventAdapter * closeWindow(double time)
Method for adapting close window event with specified event time.
void appendEvents(Events &events)
Add events to end of event queue.
osgGA::GUIEventAdapter * mouseButtonRelease(float x, float y, unsigned int button)
Method for adapting mouse button release events, placing this event on the back of the event queue.
Definition EventQueue:157
osgGA::GUIEventAdapter * mouseButtonPress(float x, float y, unsigned int button, double time)
Method for adapting mouse button pressed events, placing this event on the back of the event queue,...
void setStartTick(osg::Timer_t tick)
Definition EventQueue:212
const GUIEventAdapter * getCurrentEventState() const
Definition EventQueue:226
void setEvents(Events &events)
Set events.
osgGA::GUIEventAdapter * penProximity(GUIEventAdapter::TabletPointerType pt, bool isEntering, double time)
Method for adapting pen proximity events, placing this event on the back of the event queue,...
const osg::GraphicsContext * getGraphicsContext() const
Definition EventQueue:76
osgGA::GUIEventAdapter * quitApplication()
Method for adapting application quit events.
Definition EventQueue:202
GUIEventAdapter * createEvent()
convenience method for create an event ready to fill in.
double getTime() const
Definition EventQueue:215
osgGA::GUIEventAdapter * windowResize(int x, int y, int width, int height)
Method for adapting window resize event, placing this event on the back of the event queue.
Definition EventQueue:87
OpenThreads::Mutex _eventQueueMutex
Definition EventQueue:249
bool takeEvents(Events &events)
Take the entire event queue leaving the EventQueue' event queue empty.
bool getFirstTouchEmulatesMouse() const
Definition EventQueue:235
osgGA::GUIEventAdapter * penPressure(float pressure)
Method for adapting pen pressure events, placing this event on the back of the event queue.
Definition EventQueue:108
osgGA::GUIEventAdapter * frame(double time)
Method for adapting frame events.
void mouseWarped(float x, float y)
Method for updating in response to a mouse warp.
osg::Timer_t _startTick
Definition EventQueue:248
osg::ref_ptr< GUIEventAdapter > _accumulateEventState
Definition EventQueue:244
bool copyEvents(Events &events) const
Take a copy the entire event queue leaving the EventQueue' event queue intact.
void setGraphicsContext(osg::GraphicsContext *context)
Set the graphics context associated with this event queue.
Definition EventQueue:72
void setMouseInputRange(float xMin, float yMin, float xMax, float yMax)
Set the mouse input range.
Definition EventQueue:83
Events _eventQueue
Definition EventQueue:250
osgGA::GUIEventAdapter * mouseMotion(float x, float y)
Method for adapting mouse motion events, placing this event on the back of the event queue.
Definition EventQueue:131
GUIEventAdapter * touchBegan(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y)
Definition EventQueue:178
osgGA::GUIEventAdapter * mouseScroll(GUIEventAdapter::ScrollingMotion sm, double time)
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue,...
osgGA::GUIEventAdapter * mouseDoubleButtonPress(float x, float y, unsigned int button, double time)
Method for adapting mouse button pressed events, placing this event on the back of the event queue,...
osgGA::GUIEventAdapter * mouseScroll2D(float x, float y, double time)
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue.
osgGA::GUIEventAdapter * quitApplication(double time)
Method for adapting application quit events with specified event time.
EventQueue(GUIEventAdapter::MouseYOrientation mouseYOrientation=GUIEventAdapter::Y_INCREASING_DOWNWARDS)
osg::GraphicsContext * getGraphicsContext()
Definition EventQueue:74
void syncWindowRectangleWithGraphicsContext()
Read the window record dimensions from the graphics context.
Event class for storing Keyboard, mouse and window events.
Definition GUIEventAdapter:82
ScrollingMotion
Definition GUIEventAdapter:360
MouseYOrientation
Definition GUIEventAdapter:354
@ Y_INCREASING_DOWNWARDS
Definition GUIEventAdapter:356
TouchPhase
Definition GUIEventAdapter:378
TabletPointerType
Definition GUIEventAdapter:370
#define OSGGA_EXPORT
Definition Export:40