MeVisLab Toolbox Reference
SoInteractionController Class Reference

SoInteractionController is the controlling instance of managed interactions. More...

#include <SoInteractionController.h>

Inheritance diagram for SoInteractionController:
SoInteractionCoordinator

Public Member Functions

 SoInteractionController ()
 Default constructor. More...
 
 ~SoInteractionController () override
 Destructor. More...
 
void handleEvent (SoHandleEventAction *action) override
 Handles the mouse and keyboard events and send them to interaction nodes. More...
 
bool isDragThresholdExceeded () const override
 Return if the drag threshold was exceeded, that is, endPress will get a clickCount of 0. More...
 
- Public Member Functions inherited from SoInteractionCoordinator
 SoInteractionCoordinator ()
 
virtual ~SoInteractionCoordinator ()
 
size_t getNumMappers ()
 Return number of added mappers, to be used with truncateMappers. More...
 
void addMapper (SoInteractionMapper *mapper)
 Add an instance to override pointing and command action mappings. More...
 
void clearMappers ()
 Clear list of mappers. More...
 
void truncateMappers (size_t n=0)
 Truncate list of mappers to the given number, used for push/pop semantics. More...
 
SoPointingActiongetCurrentPointingAction () const
 Get currently selected pointing action. More...
 
SoInteractionHandlergetCurrentPointingActionHandler () const
 Get handler for currently selected pointing action. More...
 
bool getCurrentPointingActionAllowed () const
 Get if the current pointing action may be applied at the current location. More...
 
void affirmSelectedPointingAction ()
 Affirm currently selected pointing action (this prevents other nodes from changing the action without doing anything else) More...
 
bool isPointingActionSelected () const
 Find out whether the pointing action has been set during the current scene graph traversal. More...
 
bool maySelectPointingAction () const
 Return 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 ()
 Get locked pointing action. More...
 
SoInteractionHandlergetLockedPointingActionHandler ()
 Get 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)
 Return 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)
 Get mode number to set for a total number of modes and the current modifier mask. More...
 
virtual bool startPress (const SoPointerPosition &position, int modifierMask)
 Start mouse button press for current action. More...
 
virtual void endPress (int clickCount)
 Stop mouse button press for current action. More...
 
virtual bool isDragging ()
 Query flag indicating drag action. More...
 
bool isCancelled () const
 This returns true if the current drag action has been cancelled. More...
 
