Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
SoEventManager Class Reference

The SoEventManager class provides event handling for a Coin3D viewer. More...

#include <Inventor/SoEventManager.h>

Public Types


Public Member Functions

virtual ~SoEventManager ()
virtual void setSceneGraph (SoNode *const sceneroot)
virtual SoNodegetSceneGraph (void) const
virtual void setCamera (SoCamera *camera)
virtual SoCameragetCamera (void) const
virtual SbBool processEvent (const SoEvent *const event)
virtual void setNavigationState (NavigationState state)
virtual NavigationState getNavigationState (void) const
int getNumSoScXMLStateMachines (void) const
SoScXMLStateMachinegetSoScXMLStateMachine (int idx) const
void addSoScXMLStateMachine (SoScXMLStateMachine *sm)
void removeSoScXMLStateMachine (SoScXMLStateMachine *sm)
virtual void setSize (const SbVec2s &newsize)
virtual void setOrigin (const SbVec2s &newOrigin)
virtual void setViewportRegion (const SbViewportRegion &newregion)
const SbViewportRegiongetViewportRegion (void) const
virtual void setHandleEventAction (SoHandleEventAction *hea)
virtual SoHandleEventActiongetHandleEventAction (void) const

Protected Member Functions

virtual SbBool actuallyProcessEvent (const SoEvent *const event)

Detailed Description

The SoEventManager class provides event handling for a Coin3D viewer.

It receives Coin events (typically translated from GUI events by the GUI binding in use) and passes them to the state machine or directly to the scene graph depending on the navigation mode. SoEventManager implements the event interface for the Coin3D navigation system based on ScXML. SoEventManager and SoRenderManager together supersede SoSceneManager, which is now just a wrapper around these classes. The class is used by the QuarterWidget in Quarter (the Qt binding for Coin3D).

Member Enumeration Documentation

◆ NavigationState

Sets how events are handled.


Forwards the events only to the scene graph.


Forwards the events only to the state machines.


Forwards the events to the scene graph first. If it does not get handled, the events get forwarded to the state machines.

Constructor & Destructor Documentation

◆ ~SoEventManager()

SoEventManager::~SoEventManager ( )


The destructor destructs all subobjects it still has handles on when invoked.

Member Function Documentation

◆ setSceneGraph()

void SoEventManager::setSceneGraph ( SoNode *const  sceneroot)

Set the node which is top of the scene graph we're managing. The sceneroot node reference count will be increased by 1, and any previously set scene graph top node will have its reference count decreased by 1.

See also

◆ getSceneGraph()

SoNode * SoEventManager::getSceneGraph ( void  ) const

Returns pointer to root of scene graph.

◆ setCamera()

void SoEventManager::setCamera ( SoCamera camera)

Sets the camera to be used.

◆ getCamera()

SoCamera * SoEventManager::getCamera ( void  ) const

Returns the current camera.

◆ processEvent()

SbBool SoEventManager::processEvent ( const SoEvent *const  event)

Handles the event. Depending on the navigation state, this forwards the event to the state machines and/or the scene graph.

◆ setNavigationState()

void SoEventManager::setNavigationState ( NavigationState  state)

This method sets the navigation mode of the scene manager. The navigation mode decides the system the user uses to navigate the 3D model.

SoEventManager::NO_NAVIGATION is the default setting.

See also
SoEventManager::NavigationState, getNavigationState

◆ getNavigationState()

SoEventManager::NavigationState SoEventManager::getNavigationState ( void  ) const

This method returns which state the camera navigation system is in.

See also
SoEventManager::NavigationState, setNavigationState

◆ getNumSoScXMLStateMachines()

int SoEventManager::getNumSoScXMLStateMachines ( void  ) const

Returns the number of SCXML state machines registered on the SoEventManager object.

◆ getSoScXMLStateMachine()

SoScXMLStateMachine * SoEventManager::getSoScXMLStateMachine ( int  idx) const

Returns the pointer to the Nth (idx) SCXML state machine registered on the SoSceneManager object.

The idx argument must be a valid index, not outside the actual range of SCXML state machine object indices.

◆ addSoScXMLStateMachine()

void SoEventManager::addSoScXMLStateMachine ( SoScXMLStateMachine sm)

Adds an SCXML state machine object to the SoEventManager's event pipeline.

The calling code is responsible for deleting the passed in state machine after removeSoScXMLStateMachine() has been invoked.

(Note: this behavior changed between Coin 3.1 and later, as the SoEventManager used to destruct the state machines upon its own destruction.)

◆ removeSoScXMLStateMachine()

void SoEventManager::removeSoScXMLStateMachine ( SoScXMLStateMachine sm)

Removes the SoSceneManager object reference to an SCXML state machine. It will just be removed, not destructed.

If no reference to the given SCXML state machine exists, nothing will happen.

◆ setSize()

void SoEventManager::setSize ( const SbVec2s newsize)

Set size of rendering area for the viewport within the current window.

◆ setOrigin()

void SoEventManager::setOrigin ( const SbVec2s newOrigin)

Set only the origin of the viewport region within the rendering window.

See also
setViewportRegion(), setWindowSize()

◆ setViewportRegion()

void SoEventManager::setViewportRegion ( const SbViewportRegion newregion)

Sets the current viewport region. This will overwrite the default viewport region created in the constructor.

See also

◆ getViewportRegion()

const SbViewportRegion & SoEventManager::getViewportRegion ( void  ) const

Returns the viewport region used by the event manager.

◆ setHandleEventAction()

void SoEventManager::setHandleEventAction ( SoHandleEventAction handleeventaction)

Set the action to use for event handling. Overrides the default action made in the constructor.

◆ getHandleEventAction()

SoHandleEventAction * SoEventManager::getHandleEventAction ( void  ) const

Returns pointer to event handler action.

◆ actuallyProcessEvent()

SbBool SoEventManager::actuallyProcessEvent ( const SoEvent *const  event)

Forwards the event to the scene graph.

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