MeVisLab Toolbox Reference
SoInteractionCoordinator Class Reference

Provides a coordinating interface to the SoInteractionHandlers in the scene. More...

#include <SoInteractionCoordinator.h>

Inheritance diagram for SoInteractionCoordinator:
SoInteractionController

Public Member Functions

 SoInteractionCoordinator ()
 
virtual ~SoInteractionCoordinator ()
 
size_t getNumMappers ()
 Returns the number of added mappers, to be used with truncateMappers. More...
 
void addMapper (SoInteractionMapper *mapper)
 Adds an instance to override pointing and command action mappings. More...
 
void clearMappers ()
 Clears the list of mappers. More...
 
void truncateMappers (size_t n=0)
 Truncates the list of mappers to the given number, used for push/pop semantics. More...
 
virtual void setSelectedPointingAction (SoPointingAction *action, SoInteractionHandler *handler, const SoPointerPosition &location, bool allowed=true)
 This method sets the new selected pointing action. More...
 
SoPointingActiongetCurrentPointingAction () const
 Returns the currently selected pointing action. More...
 
SoInteractionHandlergetCurrentPointingActionHandler () const
 Returns the handler for currently selected pointing action. More...
 
bool getCurrentPointingActionAllowed () const
 Returns whether the current pointing action may be applied at the current location. More...
 
void affirmSelectedPointingAction ()
 Affirms currently selected pointing action. More...
 
bool isPointingActionSelected () const
 Finds out whether the pointing action has been set during the current scene graph traversal. More...
 
bool maySelectPointingAction () const
 Returns whether one is even allowed to select a (new) pointing action. More...
 
virtual void setLockedPointingAction (SoPointingAction *action, SoInteractionHandler *handler)
 Setting the locked pointing action with this method ensures that a callback is set to be informed of an external grab release. More...
 
SoPointingActiongetLockedPointingAction ()
 Returns the locked pointing action. More...
 
SoInteractionHandlergetLockedPointingActionHandler ()
 Returns the handler for locked pointing action. More...
 
void grabReleasedByAction (SoPointingAction *action)
 This method is called from a PointingAction if a grab should be released. More...
 
virtual bool isPointingActionActive (SoPointingAction *action, int currentMask)
 This method will be used to override the default action selection mechanism. More...
 
virtual int getModeModifierMask (int numModes)
 Returns a mask that covers all modifier flags that are needed for the given number of drag modes. More...
 
virtual int getModeFromModifiers (int numModes, int modifierMask)
 Returns the mode number to set for a total number of modes and the current modifier mask. More...
 
virtual bool startPress (const SoPointerPosition &position, int modifierMask)
 Starts a mouse button press for current action. More...
 
virtual void endPress (int clickCount)
 Stops a mouse button press for current action. More...
 
virtual bool isDragging ()
 Queries the flag indicating drag action. More...
 
bool isCancelled () const
 This returns true if the current drag action has been canceled. More...
 
void cancelDrag ()
 Cancels the current drag action if this was not done already. More...
 
bool wheelModifiersFitOffsetAction (SoOffsetAction *action, int modifiers, double &sensitivityX, double &sensitivityY, bool &swapAxes)
 Checks whether the current modifiers allow to execute a wheel action; also returns the sensitivity settings associated with the matching trigger. More...
 
void setWheelActionExecuted ()
 Prevents further wheel actions from being executed. More...
 
bool mayExecuteWheelAction () const
 Checks whether it is allowed to execute wheel actions. More...
 
bool keyFitsCommandAction (SoCommandAction *action, int modifiers, SoKeyboardEvent::Key nKey)
 Checks whether a keyboard event fits a certain command action. More...
 
bool keyFitsOffsetAction (SoOffsetAction *action, int modifiers, SoKeyboardEvent::Key nKey, double &sensitivityX, double &sensitivityY, bool &swapAxes)
 Checks whether a keyboard event fits a certain offset action. More...
 
void setKeyboardActionExecuted ()
 Prevents further keyboard actions from being executed. More...
 
bool mayExecuteKeyboardAction () const
 Checks whether it is allowed to execute keyboard actions. More...
 
virtual bool isDragThresholdExceeded () const
 Must be overridden to implement click detection. More...
 
SoPointingAction::TriggerList getTriggers (SoPointingAction *action)
 Returns the current triggers for a pointing action. More...
 
SoCommandAction::ShortcutList getShortcuts (SoCommandAction *action)
 Returns the current shortcuts for a command action. More...
 
SoOffsetAction::TriggerList getTriggers (SoOffsetAction *action)
 Returns current triggers for an offset action. More...
 

Protected Member Functions

virtual void setDragging (bool dragging)
 Sets the flag indicating drag action. More...
 
