Open Inventor Reference
SoEvent Class Reference

Base class for all events. More...

#include <Inventor/events/SoEvent.h>

Inheritance diagram for SoEvent:
SoButtonEvent SoEnterLeaveEvent SoLocation2Event SoMotion3Event SoMouseWheelEvent SoKeyboardEvent SoMouseButtonEvent SoSpaceballButtonEvent SoLocation2RefreshEvent

Public Types

enum  MouseButtonsMask {
  NO_MOUSEBUTTON_MASK = 0 , LEFT_MOUSEBUTTON_MASK = 1 , MIDDLE_MOUSEBUTTON_MASK = 2 , RIGHT_MOUSEBUTTON_MASK = 4 ,
  ALL_MOUSEBUTTONS_MASK = LEFT_MOUSEBUTTON_MASK + MIDDLE_MOUSEBUTTON_MASK + RIGHT_MOUSEBUTTON_MASK
}
 This describes the bit mask values of setButtonMask and getButtonMask. More...
 

Public Member Functions

 SoEvent ()
 Constructor and destructor. More...
 
virtual ~SoEvent ()
 Constructor and destructor. More...
 
virtual SoType getTypeId () const
 Return the type id for this event instance. More...
 
bool isOfType (SoType type) const
 This returns TRUE if the event is an instance of or derived from an event of the passed type. More...
 
void setTime (SbTime t)
 Set the time at which the event occurred. More...
 
SbTime getTime () const
 Get the time at which the event occurred. More...
 
void setPosition (const SbVec2s &p)
 Set the window pixel location of the cursor when the event occurred. More...
 
const SbVec2sgetPosition () const
 Get position in pixel coodinates. More...
 
const SbVec2sgetPosition (const SbViewportRegion &vpRgn) const
 Get position relative to the specified viewport bounds. More...
 
const SbVec2fgetNormalizedPosition (const SbViewportRegion &vpRgn) const
 Get the normalized location of the cursor when the event occurred, relative to the specified viewport region. More...
 
void setShiftDown (bool isDown)
 Set whether the modifier keys were down when the event occurred. More...
 
void setCtrlDown (bool isDown)
 Set whether the modifier keys were down when the event occurred. More...
 
void setAltDown (bool isDown)
 Set whether the modifier keys were down when the event occurred. More...
 
bool wasShiftDown () const
 Get whether the modifier keys were down when the event occurred. More...
 
bool wasCtrlDown () const
 Get whether the modifier keys were down when the event occurred. More...
 
bool wasAltDown () const
 Get whether the modifier keys were down when the event occurred. More...
 
void setMouseButtonMask (int mask)
 Get which mouse buttons are currently pressed (as bit mask) More...
 
int getMouseButtonMask () const
 Set which mouse buttons are currently pressed. More...
 

Static Public Member Functions

static SoType getClassTypeId ()
 Return the type id for the SoEvent class. More...
 
static void initClass ()
 Initializes base event class. More...
 
static void initClasses ()
 Initialize ALL Inventor event classes. More...
 

Detailed Description

SoEvent is the base class for events in the Inventor event model. An event typically represents a user action, such as a mouse button being pressed or a keyboard key being released. SoEvent contains general information found in all Inventor events, including the time the event occurred, the position of the locater when the event occurred, and the state of the modifier keys when the event occurred.

See Also
SoButtonEvent, SoKeyboardEvent, SoLocation2Event, SoMotion3Event, SoMouseButtonEvent, SoSpaceballButtonEvent, SoHandleEventAction, SoEventCallback, SoSelection, SoInteraction

Definition at line 84 of file SoEvent.h.

Member Enumeration Documentation

◆ MouseButtonsMask

Enumerator
NO_MOUSEBUTTON_MASK 
LEFT_MOUSEBUTTON_MASK 
MIDDLE_MOUSEBUTTON_MASK 
RIGHT_MOUSEBUTTON_MASK 
ALL_MOUSEBUTTONS_MASK 

Definition at line 88 of file SoEvent.h.

Constructor & Destructor Documentation

◆ SoEvent()

SoEvent::SoEvent ( )

◆ ~SoEvent()

virtual SoEvent::~SoEvent ( )
virtual

Member Function Documentation

◆ getClassTypeId()

static SoType SoEvent::getClassTypeId ( )
inlinestatic

Definition at line 105 of file SoEvent.h.

◆ getMouseButtonMask()

int SoEvent::getMouseButtonMask ( ) const
inline

Definition at line 149 of file SoEvent.h.

◆ getNormalizedPosition()

const SbVec2f& SoEvent::getNormalizedPosition ( const SbViewportRegion vpRgn) const

The returned value will lie between 0.0 and 1.0.

◆ getPosition() [1/2]

const SbVec2s& SoEvent::getPosition ( ) const
inline

Definition at line 122 of file SoEvent.h.

◆ getPosition() [2/2]

const SbVec2s& SoEvent::getPosition ( const SbViewportRegion vpRgn) const

◆ getTime()

SbTime SoEvent::getTime ( ) const
inline

Definition at line 114 of file SoEvent.h.

◆ getTypeId()

virtual SoType SoEvent::getTypeId ( ) const
virtual

◆ initClass()

static void SoEvent::initClass ( )
static

◆ initClasses()

static void SoEvent::initClasses ( )
static

◆ isOfType()

bool SoEvent::isOfType ( SoType  type) const

◆ setAltDown()

void SoEvent::setAltDown ( bool  isDown)
inline

Definition at line 137 of file SoEvent.h.

◆ setCtrlDown()

void SoEvent::setCtrlDown ( bool  isDown)
inline

Definition at line 135 of file SoEvent.h.

◆ setMouseButtonMask()

void SoEvent::setMouseButtonMask ( int  mask)
inline

Definition at line 147 of file SoEvent.h.

◆ setPosition()

void SoEvent::setPosition ( const SbVec2s p)
inline

The position is relative to the lower left corner of the window in which the event occurred.

Definition at line 119 of file SoEvent.h.

◆ setShiftDown()

void SoEvent::setShiftDown ( bool  isDown)
inline

Definition at line 133 of file SoEvent.h.

◆ setTime()

void SoEvent::setTime ( SbTime  t)
inline

Definition at line 112 of file SoEvent.h.

◆ wasAltDown()

bool SoEvent::wasAltDown ( ) const
inline

Definition at line 144 of file SoEvent.h.

◆ wasCtrlDown()

bool SoEvent::wasCtrlDown ( ) const
inline

Definition at line 142 of file SoEvent.h.

◆ wasShiftDown()

bool SoEvent::wasShiftDown ( ) const
inline

Definition at line 140 of file SoEvent.h.


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