OpenSceneGraph  3.0.1
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
osgGA::EventQueue Class Reference

EventQueue implementation for collecting and adapting windowing events. More...

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

List of all members.

Public Types

typedef std::list
< osg::ref_ptr
< GUIEventAdapter > > 
Events

Public Member Functions

 EventQueue (GUIEventAdapter::MouseYOrientation mouseYOrientation=GUIEventAdapter::Y_INCREASING_DOWNWARDS)
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 (GUIEventAdapter *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.
void setMouseInputRange (float xMin, float yMin, float xMax, float yMax)
 Set the mouse input range.
void 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.
void 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.
void mouseScroll (GUIEventAdapter::ScrollingMotion sm)
 Method for adapting mouse scroll wheel events, placing this event on the back of the event queue.
void 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.
void mouseScroll2D (float x, float y)
 Method for adapting mouse scroll wheel events, placing this event on the back of the event queue.
void 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 penPressure (float pressure)
 Method for adapting pen pressure events, placing this event on the back of the event queue.
void penPressure (float pressure, double time)
 Method for adapting pen pressure events, placing this event on the back of the event queue, with specified time.
void penOrientation (float tiltX, float tiltY, float rotation)
 Method for adapting pen orientation events, placing this event on the back of the event queue.
void 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.
void penProximity (GUIEventAdapter::TabletPointerType pt, bool isEntering)
 Method for adapting pen proximity events, placing this event on the back of the event queue.
void 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.
void mouseMotion (float x, float y)
 Method for adapting mouse motion events, placing this event on the back of the event queue.
void 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.
void 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.
void 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.
void 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.
void 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.
void 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.
void 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.
void keyPress (int key, int unmodifiedKey=0)
 Method for adapting keyboard press events.
void keyPress (int key, double time, int unmodifiedKey=0)
 Method for adapting keyboard press events.
void keyRelease (int key, int unmodifiedKey=0)
 Method for adapting keyboard press events.
void keyRelease (int key, double time, int unmodifiedKey=0)
 Method for adapting keyboard press events.
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)
void closeWindow ()
 Method for adapting close window events.
void closeWindow (double time)
 Method for adapting close window event with specified event time.
void quitApplication ()
 Method for adapting application quit events.
void quitApplication (double time)
 Method for adapting application quit events with specified event time.
void frame (double time)
 Method for adapting frame events.
void setStartTick (osg::Timer_t tick)
osg::Timer_t getStartTick () const
double getTime () const
GUIEventAdaptercreateEvent ()
 convenience method for create an event ready to fill in.
void setCurrentEventState (GUIEventAdapter *ea)
GUIEventAdaptergetCurrentEventState ()
const GUIEventAdaptergetCurrentEventState () const
void userEvent (osg::Referenced *userEventData)
 Method for adapting user defined events.
void userEvent (osg::Referenced *userEventData, double time)
 Method for adapting user defined events with specified event time.
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 Referenced (bool threadSafeRefUnref)
 Referenced (const Referenced &)
Referencedoperator= (const Referenced &)
virtual void setThreadSafeRefUnref (bool threadSafe)
 Set whether to use a mutex to ensure ref() and unref() are thread safe.
bool getThreadSafeRefUnref () const
 Get whether a mutex is used to ensure ref() and unref() are thread safe.
OpenThreads::Mutex * getRefMutex () const
 Get the mutex used to ensure thread safety of ref()/unref().
int ref () const
 Increment the reference count by one, indicating that this object has another pointer which is referencing it.
int unref () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
int unref_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
int referenceCount () const
 Return the number of pointers currently referencing this object.
ObserverSetgetObserverSet () const
 Get the ObserverSet if one is attached, otherwise return NULL.
ObserverSetgetOrCreateObserverSet () const
 Get the ObserverSet if one is attached, otherwise create an ObserverSet, attach it, then return this newly created ObserverSet.
void addObserver (Observer *observer) const
 Add a Observer that is observing this object, notify the Observer when this object gets deleted.
void removeObserver (Observer *observer) const
 Remove Observer that is observing this object.

Protected Member Functions

virtual ~EventQueue ()
EventQueueoperator= (const EventQueue &)
 Prevent unwanted copy operator.
- 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
- 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.
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 Set whether reference counting should use a mutex for thread safe reference counting.
static bool getThreadSafeReferenceCounting ()
 Get whether reference counting is active.
static void setDeleteHandler (DeleteHandler *handler)
 Set a DeleteHandler to which deletion of all referenced counted objects will be delegated.
static DeleteHandlergetDeleteHandler ()
 Get a DeleteHandler.

Detailed Description

EventQueue implementation for collecting and adapting windowing events.


Member Typedef Documentation


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 ( GUIEventAdapter 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::closeWindow ( )
inline

Method for adapting close window events.

References closeWindow().

Referenced by closeWindow().

void 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.

void osgGA::EventQueue::frame ( double  time)

Method for adapting frame events.

GUIEventAdapter* osgGA::EventQueue::getCurrentEventState ( )
inline
const GUIEventAdapter* osgGA::EventQueue::getCurrentEventState ( ) const
inline
osg::Timer_t osgGA::EventQueue::getStartTick ( ) const
inline
double osgGA::EventQueue::getTime ( ) const
inline
bool osgGA::EventQueue::getUseFixedMouseInputRange ( )
inline

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

void 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().

void 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.

void 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().

void 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.

void 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().

void 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.

void 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().

void 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.

void 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().

void 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.

void 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().

void 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.

void 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().

void 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.

void 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().

void 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.

void 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().

void 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.

void 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().

void 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.

void 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().

void 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.

void osgGA::EventQueue::quitApplication ( )
inline

Method for adapting application quit events.

References quitApplication().

Referenced by quitApplication().

void 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::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.

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
void osgGA::EventQueue::userEvent ( osg::Referenced userEventData)
inline

Method for adapting user defined events.

References userEvent().

Referenced by userEvent().

void osgGA::EventQueue::userEvent ( osg::Referenced userEventData,
double  time 
)

Method for adapting user defined events with specified event time.

void 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().

void 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
Events osgGA::EventQueue::_eventQueue
protected
OpenThreads::Mutex osgGA::EventQueue::_eventQueueMutex
mutableprotected
osg::Timer_t osgGA::EventQueue::_startTick
protected
bool osgGA::EventQueue::_useFixedMouseInputRange
protected

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

osg logo
Generated at Sat Jan 12 2013 03:07:30 for the OpenSceneGraph by doxygen 1.8.1.1.