OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
osgGA::EventQueue Class Reference

#include <EventQueue.h>

Inheritance diagram for osgGA::EventQueue:
Inheritance graph
[legend]
Collaboration diagram for osgGA::EventQueue:
Collaboration graph
[legend]

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)
 
bool takeEvents (Events &events)
 
bool takeEvents (Events &events, double cutOffTime)
 
bool copyEvents (Events &events) const
 
void appendEvents (Events &events)
 
void addEvent (Event *event)
 
void setUseFixedMouseInputRange (bool useFixedMouseInputRange)
 
bool getUseFixedMouseInputRange ()
 
void setGraphicsContext (osg::GraphicsContext *context)
 
osg::GraphicsContextgetGraphicsContext ()
 
const osg::GraphicsContextgetGraphicsContext () const
 
void syncWindowRectangleWithGraphicsContext ()
 
void setMouseInputRange (float xMin, float yMin, float xMax, float yMax)
 
osgGA::GUIEventAdapterwindowResize (int x, int y, int width, int height)
 
osgGA::GUIEventAdapterwindowResize (int x, int y, int width, int height, double time)
 
osgGA::GUIEventAdaptermouseScroll (GUIEventAdapter::ScrollingMotion sm)
 
osgGA::GUIEventAdaptermouseScroll (GUIEventAdapter::ScrollingMotion sm, double time)
 
osgGA::GUIEventAdaptermouseScroll2D (float x, float y)
 
osgGA::GUIEventAdaptermouseScroll2D (float x, float y, double time)
 
osgGA::GUIEventAdapterpenPressure (float pressure)
 
osgGA::GUIEventAdapterpenPressure (float pressure, double time)
 
osgGA::GUIEventAdapterpenOrientation (float tiltX, float tiltY, float rotation)
 
osgGA::GUIEventAdapterpenOrientation (float tiltX, float tiltY, float rotation, double time)
 
osgGA::GUIEventAdapterpenProximity (GUIEventAdapter::TabletPointerType pt, bool isEntering)
 
osgGA::GUIEventAdapterpenProximity (GUIEventAdapter::TabletPointerType pt, bool isEntering, double time)
 
void mouseWarped (float x, float y)
 
osgGA::GUIEventAdaptermouseMotion (float x, float y)
 
osgGA::GUIEventAdaptermouseMotion (float x, float y, double time)
 
osgGA::GUIEventAdaptermouseButtonPress (float x, float y, unsigned int button)
 
osgGA::GUIEventAdaptermouseButtonPress (float x, float y, unsigned int button, double time)
 
osgGA::GUIEventAdaptermouseDoubleButtonPress (float x, float y, unsigned int button)
 
osgGA::GUIEventAdaptermouseDoubleButtonPress (float x, float y, unsigned int button, double time)
 
osgGA::GUIEventAdaptermouseButtonRelease (float x, float y, unsigned int button)
 
osgGA::GUIEventAdaptermouseButtonRelease (float x, float y, unsigned int button, double time)
 
osgGA::GUIEventAdapterkeyPress (int key, int unmodifiedKey=0)
 
osgGA::GUIEventAdapterkeyPress (int key, double time, int unmodifiedKey=0)
 
osgGA::GUIEventAdapterkeyRelease (int key, int unmodifiedKey=0)
 
osgGA::GUIEventAdapterkeyRelease (int key, double time, int unmodifiedKey=0)
 
GUIEventAdaptertouchBegan (unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time)
 
GUIEventAdaptertouchBegan (unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y)
 
GUIEventAdaptertouchMoved (unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time)
 
GUIEventAdaptertouchMoved (unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y)
 
GUIEventAdaptertouchEnded (unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count, double time)
 
GUIEventAdaptertouchEnded (unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count)
 
osgGA::GUIEventAdaptercloseWindow ()
 
osgGA::GUIEventAdaptercloseWindow (double time)
 
osgGA::GUIEventAdapterquitApplication ()
 
osgGA::GUIEventAdapterquitApplication (double time)
 
osgGA::GUIEventAdapterframe (double time)
 
void setStartTick (osg::Timer_t tick)
 
osg::Timer_t getStartTick () const
 
double getTime () const
 
void clear ()
 
GUIEventAdaptercreateEvent ()
 
void setCurrentEventState (GUIEventAdapter *ea)
 
GUIEventAdaptergetCurrentEventState ()
 
const GUIEventAdaptergetCurrentEventState () const
 
GUIEventAdapteruserEvent (osg::Referenced *userEventData)
 
GUIEventAdapteruserEvent (osg::Referenced *userEventData, double time)
 
void setFirstTouchEmulatesMouse (bool b)
 
bool getFirstTouchEmulatesMouse () const
 
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 
 Referenced (bool threadSafeRefUnref)
 
 Referenced (const Referenced &)
 
Referencedoperator= (const Referenced &)
 
virtual void setThreadSafeRefUnref (bool threadSafe)
 
bool getThreadSafeRefUnref () const
 
OpenThreads::MutexgetRefMutex () const
 
int ref () const
 
int unref () const
 
int unref_nodelete () const
 
int referenceCount () const
 
ObserverSetgetObserverSet () const
 
ObserverSetgetOrCreateObserverSet () const
 