void cancelDrag ()
 Cancel the current drag action (if this wasn't done already). More...
 
bool wheelModifiersFitOffsetAction (SoOffsetAction *action, int modifiers, double &sensitivityX, double &sensitivityY, bool &swapAxes)
 Check if the current modifiers allow to execute a wheel action; also returns the sensitivity settings associated with the matching trigger. More...
 
void setWheelActionExecuted ()
 Prevent further wheel actions from being executed. More...
 
bool mayExecuteWheelAction () const
 Check if it is allowed to execute wheel actions. More...
 
bool keyFitsCommandAction (SoCommandAction *action, int modifiers, SoKeyboardEvent::Key nKey)
 Check if a keyboard event fits a certain command action. More...
 
bool keyFitsOffsetAction (SoOffsetAction *action, int modifiers, SoKeyboardEvent::Key nKey, double &sensitivityX, double &sensitivityY, bool &swapAxes)
 Check if a keyboard event fits a certain offset action. More...
 
void setKeyboardActionExecuted ()
 Prevent further keyboard actions from being executed. More...
 
bool mayExecuteKeyboardAction () const
 Check if it is allowed to execute keyboard actions. More...
 
SoPointingAction::TriggerList getTriggers (SoPointingAction *action)
 get current triggers for a pointing action More...
 
SoCommandAction::ShortcutList getShortcuts (SoCommandAction *action)
 get current shortcuts for a command action More...
 
SoOffsetAction::TriggerList getTriggers (SoOffsetAction *action)
 get current triggers for an offset action More...
 

Static Public Member Functions

static void initClass ()
 Initialization of the inventor runtime type system. More...
 

Public Attributes

SoSFString activePointingAction
 This field contains the id of the pointing action that would be activated on left mouse click or which is currently active (dragging). More...
 
SoSFString activePointingActionProvider
 This field contains the id of the provider of the pointing action. More...
 
SoSFBool inDrag
 This flag is true if an pointer action is active (dragging). More...
 
SoSFString activePointingActionStatus
 Status string returned by the pointing action indicated by activePointerAction. More...
 
SoSFBool enableMouseHandling
 If this flag is false, no pointing actions are enabled. More...
 
SoSFBool enableKeyHandling
 If this flag is false, no command actions will be executed when a key is pressed. More...
 
SoSFBool enableWheelHandling
 If this flag is false, no offset actions will be executed when the mouse wheel is rotated. More...
 

Protected Member Functions

void setDragging (bool dragging=true) override
 Method inherited from SoInteractionCoordinator, overridden to update the inDrag field. More...
 
- Protected Member Functions inherited from SoInteractionCoordinator
void unsetPointingActionSelected ()
 reset _pointingActionSelected flag (before traversing the scene) More...
 

Additional Inherited Members

- Protected Attributes inherited from SoInteractionCoordinator
bool _maySelectPointingAction
 
bool _mayExecuteKeyboardAction
 
bool _mayExecuteWheelAction
 

Detailed Description

SoInteractionController is the controlling instance of managed interactions.

It should be instantiated by the viewer and contain the remaining scene graph. SoInteractionController will pass itself as a SoInteractionCoordinator through the SoInteractionCoordinatorElement into the scene, where it can be queried e.g. by SoInteractionHandlers. SoInteractionController is the controlling instance of managed interactions. It should be instantiated by the viewer and contain the remaining scene graph. SoInteractionController will pass itself as a SoInteractionCoordinator through the SoInteractionCoordinatorElement into the scene, where it can be queried e.g. by SoInteractionHandlers.

Definition at line 46 of file SoInteractionController.h.

Constructor & Destructor Documentation

◆ SoInteractionController()

SoInteractionController::SoInteractionController ( )

Default constructor.

◆ ~SoInteractionController()

SoInteractionController::~SoInteractionController ( )
override

Destructor.

Member Function Documentation

◆ handleEvent()

void SoInteractionController::handleEvent ( SoHandleEventAction *  action)
override

Handles the mouse and keyboard events and send them to interaction nodes.

◆ initClass()

static void SoInteractionController::initClass ( )
static

Initialization of the inventor runtime type system.

◆ isDragThresholdExceeded()

bool SoInteractionController::isDragThresholdExceeded ( ) const
inlineoverridevirtual

Return if the drag threshold was exceeded, that is, endPress will get a clickCount of 0.

Reimplemented from SoInteractionCoordinator.

Definition at line 88 of file SoInteractionController.h.

◆ setDragging()

void SoInteractionController::setDragging ( bool  dragging = true)
overrideprotectedvirtual

Method inherited from SoInteractionCoordinator, overridden to update the inDrag field.

Reimplemented from SoInteractionCoordinator.

Member Data Documentation

◆ activePointingAction

SoSFString SoInteractionController::activePointingAction

This field contains the id of the pointing action that would be activated on left mouse click or which is currently active (dragging).

Definition at line 64 of file SoInteractionController.h.

◆ activePointingActionProvider

SoSFString SoInteractionController::activePointingActionProvider

This field contains the id of the provider of the pointing action.

Definition at line 67 of file SoInteractionController.h.

◆ activePointingActionStatus

SoSFString SoInteractionController::activePointingActionStatus

Status string returned by the pointing action indicated by activePointerAction.

Definition at line 73 of file SoInteractionController.h.

◆ enableKeyHandling

SoSFBool SoInteractionController::enableKeyHandling

If this flag is false, no command actions will be executed when a key is pressed.

Definition at line 79 of file SoInteractionController.h.

◆ enableMouseHandling

SoSFBool SoInteractionController::enableMouseHandling

If this flag is false, no pointing actions are enabled.

Definition at line 76 of file SoInteractionController.h.

◆ enableWheelHandling

SoSFBool SoInteractionController::enableWheelHandling

If this flag is false, no offset actions will be executed when the mouse wheel is rotated.

Definition at line 82 of file SoInteractionController.h.

◆ inDrag

SoSFBool SoInteractionController::inDrag

This flag is true if an pointer action is active (dragging).

Definition at line 70 of file SoInteractionController.h.


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