MeVisLab Toolbox Reference
SoInteractionHandler Class Reference

SoInteractionHandler is a mix-in class for instances of SoNode to handle the interactions it provides in the handleEvent method. More...

#include <SoInteractionHandler.h>

Inheritance diagram for SoInteractionHandler:
SoInteractionNode View2DInteractionHandler SoCSO3DVis SoCSODrawOnSurface SoMouseGrabber SoPicking

Public Member Functions

 SoInteractionHandler (SoInteractionProvider *provider)
 
virtual ~SoInteractionHandler ()
 
virtual void handleEventForInteraction (SoHandleEventAction *action)
 Handles the mouse and keyboard events and send them to interaction nodes.
 

Protected Member Functions

bool handleKeyPress (SoState *state, const SoPointerPosition &location, int modifiers, SoKeyboardEvent::Key nKey)
 Handles key press by checking for commands actions with matching key shortcuts and executing (one of) them.
 
virtual bool augmentLocation (SoPointerPosition &, bool)
 This method can be overridden to provide further position information to SoPointingActions - e.g.
 
void buttonMaskChanged (SoState *state, const SoPointerPosition &location, int buttonMask)
 Called if the button mask changed since the last input event.
 
void modifierMaskChanged (SoState *state, const SoPointerPosition &location, int modifierMask)
 Called if the modifier mask changed since the last input event.
 
void locationChanged (SoState *state, const SoPointerPosition &location, bool force=false, bool renderRefresh=false)
 Called if the pointer location changed since the last input event.
 
bool wheelRotated (SoState *state, const SoPointerPosition &location, int modifierMask, SoMouseWheelEvent::Orientation orientation, short rotation)
 Called when the mouse wheel is rotated.
 
void handlePointerLeftWindow (SoState *state)
 Called if the pointer left the scene widget.
 
SoInteractionCoordinatorgetCoordinator ()
 Access method, returns the interaction coordinator during event handling.
 
SoPointingActiongetLocalCurrentPointingAction ()
 
virtual bool isEnabled (SoPointingAction *action, int currentMask)
 This method returns true if the pointing action should be enabled for the given modifier/button mask.
 
virtual bool isValidStartingLocation (const SoPointerPosition &location)
 This method returns whether the current location is valid for starting a pointing action.
 
bool canSelectPointingAction ()
 
void selectTargetPointingAction (SoState *state, const SoPointerPosition &location, int mask)
 
bool trySwitchGlobalPointingAction (SoState *state, const SoPointerPosition &location, int buttonMask, int modifierMask)
 Tries to switch from one global pointing action to another during a drag.
 
Access methods for the current pointer state.

Returns the currently active button mask.

int getCurrentButtonMask ()
 
int getCurrentModifierMask ()
 Returns the currently active button modifier.
 
SoPointerPosition getCurrentPointerLocation ()
 Returns the current position of the mouse cursor.
 
bool isCurrentPointerLocationValid ()
 Returns whether the current mouse cursor position is valid.
 

Detailed Description

SoInteractionHandler is a mix-in class for instances of SoNode to handle the interactions it provides in the handleEvent method.

Definition at line 35 of file SoInteractionHandler.h.

Constructor & Destructor Documentation

◆ SoInteractionHandler()

SoInteractionHandler::SoInteractionHandler ( SoInteractionProvider * provider)

◆ ~SoInteractionHandler()

virtual SoInteractionHandler::~SoInteractionHandler ( )
virtual

Member Function Documentation

◆ augmentLocation()

virtual bool SoInteractionHandler::augmentLocation ( SoPointerPosition & ,
bool  )
inlineprotectedvirtual

This method can be overridden to provide further position information to SoPointingActions - e.g.

slice information for SoView2DExtensions. The dragging argument tells us if any mouse button is pressed before this fact is really evaluated!

Returns
false if augmenting was not possible and actions should not be executed for this node.

Reimplemented in View2DInteractionHandler.

Definition at line 55 of file SoInteractionHandler.h.

◆ buttonMaskChanged()

void SoInteractionHandler::buttonMaskChanged ( SoState * state,
const SoPointerPosition & location,
int buttonMask )
protected

