Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoEvent Class Reference

Base class for all events. More...

#include <Inventor/events/SoEvent.h>

+ Inheritance diagram for SoEvent:

Public Member Functions

 SoEvent ()
 Constructor.
 
virtual ~SoEvent ()
 Destructor.
 
virtual SoType getTypeId () const
 Returns the type id for this event instance.
 
virtual void setTime (SbTime t)
 Sets the time at which the event occurred.
 
SbTime getTime () const
 Gets the time at which the event occurred.
 
virtual void setPosition (const SbVec2s &p)
 Sets the window pixel location of the cursor when the event occurred.
 
virtual void setPosition (const SbVec2f &p)
 Float version of setPosition(const SbVec2s &p).
 
const SbVec2sgetPosition () const
 Returns the window pixel location of the cursor when the event occurred as integer values.
 
const SbVec2fgetPositionFloat () const
 Returns the window pixel location of the cursor when the event occurred as float values.
 
const SbVec2sgetPosition (const SbViewportRegion &vpRgn) const
 Gets the viewport pixel location of the cursor when the event occurred, relative to the origin of the specified viewport region, as integer values.
 
const SbVec2fgetPositionFloat (const SbViewportRegion &vpRgn) const
 Gets the viewport pixel location of the cursor when the event occurred, relative to the origin of the specified viewport region, as float values.
 
const SbVec2fgetNormalizedPosition (const SbViewportRegion &vpRgn) const
 Gets the normalized location of the cursor when the event occurred, relative to the specified viewport region.
 
void setShiftDown (SbBool isDown)
 Sets whether the shift key was down when the event occurred.
 
void setCtrlDown (SbBool isDown)
 Sets whether the CTRL key was down when the event occurred.
 
void setAltDown (SbBool isDown)
 Sets whether the ALT key was down when the event occurred.
 
void setButton1Down (SbBool isDown)
 Sets whether mouse Button 1 was down when the event occurred.
 
SbBool wasShiftDown () const
 Returns true if the shift key was down when the event occurred.
 
SbBool wasCtrlDown () const
 Returns true if the CTRL key was down when the event occurred.
 
SbBool wasAltDown () const
 Returns true if the ALT key was down when the event occurred.
 
SbBool wasButton1Down () const
 Returns true if mouse button 1 was down when the event occurred.
 
virtual const SbTrackerInfogetTrackerInfo () const
 Gets whether an event object has associated tracker information.
 
SbTrackerInfogetTrackerInfo ()
 Gets whether an event object has associated tracker information.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type id for the SoEvent class.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Detailed Description

Base class for all events.

SoEvent is the base class for events in the Open 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 Open 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.

The virtual method SoEvent::getTrackerInfo() can be used to determine if an event object has associated 3D tracker information. Traditional 2D events like SoMouseButtonEvent and SoLocation2Event return NULL. 3D events like SoTrackerEvent and SoControllerButtonEvent return their associated tracker information (SbTrackerInfo).

Add an SoEventCallback node to the scene graph to handle Open Inventor events.

Events are delivered to the scene graph using an SoHandleEventAction.

The Open Inventor viewer classes automatically convert system events to Open Inventor event objects and send those event objects to the scene graph using an instance of SoSceneManager. SoSceneManager automatically creates and applies an SoHandleEventAction.

Similarly, the RemoteViz RenderArea class converts events coming from the RemoteViz client to Open Inventor event objects and sends those events to the scene graph using an instance of SoSceneManager.

Applications may create synthetic events and send them to the scene graph. Get the SoSceneManager object from the render area and call processEvent().

SEE ALSO

SoButtonEvent, SoControllerButtonEvent, SoKeyboardEvent, SoLocation2Event, SoMotion3Event, SoMouseButtonEvent, SoSpaceballButtonEvent, SoTrackerEvent, SoHandleEventAction, SoEventCallback, SoSelection, SoInteraction, SoWinDevice, SoWinRenderArea, SoTouchEvent, SoGestureEvent

Definition at line 116 of file SoEvent.h.

Constructor & Destructor Documentation

◆ SoEvent()

SoEvent::SoEvent ( )

Constructor.

◆ ~SoEvent()

virtual SoEvent::~SoEvent ( )
virtual

Destructor.

Member Function Documentation

◆ getClassTypeId()

static SoType SoEvent::getClassTypeId ( )
static

Returns the type id for the SoEvent class.

◆ getNormalizedPosition()

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

Gets the normalized location of the cursor when the event occurred, relative to the specified viewport region.

The returned value will lie between 0.0 and 1.0.

