OpenSceneGraph
3.4.0
|
EventQueue implementation for collecting and adapting windowing events. More...
Public Types | |
typedef std::list < osg::ref_ptr< Event > > | Events |
Public Member Functions | |
EventQueue (GUIEventAdapter::MouseYOrientation mouseYOrientation=GUIEventAdapter::Y_INCREASING_DOWNWARDS) | |
bool | empty () const |
void | setEvents (Events &events) |
Set events. | |
bool | takeEvents (Events &events) |
Take the entire event queue leaving the EventQueue' event queue empty. | |
bool | takeEvents (Events &events, double cutOffTime) |
Take the events that were recorded before with specified time queue. | |
bool | copyEvents (Events &events) const |
Take a copy the entire event queue leaving the EventQueue' event queue intact. | |
void | appendEvents (Events &events) |
Add events to end of event queue. | |
void | addEvent (Event *event) |
Add an event to the end of the event queue. | |
void | setUseFixedMouseInputRange (bool useFixedMouseInputRange) |
Specify if mouse coordinates should be transformed into a pre defined input range, or whether they should be simply based on as local coordinates to the window that generated the mouse events. | |
bool | getUseFixedMouseInputRange () |
Get whether the mouse coordinates should be transformed into a pre defined input range. | |
void | setGraphicsContext (osg::GraphicsContext *context) |
Set the graphics context associated with this event queue. | |
osg::GraphicsContext * | getGraphicsContext () |
const osg::GraphicsContext * | getGraphicsContext () const |
void | syncWindowRectangleWithGraphicsContext () |
Read the window record dimensions from the graphics context. | |
void | setMouseInputRange (float xMin, float yMin, float xMax, float yMax) |
Set the mouse input range. | |
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. | |
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, with specified time. | |
osgGA::GUIEventAdapter * | mouseScroll (GUIEventAdapter::ScrollingMotion sm) |
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue. | |
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, with specified time. | |
osgGA::GUIEventAdapter * | mouseScroll2D (float x, float y) |
Method for adapting mouse scroll wheel 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 * | penPressure (float pressure) |
Method for adapting pen pressure events, placing this event on the back of the event queue. | |
osgGA::GUIEventAdapter * | penPressure (float pressure, double time) |
Method for adapting pen pressure events, placing this event on the back of the event queue, with specified time. | |
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. | |
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, with specified time. | |
osgGA::GUIEventAdapter * | penProximity (GUIEventAdapter::TabletPointerType pt, bool isEntering) |
Method for adapting pen proximity events, placing this event on the back of the event queue. | |
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, with specified time. | |
void | mouseWarped (float x, float y) |
Method for updating in response to a mouse warp. | |
osgGA::GUIEventAdapter * | mouseMotion (float x, float y) |
Method for adapting mouse motion 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, with specified time. | |
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. | |
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, with specified time. | |
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. | |
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, with specified time. | |
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. | |
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, with specified time. | |
osgGA::GUIEventAdapter * | keyPress (int key, int unmodifiedKey=0) |
Method for adapting keyboard press events. | |
osgGA::GUIEventAdapter * | keyPress (int key, double time, int unmodifiedKey=0) |
Method for adapting keyboard press events. | |
osgGA::GUIEventAdapter * | keyRelease (int key, int unmodifiedKey=0) |
Method for adapting keyboard press events. | |
osgGA::GUIEventAdapter * | keyRelease (int key, double time, int unmodifiedKey=0) |
Method for adapting keyboard press events. | |
GUIEventAdapter * | touchBegan (unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time) |
GUIEventAdapter * | touchBegan (unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y) |
GUIEventAdapter * | touchMoved (unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time) |
GUIEventAdapter * | touchMoved (unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y) |
GUIEventAdapter * | touchEnded (unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count, double time) |
GUIEventAdapter * | touchEnded (unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count) |
osgGA::GUIEventAdapter * | closeWindow () |
Method for adapting close window events. | |
osgGA::GUIEventAdapter * | closeWindow (double time) |
Method for adapting close window event with specified event time. | |
osgGA::GUIEventAdapter * | quitApplication () |
Method for adapting application quit events. | |
osgGA::GUIEventAdapter * | quitApplication (double time) |
Method for adapting application quit events with specified event time. | |
osgGA::GUIEventAdapter * | frame (double time) |
Method for adapting frame events. | |
void | setStartTick (osg::Timer_t tick) |
osg::Timer_t | getStartTick () const |
double | getTime () const |
void | clear () |
clear all events from queue. | |
GUIEventAdapter * | createEvent () |
convenience method for create an event ready to fill in. | |
void | setCurrentEventState (GUIEventAdapter *ea) |
GUIEventAdapter * | getCurrentEventState () |
const GUIEventAdapter * | getCurrentEventState () const |
GUIEventAdapter * | userEvent (osg::Referenced *userEventData) |
Method for adapting user defined events. | |
GUIEventAdapter * | userEvent (osg::Referenced *userEventData, double time) |
Method for adapting user defined events with specified event time. | |
void | setFirstTouchEmulatesMouse (bool b) |
bool | getFirstTouchEmulatesMouse () const |
Protected Member Functions | |
virtual | ~EventQueue () |
EventQueue & | operator= (const EventQueue &) |
Prevent unwanted copy operator. | |
Protected Attributes | |
osg::ref_ptr< GUIEventAdapter > | _accumulateEventState |
bool | _useFixedMouseInputRange |
osg::Timer_t | _startTick |
OpenThreads::Mutex | _eventQueueMutex |
Events | _eventQueue |
bool | _firstTouchEmulatesMouse |
EventQueue implementation for collecting and adapting windowing events.
typedef std::list< osg::ref_ptr<Event> > osgGA::EventQueue::Events |
osgGA::EventQueue::EventQueue | ( | GUIEventAdapter::MouseYOrientation | mouseYOrientation = GUIEventAdapter::Y_INCREASING_DOWNWARDS | ) |
virtual osgGA::EventQueue::~EventQueue | ( | ) | [protected, virtual] |
void osgGA::EventQueue::addEvent | ( | Event * | event | ) |
Add an event to the end of the event queue.
void osgGA::EventQueue::appendEvents | ( | Events & | events | ) |
Add events to end of event queue.
void osgGA::EventQueue::clear | ( | ) |
clear all events from queue.
osgGA::GUIEventAdapter* osgGA::EventQueue::closeWindow | ( | ) | [inline] |
osgGA::GUIEventAdapter* osgGA::EventQueue::closeWindow | ( | double | time | ) |
Method for adapting close window event with specified event time.
bool osgGA::EventQueue::copyEvents | ( | Events & | events | ) | const |
Take a copy the entire event queue leaving the EventQueue' event queue intact.
convenience method for create an event ready to fill in.
Clones the getCurrentEventState() to produce a up to date event state.
bool osgGA::EventQueue::empty | ( | ) | const [inline] |
osgGA::GUIEventAdapter* osgGA::EventQueue::frame | ( | double | time | ) |
Method for adapting frame events.
GUIEventAdapter* osgGA::EventQueue::getCurrentEventState | ( | ) | [inline] |
const GUIEventAdapter* osgGA::EventQueue::getCurrentEventState | ( | ) | const [inline] |
bool osgGA::EventQueue::getFirstTouchEmulatesMouse | ( | ) | const [inline] |
osg::GraphicsContext* osgGA::EventQueue::getGraphicsContext | ( | ) | [inline] |
const osg::GraphicsContext* osgGA::EventQueue::getGraphicsContext | ( | ) | const [inline] |
osg::Timer_t osgGA::EventQueue::getStartTick | ( | ) | const [inline] |
double osgGA::EventQueue::getTime | ( | ) | const [inline] |
References osg::Timer::delta_s(), and osg::Timer::instance().
bool osgGA::EventQueue::getUseFixedMouseInputRange | ( | ) | [inline] |
Get whether the mouse coordinates should be transformed into a pre defined input range.
osgGA::GUIEventAdapter* osgGA::EventQueue::keyPress | ( | int | key, |
int | unmodifiedKey = 0 |
||
) | [inline] |
Method for adapting keyboard press events.
Note, special keys such as Ctrl/Function keys should be adapted to GUIEventAdapter::KeySymbol mappings.
References keyPress().
Referenced by keyPress().
osgGA::GUIEventAdapter* osgGA::EventQueue::keyPress | ( | int | key, |
double | time, | ||
int | unmodifiedKey = 0 |
||
) |
Method for adapting keyboard press events.
Note, special keys such as Ctrl/Function keys should be adapted to GUIEventAdapter::KeySymbol mappings, with specified time.
osgGA::GUIEventAdapter* osgGA::EventQueue::keyRelease | ( | int | key, |
int | unmodifiedKey = 0 |
||
) | [inline] |
Method for adapting keyboard press events.
Note, special keys such as Ctrl/Function keys should be adapted to GUIEventAdapter::KeySymbol mappings.
References keyRelease().
Referenced by keyRelease().
osgGA::GUIEventAdapter* osgGA::EventQueue::keyRelease | ( | int | key, |
double | time, | ||
int | unmodifiedKey = 0 |
||
) |
Method for adapting keyboard press events.
Note, special keys such as Ctrl/Function keys should be adapted to GUIEventAdapter::KeySymbol mappings, with specified time.
osgGA::GUIEventAdapter* osgGA::EventQueue::mouseButtonPress | ( | float | x, |
float | y, | ||
unsigned int | button | ||
) | [inline] |
Method for adapting mouse button pressed events, placing this event on the back of the event queue.
Button numbering is 1 for left mouse button, 2 for middle, 3 for right.
References mouseButtonPress().
Referenced by mouseButtonPress().
osgGA::GUIEventAdapter* osgGA::EventQueue::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, with specified time.
Button numbering is 1 for left mouse button, 2 for middle, 3 for right.
osgGA::GUIEventAdapter* osgGA::EventQueue::mouseButtonRelease | ( | float | x, |
float | y, | ||
unsigned int | button | ||
) | [inline] |
Method for adapting mouse button release events, placing this event on the back of the event queue.
Button numbering is 1 for left mouse button, 2 for middle, 3 for right.
References mouseButtonRelease().
Referenced by mouseButtonRelease().
osgGA::GUIEventAdapter* osgGA::EventQueue::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, with specified time.
Button numbering is 1 for left mouse button, 2 for middle, 3 for right.
osgGA::GUIEventAdapter* osgGA::EventQueue::mouseDoubleButtonPress | ( | float | x, |
float | y, | ||
unsigned int | button | ||
) | [inline] |
Method for adapting mouse button pressed events, placing this event on the back of the event queue.
Button numbering is 1 for left mouse button, 2 for middle, 3 for right.
References mouseDoubleButtonPress().
Referenced by mouseDoubleButtonPress().
osgGA::GUIEventAdapter* osgGA::EventQueue::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, with specified time.
Button numbering is 1 for left mouse button, 2 for middle, 3 for right.
osgGA::GUIEventAdapter* osgGA::EventQueue::mouseMotion | ( | float | x, |
float | y | ||
) | [inline] |
Method for adapting mouse motion events, placing this event on the back of the event queue.
References mouseMotion().
Referenced by mouseMotion().
osgGA::GUIEventAdapter* osgGA::EventQueue::mouseMotion | ( | float | x, |
float | y, | ||
double | time | ||
) |
Method for adapting mouse motion events, placing this event on the back of the event queue, with specified time.
osgGA::GUIEventAdapter* osgGA::EventQueue::mouseScroll | ( | GUIEventAdapter::ScrollingMotion | sm | ) | [inline] |
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue.
References mouseScroll().
Referenced by mouseScroll().
osgGA::GUIEventAdapter* osgGA::EventQueue::mouseScroll | ( | GUIEventAdapter::ScrollingMotion | sm, |
double | time | ||
) |
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue, with specified time.
osgGA::GUIEventAdapter* osgGA::EventQueue::mouseScroll2D | ( | float | x, |
float | y | ||
) | [inline] |
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue.
References mouseScroll2D().
Referenced by mouseScroll2D().
osgGA::GUIEventAdapter* osgGA::EventQueue::mouseScroll2D | ( | float | x, |
float | y, | ||
double | time | ||
) |
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue.
void osgGA::EventQueue::mouseWarped | ( | float | x, |
float | y | ||
) |
Method for updating in response to a mouse warp.
Note, just moves the mouse position without creating a new event for it.
EventQueue& osgGA::EventQueue::operator= | ( | const EventQueue & | ) | [inline, protected] |
Prevent unwanted copy operator.
osgGA::GUIEventAdapter* osgGA::EventQueue::penOrientation | ( | float | tiltX, |
float | tiltY, | ||
float | rotation | ||
) | [inline] |
Method for adapting pen orientation events, placing this event on the back of the event queue.
References penOrientation().
Referenced by penOrientation().
osgGA::GUIEventAdapter* osgGA::EventQueue::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, with specified time.
osgGA::GUIEventAdapter* osgGA::EventQueue::penPressure | ( | float | pressure | ) | [inline] |
Method for adapting pen pressure events, placing this event on the back of the event queue.
References penPressure().
Referenced by penPressure().
osgGA::GUIEventAdapter* osgGA::EventQueue::penPressure | ( | float | pressure, |
double | time | ||
) |
Method for adapting pen pressure events, placing this event on the back of the event queue, with specified time.
osgGA::GUIEventAdapter* osgGA::EventQueue::penProximity | ( | GUIEventAdapter::TabletPointerType | pt, |
bool | isEntering | ||
) | [inline] |
Method for adapting pen proximity events, placing this event on the back of the event queue.
References penProximity().
Referenced by penProximity().
osgGA::GUIEventAdapter* osgGA::EventQueue::penProximity | ( | GUIEventAdapter::TabletPointerType | pt, |
bool | isEntering, | ||
double | time | ||
) |
Method for adapting pen proximity events, placing this event on the back of the event queue, with specified time.
osgGA::GUIEventAdapter* osgGA::EventQueue::quitApplication | ( | ) | [inline] |
Method for adapting application quit events.
References quitApplication().
Referenced by quitApplication().
osgGA::GUIEventAdapter* osgGA::EventQueue::quitApplication | ( | double | time | ) |
Method for adapting application quit events with specified event time.
void osgGA::EventQueue::setCurrentEventState | ( | GUIEventAdapter * | ea | ) | [inline] |
void osgGA::EventQueue::setEvents | ( | Events & | events | ) |
Set events.
void osgGA::EventQueue::setFirstTouchEmulatesMouse | ( | bool | b | ) | [inline] |
void osgGA::EventQueue::setGraphicsContext | ( | osg::GraphicsContext * | context | ) | [inline] |
Set the graphics context associated with this event queue.
Referenced by osgViewer::GraphicsWindow::GraphicsWindow().
void osgGA::EventQueue::setMouseInputRange | ( | float | xMin, |
float | yMin, | ||
float | xMax, | ||
float | yMax | ||
) | [inline] |
Set the mouse input range.
void osgGA::EventQueue::setStartTick | ( | osg::Timer_t | tick | ) | [inline] |
void osgGA::EventQueue::setUseFixedMouseInputRange | ( | bool | useFixedMouseInputRange | ) | [inline] |
Specify if mouse coordinates should be transformed into a pre defined input range, or whether they should be simply based on as local coordinates to the window that generated the mouse events.
Read the window record dimensions from the graphics context.
bool osgGA::EventQueue::takeEvents | ( | Events & | events | ) |
Take the entire event queue leaving the EventQueue' event queue empty.
bool osgGA::EventQueue::takeEvents | ( | Events & | events, |
double | cutOffTime | ||
) |
Take the events that were recorded before with specified time queue.
GUIEventAdapter* osgGA::EventQueue::touchBegan | ( | unsigned int | id, |
GUIEventAdapter::TouchPhase | phase, | ||
float | x, | ||
float | y, | ||
double | time | ||
) |
GUIEventAdapter* osgGA::EventQueue::touchBegan | ( | unsigned int | id, |
GUIEventAdapter::TouchPhase | phase, | ||
float | x, | ||
float | y | ||
) | [inline] |
GUIEventAdapter* osgGA::EventQueue::touchEnded | ( | unsigned int | id, |
GUIEventAdapter::TouchPhase | phase, | ||
float | x, | ||
float | y, | ||
unsigned int | tap_count, | ||
double | time | ||
) |
GUIEventAdapter* osgGA::EventQueue::touchEnded | ( | unsigned int | id, |
GUIEventAdapter::TouchPhase | phase, | ||
float | x, | ||
float | y, | ||
unsigned int | tap_count | ||
) | [inline] |
GUIEventAdapter* osgGA::EventQueue::touchMoved | ( | unsigned int | id, |
GUIEventAdapter::TouchPhase | phase, | ||
float | x, | ||
float | y, | ||
double | time | ||
) |
GUIEventAdapter* osgGA::EventQueue::touchMoved | ( | unsigned int | id, |
GUIEventAdapter::TouchPhase | phase, | ||
float | x, | ||
float | y | ||
) | [inline] |
GUIEventAdapter* osgGA::EventQueue::userEvent | ( | osg::Referenced * | userEventData | ) | [inline] |
GUIEventAdapter* osgGA::EventQueue::userEvent | ( | osg::Referenced * | userEventData, |
double | time | ||
) |
Method for adapting user defined events with specified event time.
osgGA::GUIEventAdapter* osgGA::EventQueue::windowResize | ( | int | x, |
int | y, | ||
int | width, | ||
int | height | ||
) | [inline] |
Method for adapting window resize event, placing this event on the back of the event queue.
References windowResize().
Referenced by windowResize().
osgGA::GUIEventAdapter* osgGA::EventQueue::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, with specified time.
Events osgGA::EventQueue::_eventQueue [protected] |
OpenThreads::Mutex osgGA::EventQueue::_eventQueueMutex [mutable, protected] |
bool osgGA::EventQueue::_firstTouchEmulatesMouse [protected] |
osg::Timer_t osgGA::EventQueue::_startTick [protected] |
bool osgGA::EventQueue::_useFixedMouseInputRange [protected] |
![]() | Generated at Tue Dec 8 2015 00:14:28 for the OpenSceneGraph by doxygen 1.7.6.1. |