Called if the button mask changed since the last input event.

◆ canSelectPointingAction()

bool SoInteractionHandler::canSelectPointingAction ( )
protected

◆ getCoordinator()

SoInteractionCoordinator * SoInteractionHandler::getCoordinator ( )
inlineprotected

Access method, returns the interaction coordinator during event handling.

Definition at line 90 of file SoInteractionHandler.h.

◆ getCurrentButtonMask()

int SoInteractionHandler::getCurrentButtonMask ( )
inlineprotected

Definition at line 80 of file SoInteractionHandler.h.

◆ getCurrentModifierMask()

int SoInteractionHandler::getCurrentModifierMask ( )
inlineprotected

Returns the currently active button modifier.

Definition at line 82 of file SoInteractionHandler.h.

◆ getCurrentPointerLocation()

SoPointerPosition SoInteractionHandler::getCurrentPointerLocation ( )
inlineprotected

Returns the current position of the mouse cursor.

Definition at line 84 of file SoInteractionHandler.h.

◆ getLocalCurrentPointingAction()

SoPointingAction * SoInteractionHandler::getLocalCurrentPointingAction ( )
protected

◆ handleEventForInteraction()

virtual void SoInteractionHandler::handleEventForInteraction ( SoHandleEventAction * action)
virtual

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

◆ handleKeyPress()

bool SoInteractionHandler::handleKeyPress ( SoState * state,
const SoPointerPosition & location,
int modifiers,
SoKeyboardEvent::Key nKey )
protected

Handles key press by checking for commands actions with matching key shortcuts and executing (one of) them.

◆ handlePointerLeftWindow()

void SoInteractionHandler::handlePointerLeftWindow ( SoState * state)
protected

Called if the pointer left the scene widget.

◆ isCurrentPointerLocationValid()

bool SoInteractionHandler::isCurrentPointerLocationValid ( )
inlineprotected

Returns whether the current mouse cursor position is valid.

Definition at line 86 of file SoInteractionHandler.h.

◆ isEnabled()

virtual bool SoInteractionHandler::isEnabled ( SoPointingAction * action,
int currentMask )
protectedvirtual

This method returns true if the pointing action should be enabled for the given modifier/button mask.

Override this if you want to impose further constraints.

Reimplemented in View2DInteractionHandler.

◆ isValidStartingLocation()

virtual bool SoInteractionHandler::isValidStartingLocation ( const SoPointerPosition & location)
protectedvirtual

This method returns whether the current location is valid for starting a pointing action.

This is mainly used for SoView2D, where several SoView2Ds may provide the same actions, only at different device positions (and with different voxel/world transformations). This method always returns true by default.

Reimplemented in View2DInteractionHandler.

◆ locationChanged()

void SoInteractionHandler::locationChanged ( SoState * state,
const SoPointerPosition & location,
bool force = false,
bool renderRefresh = false )
protected

Called if the pointer location changed since the last input event.

If force is true the handling is forced even if the position hasn't changed. If renderRefresh is also true this is no real location change but only an refresh that happens directly before rendering.

◆ modifierMaskChanged()

void SoInteractionHandler::modifierMaskChanged ( SoState * state,
const SoPointerPosition & location,
int modifierMask )
protected

Called if the modifier mask changed since the last input event.

◆ selectTargetPointingAction()

void SoInteractionHandler::selectTargetPointingAction ( SoState * state,
const SoPointerPosition & location,
int mask )
protected

◆ trySwitchGlobalPointingAction()

bool SoInteractionHandler::trySwitchGlobalPointingAction ( SoState * state,
const SoPointerPosition & location,
int buttonMask,
int modifierMask )
protected

Tries to switch from one global pointing action to another during a drag.

This is only allowed for global pointing actions since position specific interactions probably should not be aborted in mid-drag.

◆ wheelRotated()

bool SoInteractionHandler::wheelRotated ( SoState * state,
const SoPointerPosition & location,
int modifierMask,
SoMouseWheelEvent::Orientation orientation,
short rotation )
protected

Called when the mouse wheel is rotated.

The location is only given to provide the augmented location to the offset action.


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