void unsetPointingActionSelected ()
 Resets the _pointingActionSelected flag (before traversing the scene). More...
 

Protected Attributes

bool _maySelectPointingAction
 
bool _mayExecuteKeyboardAction
 
bool _mayExecuteWheelAction
 

Detailed Description

Provides a coordinating interface to the SoInteractionHandlers in the scene.

Definition at line 34 of file SoInteractionCoordinator.h.

Constructor & Destructor Documentation

◆ SoInteractionCoordinator()

SoInteractionCoordinator::SoInteractionCoordinator ( )

◆ ~SoInteractionCoordinator()

virtual SoInteractionCoordinator::~SoInteractionCoordinator ( )
virtual

Member Function Documentation

◆ addMapper()

void SoInteractionCoordinator::addMapper ( SoInteractionMapper mapper)

Adds an instance to override pointing and command action mappings.

Earlier mappings will override later mappings. The mappers will still be owned by the caller.

◆ affirmSelectedPointingAction()

void SoInteractionCoordinator::affirmSelectedPointingAction ( )
inline

Affirms currently selected pointing action.

This prevents other nodes from changing the action without doing anything else.

Definition at line 74 of file SoInteractionCoordinator.h.

◆ cancelDrag()

void SoInteractionCoordinator::cancelDrag ( )

Cancels the current drag action if this was not done already.

This will be reset when all mouse buttons are relased.

◆ clearMappers()

void SoInteractionCoordinator::clearMappers ( )

Clears the list of mappers.

◆ endPress()

virtual void SoInteractionCoordinator::endPress ( int  clickCount)
virtual

Stops a mouse button press for current action.

◆ getCurrentPointingAction()

SoPointingAction* SoInteractionCoordinator::getCurrentPointingAction ( ) const
inline

Returns the currently selected pointing action.

Definition at line 64 of file SoInteractionCoordinator.h.

◆ getCurrentPointingActionAllowed()

bool SoInteractionCoordinator::getCurrentPointingActionAllowed ( ) const
inline

Returns whether the current pointing action may be applied at the current location.

Definition at line 70 of file SoInteractionCoordinator.h.

◆ getCurrentPointingActionHandler()

SoInteractionHandler* SoInteractionCoordinator::getCurrentPointingActionHandler ( ) const
inline

Returns the handler for currently selected pointing action.

Definition at line 67 of file SoInteractionCoordinator.h.

◆ getLockedPointingAction()

SoPointingAction* SoInteractionCoordinator::getLockedPointingAction ( )
inline

Returns the locked pointing action.

Definition at line 88 of file SoInteractionCoordinator.h.

◆ getLockedPointingActionHandler()

SoInteractionHandler* SoInteractionCoordinator::getLockedPointingActionHandler ( )
inline

Returns the handler for locked pointing action.

Definition at line 91 of file SoInteractionCoordinator.h.

◆ getModeFromModifiers()

virtual int SoInteractionCoordinator::getModeFromModifiers ( int  numModes,
int  modifierMask 
)
virtual

Returns the mode number to set for a total number of modes and the current modifier mask.

Can be overridden to change the modifier handling.

◆ getModeModifierMask()

virtual int SoInteractionCoordinator::getModeModifierMask ( int  numModes)
virtual

Returns a mask that covers all modifier flags that are needed for the given number of drag modes.

Can be overridden to change the modifier handling.

◆ getNumMappers()

size_t SoInteractionCoordinator::getNumMappers ( )

Returns the number of added mappers, to be used with truncateMappers.

◆ getShortcuts()

SoCommandAction::ShortcutList SoInteractionCoordinator::getShortcuts ( SoCommandAction action)

Returns the current shortcuts for a command action.

◆ getTriggers() [1/2]

SoOffsetAction::TriggerList SoInteractionCoordinator::getTriggers ( SoOffsetAction action)

Returns current triggers for an offset action.

◆ getTriggers() [2/2]

SoPointingAction::TriggerList SoInteractionCoordinator::getTriggers ( SoPointingAction action)

Returns the current triggers for a pointing action.

◆ grabReleasedByAction()

void SoInteractionCoordinator::grabReleasedByAction ( SoPointingAction action)

This method is called from a PointingAction if a grab should be released.

◆ isCancelled()

bool SoInteractionCoordinator::isCancelled ( ) const
inline

This returns true if the current drag action has been canceled.

Definition at line 118 of file SoInteractionCoordinator.h.

◆ isDragging()

virtual bool SoInteractionCoordinator::isDragging ( )
inlinevirtual

Queries the flag indicating drag action.

Definition at line 115 of file SoInteractionCoordinator.h.

◆ isDragThresholdExceeded()

virtual bool SoInteractionCoordinator::isDragThresholdExceeded ( ) const
inlinevirtual