Position should be set for all events, but that may not be possible for some events in some display environments. If position was not available, the method returns 0,0.

◆ getPosition() [1/2]

const SbVec2s & SoEvent::getPosition ( ) const
inline

Returns the window pixel location of the cursor when the event occurred as integer values.

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

Position should be set for all events, but that may not be possible for some events in some display environments. If position was not available, the method returns 0,0.

Definition at line 174 of file SoEvent.h.

◆ getPosition() [2/2]

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

Gets the viewport pixel location of the cursor when the event occurred, relative to the origin of the specified viewport region, as integer values.

Position should be set for all events, but that may not be possible for some events in some display environments. If position was not available, the method returns the viewport origin.

◆ getPositionFloat() [1/2]

const SbVec2f & SoEvent::getPositionFloat ( ) const
inline

Returns the window pixel location of the cursor when the event occurred as float values.

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

Position should be set for all events, but that may not be possible for some events in some display environments. If position was not available, the method returns 0,0.

Definition at line 185 of file SoEvent.h.

◆ getPositionFloat() [2/2]

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

Gets the viewport pixel location of the cursor when the event occurred, relative to the origin of the specified viewport region, as float values.

Position should be set for all events, but that may not be possible for some events in some display environments. If position was not available, the method returns the viewport origin.

◆ getTime()

SbTime SoEvent::getTime ( ) const
inline

Gets the time at which the event occurred.

Definition at line 145 of file SoEvent.h.

◆ getTrackerInfo() [1/2]

SbTrackerInfo * SoEvent::getTrackerInfo ( )
inline

Gets whether an event object has associated tracker information.

Definition at line 290 of file SoEvent.h.

◆ getTrackerInfo() [2/2]

virtual const SbTrackerInfo * SoEvent::getTrackerInfo ( ) const
inlinevirtual

Gets whether an event object has associated tracker information.

Reimplemented in SoControllerButtonEvent, SoControllerButtonEvent, SoTrackerEvent, and SoTrackerEvent.

Definition at line 255 of file SoEvent.h.

◆ getTypeId()

◆ setAltDown()

void SoEvent::setAltDown ( SbBool  isDown)
inline

Sets whether the ALT key was down when the event occurred.

Definition at line 228 of file SoEvent.h.

◆ setButton1Down()

void SoEvent::setButton1Down ( SbBool  isDown)
inline

Sets whether mouse Button 1 was down when the event occurred.

Definition at line 232 of file SoEvent.h.

◆ setCtrlDown()

void SoEvent::setCtrlDown ( SbBool  isDown)
inline

Sets whether the CTRL key was down when the event occurred.

Definition at line 224 of file SoEvent.h.

◆ setPosition() [1/2]

virtual void SoEvent::setPosition ( const SbVec2f p)
inlinevirtual

Float version of setPosition(const SbVec2s &p).

It can be used when a desktop is magnified on a wall of screens using ScaleViz with a tracker device calibrated for this wall.

Reimplemented in SoTouchEvent.

Definition at line 160 of file SoEvent.h.

◆ setPosition() [2/2]

virtual void SoEvent::setPosition ( const SbVec2s p)
inlinevirtual

Sets the window pixel location of the cursor when the event occurred.

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

Reimplemented in SoTouchEvent.

Definition at line 152 of file SoEvent.h.

◆ setShiftDown()

void SoEvent::setShiftDown ( SbBool  isDown)
inline

Sets whether the shift key was down when the event occurred.

Definition at line 220 of file SoEvent.h.

◆ setTime()

virtual void SoEvent::setTime ( SbTime  t)
inlinevirtual

Sets the time at which the event occurred.

Reimplemented in SoTouchEvent.

Definition at line 141 of file SoEvent.h.

◆ wasAltDown()

SbBool SoEvent::wasAltDown ( ) const
inline

Returns true if the ALT key was down when the event occurred.

Definition at line 245 of file SoEvent.h.

◆ wasButton1Down()

SbBool SoEvent::wasButton1Down ( ) const
inline

Returns true if mouse button 1 was down when the event occurred.

Definition at line 249 of file SoEvent.h.

◆ wasCtrlDown()

SbBool SoEvent::wasCtrlDown ( ) const
inline

Returns true if the CTRL key was down when the event occurred.

Definition at line 241 of file SoEvent.h.

◆ wasShiftDown()

SbBool SoEvent::wasShiftDown ( ) const
inline

Returns true if the shift key was down when the event occurred.

Definition at line 237 of file SoEvent.h.


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