void addObserver (Observer *observer) const
 
void removeObserver (Observer *observer) const
 

Protected Member Functions

virtual ~EventQueue ()
 
EventQueueoperator= (const EventQueue &)
 
- 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::MutexgetGlobalReferencedMutex ()
 
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 
static bool getThreadSafeReferenceCounting ()
 
static void setDeleteHandler (DeleteHandler *handler)
 
static DeleteHandlergetDeleteHandler ()
 

Detailed Description

EventQueue implementation for collecting and adapting windowing events

Definition at line 30 of file EventQueue.h.

Member Typedef Documentation

Definition at line 36 of file EventQueue.h.

Constructor & Destructor Documentation

osgGA::EventQueue::EventQueue ( GUIEventAdapter::MouseYOrientation  mouseYOrientation = GUIEventAdapter::Y_INCREASING_DOWNWARDS)
virtual osgGA::EventQueue::~EventQueue ( )
protectedvirtual

Member Function Documentation

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

Method for adapting close window events.

Definition at line 195 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

bool osgGA::EventQueue::empty ( ) const
inline

Definition at line 38 of file EventQueue.h.

osgGA::GUIEventAdapter* osgGA::EventQueue::frame ( double  time)

Method for adapting frame events.

GUIEventAdapter* osgGA::EventQueue::getCurrentEventState ( )
inline

Definition at line 225 of file EventQueue.h.

const GUIEventAdapter* osgGA::EventQueue::getCurrentEventState ( ) const
inline

Definition at line 226 of file EventQueue.h.

bool osgGA::EventQueue::getFirstTouchEmulatesMouse ( ) const
inline

Definition at line 235 of file EventQueue.h.

osg::GraphicsContext* osgGA::EventQueue::getGraphicsContext ( )
inline

Definition at line 74 of file EventQueue.h.

const osg::GraphicsContext* osgGA::EventQueue::getGraphicsContext ( ) const
inline

Definition at line 76 of file EventQueue.h.

osg::Timer_t osgGA::EventQueue::getStartTick ( ) const
inline

Definition at line 213 of file EventQueue.h.

double osgGA::EventQueue::getTime ( ) const
inline

Definition at line 215 of file EventQueue.h.

Here is the call graph for this function:

bool osgGA::EventQueue::getUseFixedMouseInputRange ( )
inline

Get whether the mouse coordinates should be transformed into a pre defined input range.

Definition at line 68 of file EventQueue.h.

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.

Definition at line 165 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 172 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 139 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 157 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 148 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 131 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 94 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 101 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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 )
inlineprotected

Prevent unwanted copy operator.

Definition at line 242 of file EventQueue.h.

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.

Definition at line 114 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 108 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 120 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 202 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

osgGA::GUIEventAdapter* osgGA::EventQueue::quitApplication ( double  time)

Method for adapting application quit events with specified event time.

void osgGA::EventQueue::setCurrentEventState ( GUIEventAdapter ea)
inline

Definition at line 224 of file EventQueue.h.

void osgGA::EventQueue::setEvents ( Events events)

Set events.

void osgGA::EventQueue::setFirstTouchEmulatesMouse ( bool  b)
inline

Definition at line 234 of file EventQueue.h.

void osgGA::EventQueue::setGraphicsContext ( osg::GraphicsContext context)
inline

Set the graphics context associated with this event queue.

Definition at line 72 of file EventQueue.h.

Here is the caller graph for this function:

void osgGA::EventQueue::setMouseInputRange ( float  xMin,
float  yMin,
float  xMax,
float  yMax 
)
inline

Set the mouse input range.

Definition at line 83 of file EventQueue.h.

void osgGA::EventQueue::setStartTick ( osg::Timer_t  tick)
inline

Definition at line 212 of file EventQueue.h.

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.

Definition at line 65 of file EventQueue.h.

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 
)
GUIEventAdapter* osgGA::EventQueue::touchBegan ( unsigned int  id,
GUIEventAdapter::TouchPhase  phase,
float  x,
float  y 
)
inline

Definition at line 178 of file EventQueue.h.

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

Definition at line 188 of file EventQueue.h.

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

Definition at line 183 of file EventQueue.h.

GUIEventAdapter* osgGA::EventQueue::userEvent ( osg::Referenced userEventData)
inline

Method for adapting user defined events

Definition at line 229 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Definition at line 87 of file EventQueue.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Member Data Documentation

osg::ref_ptr<GUIEventAdapter> osgGA::EventQueue::_accumulateEventState
protected

Definition at line 244 of file EventQueue.h.

Events osgGA::EventQueue::_eventQueue
protected

Definition at line 250 of file EventQueue.h.

OpenThreads::Mutex osgGA::EventQueue::_eventQueueMutex
mutableprotected

Definition at line 249 of file EventQueue.h.

bool osgGA::EventQueue::_firstTouchEmulatesMouse
protected

Definition at line 251 of file EventQueue.h.

osg::Timer_t osgGA::EventQueue::_startTick
protected

Definition at line 248 of file EventQueue.h.

bool osgGA::EventQueue::_useFixedMouseInputRange
protected

Definition at line 246 of file EventQueue.h.


The documentation for this class was generated from the following file: