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 whether 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 ()
 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...
 
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...
 
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...
 

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 ()
 Resets the _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 whether 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: