![]() |
http://www.sim.no http://www.coin3d.org |
Coin contains its own set of event classes, independent of the underlying window system. More...
#include <Inventor/events/SoEvent.h>
Public Member Functions | |
SoEvent (void) | |
virtual | ~SoEvent () |
SbBool | isOfType (SoType type) const |
virtual SoType | getTypeId (void) const |
void | setTime (const SbTime t) |
SbTime | getTime (void) const |
void | setPosition (const SbVec2s &p) |
const SbVec2s & | getPosition (void) const |
const SbVec2s | getPosition (const SbViewportRegion &vpRgn) const |
const SbVec2f | getNormalizedPosition (const SbViewportRegion &vpRgn) const |
void | setShiftDown (SbBool isDown) |
SbBool | wasShiftDown (void) const |
void | setCtrlDown (SbBool isDown) |
SbBool | wasCtrlDown (void) const |
void | setAltDown (SbBool isDown) |
SbBool | wasAltDown (void) const |
Static Public Member Functions | |
static SoType | getClassTypeId (void) |
static void | initClass (void) |
Coin contains its own set of event classes, independent of the underlying window system.
Upon system specific events, a translation is done by the window specific device classes into one of the Coin event object classes listed below. The event is then typically sent by the render area to an SoSceneManager which will apply it to the scenegraph through an SoHandleEventAction.
Events may be caught by the user by attaching an SoEventCallback node to the scenegraph, or it can automatically be handled by a dragger or manipulator in the graph.
SoEvent::SoEvent | ( | void | ) |
Constructor, will set all modifiers to "off" state.
SoEvent::~SoEvent | ( | ) | [virtual] |
Destructor.
SbBool SoEvent::isOfType | ( | SoType | type | ) | const |
Returns TRUE if this object either has the same type as the given type
parameter, or if type
belongs to a superclass of ourselves.
References getTypeId(), and SoType::isDerivedFrom().
Referenced by SoSpaceballButtonEvent::isButtonPressEvent(), SoMouseButtonEvent::isButtonPressEvent(), SoSpaceballButtonEvent::isButtonReleaseEvent(), SoMouseButtonEvent::isButtonReleaseEvent(), SoKeyboardEvent::isKeyPressEvent(), and SoKeyboardEvent::isKeyReleaseEvent().
SoType SoEvent::getClassTypeId | ( | void | ) | [static] |
This static method returns the SoType object associated with objects of this class.
Reimplemented in SoButtonEvent, SoKeyboardEvent, SoLocation2Event, SoMotion3Event, SoMouseButtonEvent, and SoSpaceballButtonEvent.
SoType SoEvent::getTypeId | ( | void | ) | const [virtual] |
Returns the actual type id of an instantiated object.
Reimplemented in SoButtonEvent, SoKeyboardEvent, SoLocation2Event, SoMotion3Event, SoMouseButtonEvent, and SoSpaceballButtonEvent.
Referenced by SoEventCallback::handleEvent(), and isOfType().
void SoEvent::setTime | ( | const SbTime | t | ) |
SbTime SoEvent::getTime | ( | void | ) | const |
Returns the time the event occurred.
void SoEvent::setPosition | ( | const SbVec2s & | p | ) |
From a system specific device object, set the mouse pointer position when the event occurred.
const SbVec2s & SoEvent::getPosition | ( | void | ) | const |
Returns the mouse pointer position when the event occurred. The coordinates are given relative to the window coordinates.
const SbVec2s SoEvent::getPosition | ( | const SbViewportRegion & | vpRgn | ) | const |
Returns the mouse pointer position when the event occurred. The coordinates are given relative to the viewport coordinates.
References SbViewportRegion::getViewportOriginPixels().
const SbVec2f SoEvent::getNormalizedPosition | ( | const SbViewportRegion & | vpRgn | ) | const |
Returns the mouse pointer position when the event occurred. The coordinates are given relative to the viewport coordinates, normalized according to the size of the viewport.
References SbViewportRegion::getViewportOriginPixels(), and SbViewportRegion::getViewportSizePixels().
void SoEvent::setShiftDown | ( | SbBool | isDown | ) |
From a system specific device object, set the state of the Shift key(s) when the event occurred.
SbBool SoEvent::wasShiftDown | ( | void | ) | const |
Returns state of Shift key(s) when the event occurred.
Referenced by SoKeyboardEvent::getPrintableCharacter(), and SoExtSelection::handleEvent().
void SoEvent::setCtrlDown | ( | SbBool | isDown | ) |
From a system specific device object, set the state of the Ctrl key(s) when the event occurred.
SbBool SoEvent::wasCtrlDown | ( | void | ) | const |
Returns state of Ctrl key(s) when the event occurred.
Referenced by SoHandleBoxDragger::dragStart().
void SoEvent::setAltDown | ( | SbBool | isDown | ) |
From a system specific device object, set the state of the Alt key(s) when the event occurred.
SbBool SoEvent::wasAltDown | ( | void | ) | const |
Returns state of Alt key(s) when the event occurred.
void SoEvent::initClass | ( | void | ) | [static] |
Initialize SoEvent and all it's known subclasses (i.e. all subclasses which are part of the standard classes in the Coin library).
This method is called from SoDB::init(), so it's very unlikely that you will have to call it explicitly.
Reimplemented in SoButtonEvent, SoKeyboardEvent, SoLocation2Event, SoMotion3Event, SoMouseButtonEvent, and SoSpaceballButtonEvent.
References SoType::badType(), and SoType::createType().
Referenced by SoDB::init().
Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.
Generated on Mon Feb 23 16:33:48 2009 for Coin by Doxygen. 1.5.8