Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SoEvent Class Reference

The SoEvent class is the base class for all Coin events. More...

#include <Inventor/events/SoEvent.h>

Inheritance diagram for SoEvent:
SoButtonEvent SoLocation2Event SoMotion3Event SoKeyboardEvent SoMouseButtonEvent SoSpaceballButtonEvent

Public Member Functions

 SoEvent (void)
 
virtual ~SoEvent ()
 
const SbVec2fgetNormalizedPosition (const SbViewportRegion &vpRgn) const
 
const SbVec2sgetPosition (const SbViewportRegion &vpRgn) const
 
const SbVec2sgetPosition (void) const
 
SbTime getTime (void) const
 
virtual SoType getTypeId (void) const
 
SbBool isOfType (SoType type) const
 
void setAltDown (SbBool isDown)
 
void setCtrlDown (SbBool isDown)
 
void setPosition (const SbVec2s &p)
 
void setShiftDown (SbBool isDown)
 
void setTime (const SbTime t)
 
SbBool wasAltDown (void) const
 
SbBool wasCtrlDown (void) const
 
SbBool wasShiftDown (void) const
 

Static Public Member Functions

static SoType getClassTypeId (void)
 
static void initClass (void)
 

Detailed Description

The SoEvent class is the base class for all Coin events.

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 scene graph through an SoHandleEventAction.

Events may be caught by the user by attaching an SoEventCallback node to the scene graph, or they can automatically be handled by a dragger or manipulator in the graph.

See also
SoButtonEvent, SoKeyboardEvent, SoLocation2Event, SoMotion3Event
SoMouseButtonEvent, SoSpaceballButtonEvent
SoEventCallback, SoHandleEventAction

Constructor & Destructor Documentation

◆ SoEvent()

SoEvent::SoEvent ( void )

Constructor, will set all modifiers to "off" state.

◆ ~SoEvent()

SoEvent::~SoEvent ( )
virtual

Destructor.

Member Function Documentation

◆ getClassTypeId()

SoType SoEvent::getClassTypeId ( void )
static

This static method returns the SoType object associated with objects of this class.

This static method returns the SoType object associated with objects of this class.

◆ getNormalizedPosition()

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.

See also
getPosition(), getTime(), wasShiftDown(), wasCtrlDown(), wasAltDown()

◆ getPosition() [1/2]

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.

See also
getNormalizedPosition(), getTime(), wasShiftDown(), wasCtrlDown(),
wasAltDown()

◆ getPosition() [2/2]

const SbVec2s & SoEvent::getPosition ( void ) const

Returns the mouse pointer position when the event occurred. The coordinates are given relative to the window coordinates.

See also
getNormalizedPosition(), getTime(), wasShiftDown(), wasCtrlDown(),
wasAltDown()

◆ getTime()

SbTime SoEvent::getTime ( void ) const

Returns the time the event occurred.

See also
getPosition(), wasShiftDown(), wasCtrlDown(), wasAltDown()

◆ getTypeId()

SoType SoEvent::getTypeId ( void ) const
virtual

Returns the type identification of an object derived from a class inheriting SoEvent. This is used for runtime type checking and "downward" casting.

Returns the actual type id of an instantiated object.

Reimplemented in SoButtonEvent, SoKeyboardEvent, SoLocation2Event, SoMotion3Event, SoMouseButtonEvent, and SoSpaceballButtonEvent.

◆ initClass()

void SoEvent::initClass ( void )
static

Initialize SoEvent and all its 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 is very unlikely that you will have to call it explicitly.

◆ isOfType()

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.

◆ setAltDown()

void SoEvent::setAltDown ( SbBool isDown)

From a system specific device object, set the state of the Alt key(s) when the event occurred.

See also
wasAltDown(), setCtrlDown(), setShiftDown()

◆ setCtrlDown()

void SoEvent::setCtrlDown ( SbBool isDown)

From a system specific device object, set the state of the Ctrl key(s) when the event occurred.

See also
wasCtrlDown(), setShiftDown(), setAltDown()

◆ setPosition()

void SoEvent::setPosition ( const SbVec2s & p)

From a system specific device object, set the mouse pointer position when the event occurred.

See also
getPosition(), getNormalizedPosition()

◆ setShiftDown()

void SoEvent::setShiftDown ( SbBool isDown)

From a system specific device object, set the state of the Shift key(s) when the event occurred.

See also
wasShiftDown(), setCtrlDown(), setAltDown()

◆ setTime()

void SoEvent::setTime ( const SbTime t)

From a system specific device object, set the time the event occurred.

See also
getTime()

◆ wasAltDown()

SbBool SoEvent::wasAltDown ( void ) const

Returns state of Alt key(s) when the event occurred.

See also
wasShiftDown(), wasCtrlDown(), getPosition(), getTime()

◆ wasCtrlDown()

SbBool SoEvent::wasCtrlDown ( void ) const

Returns state of Ctrl key(s) when the event occurred.

See also
wasShiftDown(), wasAltDown(), getPosition(), getTime()

◆ wasShiftDown()

SbBool SoEvent::wasShiftDown ( void ) const

Returns state of Shift key(s) when the event occurred.

See also
wasCtrlDown(), wasAltDown(), getPosition(), getTime()

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