MeVisLab Toolbox Reference
|
Provides a coordinating interface to the SoInteractionHandlers in the scene. More...
#include <SoInteractionCoordinator.h>
Public Member Functions | |
SoInteractionCoordinator () | |
virtual | ~SoInteractionCoordinator () |
size_t | getNumMappers () |
Returns the number of added mappers, to be used with truncateMappers. | |
void | addMapper (SoInteractionMapper *mapper) |
Adds an instance to override pointing and command action mappings. | |
void | clearMappers () |
Clears the list of mappers. | |
void | truncateMappers (size_t n=0) |
Truncates the list of mappers to the given number, used for push/pop semantics. | |
virtual void | setSelectedPointingAction (SoPointingAction *action, SoInteractionHandler *handler, const SoPointerPosition &location, bool allowed=true) |
This method sets the new selected pointing action. | |
SoPointingAction * | getCurrentPointingAction () const |
Returns the currently selected pointing action. | |
SoInteractionHandler * | getCurrentPointingActionHandler () const |
Returns the handler for currently selected pointing action. | |
bool | getCurrentPointingActionAllowed () const |
Returns whether the current pointing action may be applied at the current location. | |
void | affirmSelectedPointingAction () |
Affirms currently selected pointing action. | |
bool | isPointingActionSelected () const |
Finds out whether the pointing action has been set during the current scene graph traversal. | |
bool | maySelectPointingAction () const |
Returns whether one is even allowed to select a (new) pointing action. | |
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. | |
SoPointingAction * | getLockedPointingAction () |
Returns the locked pointing action. | |
SoInteractionHandler * | getLockedPointingActionHandler () |
Returns the handler for locked pointing action. | |
void | grabReleasedByAction (SoPointingAction *action) |
This method is called from a PointingAction if a grab should be released. | |
virtual bool | isPointingActionActive (SoPointingAction *action, int currentMask) |
This method will be used to override the default action selection mechanism. | |
virtual int | getModeModifierMask (int numModes) |
Returns a mask that covers all modifier flags that are needed for the given number of drag modes. | |
virtual int | getModeFromModifiers (int numModes, int modifierMask) |
Returns the mode number to set for a total number of modes and the current modifier mask. | |
virtual bool | startPress (const SoPointerPosition &position, int modifierMask) |
Starts a mouse button press for current action. | |
virtual void | endPress (int clickCount) |
Stops a mouse button press for current action. | |
virtual bool | isDragging () |
Queries the flag indicating drag action. | |
bool | isCancelled () const |
This returns true if the current drag action has been canceled. | |
void | cancelDrag () |
Cancels the current drag action if this was not done already. | |
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. | |
void | setWheelActionExecuted () |
Prevents further wheel actions from being executed. | |
bool | mayExecuteWheelAction () const |
Checks whether it is allowed to execute wheel actions. | |
bool | keyFitsCommandAction (SoCommandAction *action, int modifiers, SoKeyboardEvent::Key nKey) |
Checks whether a keyboard event fits a certain command action. | |
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. | |
void | setKeyboardActionExecuted () |
Prevents further keyboard actions from being executed. | |
bool | mayExecuteKeyboardAction () const |
Checks whether it is allowed to execute keyboard actions. | |
virtual bool | isDragThresholdExceeded () const |
Must be overridden to implement click detection. | |
SoPointingAction::TriggerList | getTriggers (SoPointingAction *action) |
Returns the current triggers for a pointing action. | |
SoCommandAction::ShortcutList | getShortcuts (SoCommandAction *action) |
Returns the current shortcuts for a command action. | |
SoOffsetAction::TriggerList | getTriggers (SoOffsetAction *action) |
Returns current triggers for an offset action. | |
Protected Member Functions | |
virtual void | setDragging (bool dragging) |
Sets the flag indicating drag action. | |
void | unsetPointingActionSelected () |
Resets the _pointingActionSelected flag (before traversing the scene). | |
Protected Attributes | |
bool | _maySelectPointingAction |
bool | _mayExecuteKeyboardAction |
bool | _mayExecuteWheelAction |
Provides a coordinating interface to the SoInteractionHandlers in the scene.
Definition at line 34 of file SoInteractionCoordinator.h.
SoInteractionCoordinator::SoInteractionCoordinator | ( | ) |
|
virtual |
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.
|
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.
void SoInteractionCoordinator::cancelDrag | ( | ) |
Cancels the current drag action if this was not done already.
This will be reset when all mouse buttons are relased.
void SoInteractionCoordinator::clearMappers | ( | ) |
Clears the list of mappers.
Stops a mouse button press for current action.
|
inline |
Returns the currently selected pointing action.
Definition at line 64 of file SoInteractionCoordinator.h.
|
inline |
Returns whether the current pointing action may be applied at the current location.
Definition at line 70 of file SoInteractionCoordinator.h.
|
inline |
Returns the handler for currently selected pointing action.
Definition at line 67 of file SoInteractionCoordinator.h.
|
inline |
Returns the locked pointing action.
Definition at line 88 of file SoInteractionCoordinator.h.
|
inline |
Returns the handler for locked pointing action.
Definition at line 91 of file SoInteractionCoordinator.h.
|
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.
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.
size_t SoInteractionCoordinator::getNumMappers | ( | ) |
Returns the number of added mappers, to be used with truncateMappers.
SoCommandAction::ShortcutList SoInteractionCoordinator::getShortcuts | ( | SoCommandAction * | action | ) |
Returns the current shortcuts for a command action.
SoOffsetAction::TriggerList SoInteractionCoordinator::getTriggers | ( | SoOffsetAction * | action | ) |
Returns current triggers for an offset action.
SoPointingAction::TriggerList SoInteractionCoordinator::getTriggers | ( | SoPointingAction * | action | ) |
Returns the current triggers for a pointing action.
void SoInteractionCoordinator::grabReleasedByAction | ( | SoPointingAction * | action | ) |
This method is called from a PointingAction if a grab should be released.
|
inline |
This returns true if the current drag action has been canceled.
Definition at line 118 of file SoInteractionCoordinator.h.
Queries the flag indicating drag action.
Definition at line 115 of file SoInteractionCoordinator.h.
Must be overridden to implement click detection.
Reimplemented in SoInteractionController.
Definition at line 150 of file SoInteractionCoordinator.h.
|
virtual |
This method will be used to override the default action selection mechanism.
|
inline |
Finds out whether the pointing action has been set during the current scene graph traversal.
Definition at line 78 of file SoInteractionCoordinator.h.
bool SoInteractionCoordinator::keyFitsCommandAction | ( | SoCommandAction * | action, |
int | modifiers, | ||
SoKeyboardEvent::Key | nKey ) |
Checks whether a keyboard event fits a certain command action.
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.
|
inline |
Checks whether it is allowed to execute keyboard actions.
Definition at line 147 of file SoInteractionCoordinator.h.
|
inline |
Checks whether it is allowed to execute wheel actions.
Definition at line 133 of file SoInteractionCoordinator.h.
|
inline |
Returns whether one is even allowed to select a (new) pointing action.
Definition at line 81 of file SoInteractionCoordinator.h.
Sets the flag indicating drag action.
Reimplemented in SoInteractionController.
|
inline |
Prevents further keyboard actions from being executed.
Definition at line 144 of file SoInteractionCoordinator.h.
|
virtual |
Setting the locked pointing action with this method ensures that a callback is set to be informed of an external grab release.
|
virtual |
This method sets the new selected pointing action.
The location is given so that the action can update its highlighting.
|
inline |
Prevents further wheel actions from being executed.
Definition at line 130 of file SoInteractionCoordinator.h.
|
virtual |
Starts a mouse button press for current action.
Truncates the list of mappers to the given number, used for push/pop semantics.
The mappers are not freed!
|
inlineprotected |
Resets the _pointingActionSelected flag (before traversing the scene).
Definition at line 167 of file SoInteractionCoordinator.h.
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.
|
protected |
Definition at line 173 of file SoInteractionCoordinator.h.
|
protected |
Definition at line 176 of file SoInteractionCoordinator.h.
|
protected |
Definition at line 170 of file SoInteractionCoordinator.h.