OpenSceneGraph
3.5.1
|
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. More... | |
bool | takeEvents (Events &events) |
Take the entire event queue leaving the EventQueue' event queue empty. More... | |
bool | takeEvents (Events &events, double cutOffTime) |
Take the events that were recorded before with specified time queue. More... | |
bool | copyEvents (Events &events) const |
Take a copy the entire event queue leaving the EventQueue' event queue intact. More... | |
void | appendEvents (Events &events) |
Add events to end of event queue. More... | |
void | addEvent (Event *event) |
Add an event to the end of the event queue. More... | |
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. More... | |
bool | getUseFixedMouseInputRange () |
Get whether the mouse coordinates should be transformed into a pre defined input range. More... | |
void | setGraphicsContext (osg::GraphicsContext *context) |
Set the graphics context associated with this event queue. More... | |
osg::GraphicsContext * | getGraphicsContext () |
const osg::GraphicsContext * | getGraphicsContext () const |
void | syncWindowRectangleWithGraphicsContext () |
Read the window record dimensions from the graphics context. More... | |
void | setMouseInputRange (float xMin, float yMin, float xMax, float yMax) |
Set the mouse input range. More... | |
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. More... | |
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. More... | |
osgGA::GUIEventAdapter * | mouseScroll (GUIEventAdapter::ScrollingMotion sm) |
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue. More... | |
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. More... | |
osgGA::GUIEventAdapter * | mouseScroll2D (float x, float y) |
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue. More... | |
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. More... | |
osgGA::GUIEventAdapter * | penPressure (float pressure) |
Method for adapting pen pressure events, placing this event on the back of the event queue. More... | |
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. More... | |
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. More... | |
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. More... | |
osgGA::GUIEventAdapter * | penProximity (GUIEventAdapter::TabletPointerType pt, bool isEntering) |
Method for adapting pen proximity events, placing this event on the back of the event queue. More... | |
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. More... | |
void | mouseWarped (float x, float y) |
Method for updating in response to a mouse warp. More... | |
osgGA::GUIEventAdapter * | mouseMotion (float x, float y) |
Method for adapting mouse motion events, placing this event on the back of the event queue. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
osgGA::GUIEventAdapter * | keyPress (int key, int unmodifiedKey=0) |
Method for adapting keyboard press events. More... | |
osgGA::GUIEventAdapter * | keyPress (int key, double time, int unmodifiedKey=0) |
Method for adapting keyboard press events. More... | |
osgGA::GUIEventAdapter * | keyRelease (int key, int unmodifiedKey=0) |
Method for adapting keyboard press events. More... | |
osgGA::GUIEventAdapter * | keyRelease (int key, double time, int unmodifiedKey=0) |
Method for adapting keyboard press events. More... | |
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. More... | |
osgGA::GUIEventAdapter * | closeWindow (double time) |
Method for adapting close window event with specified event time. More... | |
osgGA::GUIEventAdapter * | quitApplication () |
Method for adapting application quit events. More... | |
osgGA::GUIEventAdapter * | quitApplication (double time) |
Method for adapting application quit events with specified event time. More... | |
osgGA::GUIEventAdapter * | frame (double time) |
Method for adapting frame events. More... | |
void | setStartTick (osg::Timer_t tick) |
osg::Timer_t | getStartTick () const |
double | getTime () const |
void | clear () |
clear all events from queue. More... | |
GUIEventAdapter * | createEvent () |
convenience method for create an event ready to fill in. More... | |
void | setCurrentEventState (GUIEventAdapter *ea) |
GUIEventAdapter * | getCurrentEventState () |
const GUIEventAdapter * | getCurrentEventState () const |
GUIEventAdapter * | userEvent (osg::Referenced *userEventData) |
Method for adapting user defined events. More... | |
GUIEventAdapter * | userEvent (osg::Referenced *userEventData, double time) |
Method for adapting user defined events with specified event time. More... | |
void | setFirstTouchEmulatesMouse (bool b) |
bool | getFirstTouchEmulatesMouse () const |
Public Member Functions inherited from osg::Referenced | |
Referenced () | |
Referenced (bool threadSafeRefUnref) | |
Referenced (const Referenced &) | |
Referenced & | operator= (const Referenced &) |
virtual void | setThreadSafeRefUnref (bool threadSafe) |
Set whether to use a mutex to ensure ref() and unref() are thread safe. More... | |
bool | getThreadSafeRefUnref () const |
Get whether a mutex is used to ensure ref() and unref() are thread safe. More... | |
OpenThreads::Mutex * | getRefMutex () const |
Get the mutex used to ensure thread safety of ref()/unref(). More... | |
int | ref () const |
Increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
int | unref () const |
Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More... | |
int | unref_nodelete () const |
Decrement the reference count by one, indicating that a pointer to this object is no longer referencing it. More... | |
int | referenceCount () const |
Return the number of pointers currently referencing this object. More... | |
ObserverSet * | getObserverSet () const |
Get the ObserverSet if one is attached, otherwise return NULL. More... | |
ObserverSet * | getOrCreateObserverSet () const |
Get the ObserverSet if one is attached, otherwise create an ObserverSet, attach it, then return this newly created ObserverSet. More... | |
void | addObserver (Observer *observer) const |
Add a Observer that is observing this object, notify the Observer when this object gets deleted. More... | |
void | removeObserver (Observer *observer) const |
Remove Observer that is observing this object. More... | |
Protected Member Functions | |
virtual | ~EventQueue () |
EventQueue & | operator= (const EventQueue &) |
Prevent unwanted copy operator. More... | |
Protected Member Functions inherited from osg::Referenced | |
virtual | ~Referenced () |
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const |
void | deleteUsingDeleteHandler () const |
Protected Attributes | |
osg::ref_ptr< GUIEventAdapter > | _accumulateEventState |
bool | _useFixedMouseInputRange |
osg::Timer_t | _startTick |
OpenThreads::Mutex | _eventQueueMutex |
Events | _eventQueue |
bool | _firstTouchEmulatesMouse |
Protected Attributes inherited from osg::Referenced | |
OpenThreads::AtomicPtr | _observerSet |
OpenThreads::Atomic | _refCount |
Additional Inherited Members | |
Static Public Member Functions inherited from osg::Referenced | |
static OpenThreads::Mutex * | getGlobalReferencedMutex () |
Get the optional global Referenced mutex, this can be shared between all osg::Referenced. More... | |
static void | setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting) |
Set whether reference counting should use a mutex for thread safe reference counting. More... | |
static bool | getThreadSafeReferenceCounting () |
Get whether reference counting is active. More... | |
static void | setDeleteHandler (DeleteHandler *handler) |
Set a DeleteHandler to which deletion of all referenced counted objects will be delegated. More... | |
static DeleteHandler * | getDeleteHandler () |
Get a DeleteHandler. More... | |
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 | ) |
|
protectedvirtual |
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.
|
inline |
Method for adapting close window events.
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.
GUIEventAdapter* osgGA::EventQueue::createEvent | ( | ) |
convenience method for create an event ready to fill in.
Clones the getCurrentEventState() to produce a up to date event state.
|
inline |
osgGA::GUIEventAdapter* osgGA::EventQueue::frame | ( | double | time | ) |
Method for adapting frame events.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get whether the mouse coordinates should be transformed into a pre defined input range.
|
inline |
Method for adapting keyboard press events.
Note, special keys such as Ctrl/Function keys should be adapted to GUIEventAdapter::KeySymbol mappings.
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.
|
inline |
Method for adapting keyboard press events.
Note, special keys such as Ctrl/Function keys should be adapted to GUIEventAdapter::KeySymbol mappings.
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.
|
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.
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.
|
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.
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.
|
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.
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.
|
inline |
Method for adapting mouse motion events, placing this event on the back of the event queue.
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.
|
inline |
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue.
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.
|
inline |
Method for adapting mouse scroll wheel events, placing this event on the back of the event queue.
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.
|
inlineprotected |
Prevent unwanted copy operator.
|
inline |
Method for adapting pen orientation events, placing this event on the back of the event queue.
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.
|
inline |
Method for adapting pen pressure events, placing this event on the back of the event queue.
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.
|
inline |
Method for adapting pen proximity events, placing this event on the back of the event queue.
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.
|
inline |
Method for adapting application quit events.
osgGA::GUIEventAdapter* osgGA::EventQueue::quitApplication | ( | double | time | ) |
Method for adapting application quit events with specified event time.
|
inline |
void osgGA::EventQueue::setEvents | ( | Events & | events | ) |
Set events.
|
inline |
|
inline |
Set the graphics context associated with this event queue.
|
inline |
Set the mouse input range.
|
inline |
|
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.
void osgGA::EventQueue::syncWindowRectangleWithGraphicsContext | ( | ) |
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 | ||
) |
|
inline |
GUIEventAdapter* osgGA::EventQueue::touchEnded | ( | unsigned int | id, |
GUIEventAdapter::TouchPhase | phase, | ||
float | x, | ||
float | y, | ||
unsigned int | tap_count, | ||
double | time | ||
) |
|
inline |
GUIEventAdapter* osgGA::EventQueue::touchMoved | ( | unsigned int | id, |
GUIEventAdapter::TouchPhase | phase, | ||
float | x, | ||
float | y, | ||
double | time | ||
) |
|
inline |
|
inline |
Method for adapting user defined events.
GUIEventAdapter* osgGA::EventQueue::userEvent | ( | osg::Referenced * | userEventData, |
double | time | ||
) |
Method for adapting user defined events with specified event time.
|
inline |
Method for adapting window resize event, placing this event on the back of the event queue.
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.
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |
Generated at Wed Nov 11 2015 22:14:58 for the OpenSceneGraph by doxygen 1.8.10. |