Must be overridden to implement click detection.

Reimplemented in SoInteractionController.

Definition at line 150 of file SoInteractionCoordinator.h.

◆ isPointingActionActive()

virtual bool SoInteractionCoordinator::isPointingActionActive ( SoPointingAction action,
int  currentMask 
)
virtual

This method will be used to override the default action selection mechanism.

◆ isPointingActionSelected()

bool SoInteractionCoordinator::isPointingActionSelected ( ) const
inline

Finds out whether the pointing action has been set during the current scene graph traversal.

Definition at line 78 of file SoInteractionCoordinator.h.

◆ keyFitsCommandAction()

bool SoInteractionCoordinator::keyFitsCommandAction ( SoCommandAction action,
int  modifiers,
SoKeyboardEvent::Key  nKey 
)

Checks whether a keyboard event fits a certain command action.

◆ keyFitsOffsetAction()

bool SoInteractionCoordinator::keyFitsOffsetAction ( SoOffsetAction action,
int  modifiers,
SoKeyboardEvent::Key  nKey,
double &  sensitivityX,
double &  sensitivityY,
bool &  swapAxes 
)

Checks whether a keyboard event fits a certain offset action.

◆ mayExecuteKeyboardAction()

bool SoInteractionCoordinator::mayExecuteKeyboardAction ( ) const
inline

Checks whether it is allowed to execute keyboard actions.

Definition at line 147 of file SoInteractionCoordinator.h.

◆ mayExecuteWheelAction()

bool SoInteractionCoordinator::mayExecuteWheelAction ( ) const
inline

Checks whether it is allowed to execute wheel actions.

Definition at line 133 of file SoInteractionCoordinator.h.

◆ maySelectPointingAction()

bool SoInteractionCoordinator::maySelectPointingAction ( ) const
inline

Returns whether one is even allowed to select a (new) pointing action.

Definition at line 81 of file SoInteractionCoordinator.h.

◆ setDragging()

virtual void SoInteractionCoordinator::setDragging ( bool  dragging)
protectedvirtual

Sets the flag indicating drag action.

Reimplemented in SoInteractionController.

◆ setKeyboardActionExecuted()

void SoInteractionCoordinator::setKeyboardActionExecuted ( )
inline

Prevents further keyboard actions from being executed.

Definition at line 144 of file SoInteractionCoordinator.h.

◆ setLockedPointingAction()

virtual void SoInteractionCoordinator::setLockedPointingAction ( SoPointingAction action,
SoInteractionHandler handler 
)
virtual

Setting the locked pointing action with this method ensures that a callback is set to be informed of an external grab release.

◆ setSelectedPointingAction()

virtual void SoInteractionCoordinator::setSelectedPointingAction ( SoPointingAction action,
SoInteractionHandler handler,
const SoPointerPosition location,
bool  allowed = true 
)
virtual

This method sets the new selected pointing action.

The location is given so that the action can update its highlighting.

◆ setWheelActionExecuted()

void SoInteractionCoordinator::setWheelActionExecuted ( )
inline

Prevents further wheel actions from being executed.

Definition at line 130 of file SoInteractionCoordinator.h.

◆ startPress()

virtual bool SoInteractionCoordinator::startPress ( const SoPointerPosition position,
int  modifierMask 
)
virtual

Starts a mouse button press for current action.

◆ truncateMappers()

void SoInteractionCoordinator::truncateMappers ( size_t  n = 0)

Truncates the list of mappers to the given number, used for push/pop semantics.

The mappers are not freed!

◆ unsetPointingActionSelected()

void SoInteractionCoordinator::unsetPointingActionSelected ( )
inlineprotected

Resets the _pointingActionSelected flag (before traversing the scene).

Definition at line 167 of file SoInteractionCoordinator.h.

◆ wheelModifiersFitOffsetAction()

bool SoInteractionCoordinator::wheelModifiersFitOffsetAction ( SoOffsetAction action,
int  modifiers,
double &  sensitivityX,
double &  sensitivityY,
bool &  swapAxes 
)

Checks whether the current modifiers allow to execute a wheel action; also returns the sensitivity settings associated with the matching trigger.

Member Data Documentation

◆ _mayExecuteKeyboardAction

bool SoInteractionCoordinator::_mayExecuteKeyboardAction
protected

Definition at line 173 of file SoInteractionCoordinator.h.

◆ _mayExecuteWheelAction

bool SoInteractionCoordinator::_mayExecuteWheelAction
protected

Definition at line 176 of file SoInteractionCoordinator.h.

◆ _maySelectPointingAction

bool SoInteractionCoordinator::_maySelectPointingAction
protected

Definition at line 170 of file SoInteractionCoordinator.h.


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