MeVisLab Toolbox Reference
SoMouseGrabber Class Reference

SoMouseGrabber is a general facility to grab mouse events and to map mouse movement to x/y values. More...

#include <SoMouseGrabber.h>

Inheritance diagram for SoMouseGrabber:
SoInteractionNode SoInteractionProviderNode SoInteractionHandler SoInteractionOwner SoInteractionProvider

Public Member Functions

 SoMouseGrabber ()
 Constructor. More...
 
void onChanged (SoField *field)
 Called when field on changed. More...
 
void handleEvent (SoHandleEventAction *action) override
 handle event is reimplemented to handle the mouse events (The events are not consumed, so that following modules in the scene graph can handle them.) More...
 
void GLRender (SoGLRenderAction *) override
 GLRender dummy implementation. More...
 
bool affectsState () const override
 this node does not affect the state, so return false! More...
 
- Public Member Functions inherited from SoInteractionNode
 SoInteractionNode ()
 Constructor. More...
 
 ~SoInteractionNode () override
 
void handleEvent (SoHandleEventAction *action) override
 Handles the mouse and keyboard events. More...
 
- Public Member Functions inherited from SoInteractionProviderNode
 SoInteractionProviderNode ()
 Default constructor. More...
 
 ~SoInteractionProviderNode () override
 Destructor. More...
 
std::string getID () const override
 Returns the id string for identifying the provider (and its actions) - this is usually the name of the scene node. More...
 
void objRef () override
 Memory management by reference counting; must be implemented in derived classes. More...
 
void objUnref () override
 
- Public Member Functions inherited from SoInteractionOwner
 SoInteractionOwner ()
 Default constructor. More...
 
 ~SoInteractionOwner () override
 The destructor will destroy all interactions created with this object as owner. More...
 
std::list< SoInteraction * > getInteractions (SoState *state) override
 Returns the list of all interactions of this provider. More...
 
void pointerPosition (SoState *state, const SoPointerPosition &pos) override
 Same as below, with additional SoState argument. Be defaults simply calls the below version. More...
 
void pointerLeftWindow (SoState *state) override
 Same as below, with additional SoState argument. Be defaults simply calls the below version. More...
 
void addListener (SoInteractionOwnerListenerInterface *listener)
 Add a listener object that is notified of changes in the interaction list. More...
 
void removeListener (SoInteractionOwnerListenerInterface *listener)
 Remove a listener object that was notified of changes in the interaction list. More...
 
- Public Member Functions inherited from SoInteractionProvider
 SoInteractionProvider ()
 Default constructor. More...
 
virtual ~SoInteractionProvider ()
 
template<class T >
std::list< T * > getInteractionsOfType (SoState *state)
 Returns list of interactions of a specific type: More...
 
virtual std::list< SoCommandAction * > getCommandActions (SoState *state)
 
virtual std::list< SoPointingAction * > getPointingActions (SoState *state)
 
virtual std::list< SoOffsetAction * > getOffsetActions (SoState *state)
 
- Public Member Functions inherited from SoInteractionHandler
 SoInteractionHandler (SoInteractionProvider *provider)
 
virtual ~SoInteractionHandler ()
 
virtual void handleEventForInteraction (SoHandleEventAction *action)
 Handles the mouse and keyboard events and send them to interaction nodes. More...
 

Static Public Member Functions

static void initClass ()
 inventor type system More...
 
- Static Public Member Functions inherited from SoInteractionNode
static void initClass ()
 Initializes this class. More...
 
static SoInteractionProvidergetInteractionProvider (SoNode *node)
 
- Static Public Member Functions inherited from SoInteractionProviderNode
static void initClass ()
 Initializes this class. More...
 
- Static Public Member Functions inherited from SoInteractionProvider
static void registerInteractionProviderNode (SoType type, GetProviderFunc func)
 Register a function to obtain a SoInteractionProvider from a SoNode. More...
 
static SoInteractionProvidergetInteractionProvider (SoNode *node)
 Get a SoInteractionProvider from a SoNode if registered, else NULL. More...
 

Public Attributes

SoSFBool on
 Fields. More...
 
SoSFBool useManagedInteraction
 If this is on, use managed interaction actions to modify x/y values. More...
 
SoSFBool normalized
 if true x and y are set to [xmin,xmax] relative to the viewport More...
 
SoSFBool clamp
 clamps the output to [min,max] in noramlized mode More...
 
SoSFFloat x
 x value that is changed by mouse movements More...
 
SoSFFloat y
 y value that is changed by mouse movements More...
 
SoSFFloat absX
 
SoSFFloat absY
 
SoSFBool cursorPresent
 this is set to true if the cursor is inside the viewing area More...
 
SoSFFloat xmin
 min value for the x field More...
 
SoSFFloat xmax
 max value for the x field More...
 
SoSFFloat ymin
 min value for the y field More...
 
SoSFFloat ymax
 max value for the y field More...
 
SoSFBool flipX
 flip the mouse movement to x mapping More...
 
SoSFBool flipY
 flip the mouse movement to y mapping More...
 
SoSFBool swapXY
 flip the mouse movement to xy mapping (mouse x -> field y, mouse y -> field x) More...
 
SoSFFloat sensitivity
 set the sensitivity of the mouse movement to x/y mapping, a value of 1 means that 400 pixel mouse movement interpolate between min and max value More...
 
SoSFEnum button1
 button mask for button1 More...
 
SoSFEnum button2
 button mask for button2 More...
 
SoSFEnum button3
 button mask for button3 More...
 
SoSFEnum shift
 mask for shift key More...
 
SoSFEnum ctrl
 mask for shift ctrl More...
 
SoSFEnum alt
 mask for shift alt, the alt key will not work in SoFullViewer derived classes because those viewers handle the alt key themselves More...
 
SoSFEnum cursorShape
 shape of mouse cursor when this grabber is active More...
 
SoSFBool shiftPressed
 Output Fields that are changed when the state changes. More...
 
SoSFBool ctrlPressed
 
SoSFBool altPressed
 
SoSFBool button1Pressed
 
SoSFBool button2Pressed
 
SoSFBool button3Pressed
 
SoSFTrigger button1DoubleClicked
 
SoSFTrigger button2DoubleClicked
 
SoSFTrigger button3DoubleClicked
 
SoSFTrigger released
 emitted when the mask was valid and switches to invalid again More...
 
SoSFBool maskValid
 gives the state of the mask, which calculated by the current mousebuttons and modifier key compared to the button1,button2,button3,ctrl,shift,alt settings. More...
 
SoSFBool setEventHandled
 Set events that depend on the button mask handled if they are indeed handled by this extension. More...
 
SoSFBool setWheelEventHandled
 Set wheel events handled. More...
 
SoSFFloat wheel
 
SoSFFloat wheelMin
 min value for wheel More...
 
SoSFFloat wheelMax
 max value for wheel More...
 
SoSFFloat wheelStep
 step value that is added/subtracted onto wheel on wheel events More...
 
SoSFTrigger wheelUp
 tells when the wheel was turned up More...
 
SoSFTrigger wheelDown
 tells when the wheel was turned down More...
 
SoSFBool wheelOverflow
 if it to true, the wheel value is wrapped around when reaching min/max values More...
 
- Public Attributes inherited from SoInteractionProviderNode
SoSFString instanceName
 Defines interface field to store the instance name. More...
 
SoSFString interactionProviderID
 This field overrides the instanceName as providerID if specified. More...
 

Protected Member Functions

 ~SoMouseGrabber () override
 
- Protected Member Functions inherited from SoInteractionOwner
virtual void pointerPosition (const SoPointerPosition &)
 Override this if you always need to be informed of the current mouse cursor position. More...
 
virtual void pointerLeftWindow ()
 This is called when the mouse cursor leaves the window. More...
 
bool hasInteractions () const
 Returns whether there are any actions defined by this owner. More...
 
template<class T >
bool hasInteractionsOfType () const
 Same as above, but asking for a specific type of interaction. More...
 
void addPointingAction (SoPointingAction *)
 
void addCommandAction (SoCommandAction *)
 
void addOffsetAction (SoOffsetAction *)
 
- Protected Member Functions inherited from SoInteractionHandler
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. More...
 
virtual bool augmentLocation (SoPointerPosition &, bool)
 This method can be overridden to provide further position information to SoPointingActions - e.g. More...
 
void buttonMaskChanged (SoState *state, const SoPointerPosition &location, int buttonMask)
 Called if the button mask changed since the last input event. More...
 
void modifierMaskChanged (SoState *state, const SoPointerPosition &location, int modifierMask)
 Called if the modifier mask changed since the last input event. More...
 
void locationChanged (SoState *state, const SoPointerPosition &location, bool force=false, bool renderRefresh=false)
 Called if the pointer location changed since the last input event. More...
 
bool wheelRotated (SoState *state, const SoPointerPosition &location, int modifierMask, SoMouseWheelEvent::Orientation orientation, short rotation)
 Called when the mouse wheel is rotated. More...
 
void handlePointerLeftWindow (SoState *state)
 Called if the pointer left the scene widget. More...
 
SoInteractionCoordinatorgetCoordinator ()
 Access method, returns the interaction coordinator during event handling. More...
 
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. More...
 
virtual bool isValidStartingLocation (const SoPointerPosition &location)
 This method returns whether the current location is valid for starting a pointing action. More...
 
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. More...
 
int getCurrentButtonMask ()
 
int getCurrentModifierMask ()
 Returns the currently active button modifier. More...
 
SoPointerPosition getCurrentPointerLocation ()
 Returns the current position of the mouse cursor. More...
 
bool isCurrentPointerLocationValid ()
 Returns whether the current mouse cursor position is valid. More...
 

Friends

class SoMouseGrabberPointingAction
 

Additional Inherited Members

- Public Types inherited from SoInteractionProvider
typedef SoInteractionProvider *(* GetProviderFunc) (SoNode *)
 

Detailed Description

SoMouseGrabber is a general facility to grab mouse events and to map mouse movement to x/y values.

The default values of the module are:

on = TRUE
shiftPressed = FALSE
ctrlPressed = FALSE
altPressed = FALSE
x = 0.5
y = 0.5
xmin = 0
xmax = 1
ymin = 0
ymax = 1
maskValid = FALSE
flipX = FALSE
flipY = FALSE
swapXY = FALSE
wheel = 0
wheelMax = 100
@ PRESSED
@ RELEASED
SoSFEnum alt
mask for shift alt, the alt key will not work in SoFullViewer derived classes because those viewers h...
SoSFBool button3Pressed
SoSFBool button2Pressed
SoSFEnum ctrl
mask for shift ctrl
SoSFBool flipY
flip the mouse movement to y mapping
SoSFEnum button2
button mask for button2
SoSFBool altPressed
SoSFBool wheelOverflow
if it to true, the wheel value is wrapped around when reaching min/max values
SoSFFloat wheelMax
max value for wheel
SoSFBool ctrlPressed
SoSFBool shiftPressed
Output Fields that are changed when the state changes.
SoSFFloat xmax
max value for the x field
SoSFBool swapXY
flip the mouse movement to xy mapping (mouse x -> field y, mouse y -> field x)
SoSFFloat y
y value that is changed by mouse movements
SoSFBool on
Fields.
SoSFFloat ymax
max value for the y field
SoSFFloat wheelMin
min value for wheel
SoSFBool maskValid
gives the state of the mask, which calculated by the current mousebuttons and modifier key compared t...
SoSFFloat sensitivity
set the sensitivity of the mouse movement to x/y mapping, a value of 1 means that 400 pixel mouse mov...
SoSFFloat x
x value that is changed by mouse movements
SoSFBool flipX
flip the mouse movement to x mapping
SoSFEnum button3
button mask for button3
SoSFFloat xmin
min value for the x field
SoSFFloat wheelStep
step value that is added/subtracted onto wheel on wheel events
SoSFFloat ymin
min value for the y field
SoSFBool button1Pressed
SoSFEnum shift
mask for shift key
SoSFEnum button1
button mask for button1

Definition at line 71 of file SoMouseGrabber.h.

Constructor & Destructor Documentation

◆ SoMouseGrabber()

SoMouseGrabber::SoMouseGrabber ( )

Constructor.

◆ ~SoMouseGrabber()

SoMouseGrabber::~SoMouseGrabber ( )
overrideprotected

Member Function Documentation

◆ affectsState()

bool SoMouseGrabber::affectsState ( ) const
inlineoverride

this node does not affect the state, so return false!

Definition at line 204 of file SoMouseGrabber.h.

◆ GLRender()

void SoMouseGrabber::GLRender ( SoGLRenderAction *  )
inlineoverride

GLRender dummy implementation.

Definition at line 201 of file SoMouseGrabber.h.

◆ handleEvent()

void SoMouseGrabber::handleEvent ( SoHandleEventAction *  action)
override

handle event is reimplemented to handle the mouse events (The events are not consumed, so that following modules in the scene graph can handle them.)

◆ initClass()

static void SoMouseGrabber::initClass ( )
static

inventor type system

◆ onChanged()

void SoMouseGrabber::onChanged ( SoField *  field)

Called when field on changed.

Friends And Related Function Documentation

◆ SoMouseGrabberPointingAction

friend class SoMouseGrabberPointingAction
friend

Definition at line 210 of file SoMouseGrabber.h.

Member Data Documentation

◆ absX

SoSFFloat SoMouseGrabber::absX

Definition at line 101 of file SoMouseGrabber.h.

◆ absY

SoSFFloat SoMouseGrabber::absY

Definition at line 102 of file SoMouseGrabber.h.

◆ alt

SoSFEnum SoMouseGrabber::alt

mask for shift alt, the alt key will not work in SoFullViewer derived classes because those viewers handle the alt key themselves

Definition at line 138 of file SoMouseGrabber.h.

◆ altPressed

SoSFBool SoMouseGrabber::altPressed

Definition at line 149 of file SoMouseGrabber.h.

◆ button1

SoSFEnum SoMouseGrabber::button1

button mask for button1

Definition at line 127 of file SoMouseGrabber.h.

◆ button1DoubleClicked

SoSFTrigger SoMouseGrabber::button1DoubleClicked

Definition at line 154 of file SoMouseGrabber.h.

◆ button1Pressed

SoSFBool SoMouseGrabber::button1Pressed

Definition at line 150 of file SoMouseGrabber.h.

◆ button2

SoSFEnum SoMouseGrabber::button2

button mask for button2

Definition at line 129 of file SoMouseGrabber.h.

◆ button2DoubleClicked

SoSFTrigger SoMouseGrabber::button2DoubleClicked

Definition at line 155 of file SoMouseGrabber.h.

◆ button2Pressed

SoSFBool SoMouseGrabber::button2Pressed

Definition at line 151 of file SoMouseGrabber.h.

◆ button3

SoSFEnum SoMouseGrabber::button3

button mask for button3

Definition at line 131 of file SoMouseGrabber.h.

◆ button3DoubleClicked

SoSFTrigger SoMouseGrabber::button3DoubleClicked

Definition at line 156 of file SoMouseGrabber.h.

◆ button3Pressed

SoSFBool SoMouseGrabber::button3Pressed

Definition at line 152 of file SoMouseGrabber.h.

◆ clamp

SoSFBool SoMouseGrabber::clamp

clamps the output to [min,max] in noramlized mode

Definition at line 94 of file SoMouseGrabber.h.

◆ ctrl

SoSFEnum SoMouseGrabber::ctrl

mask for shift ctrl

Definition at line 135 of file SoMouseGrabber.h.

◆ ctrlPressed

SoSFBool SoMouseGrabber::ctrlPressed

Definition at line 148 of file SoMouseGrabber.h.

◆ cursorPresent

SoSFBool SoMouseGrabber::cursorPresent

this is set to true if the cursor is inside the viewing area

Definition at line 105 of file SoMouseGrabber.h.

◆ cursorShape

SoSFEnum SoMouseGrabber::cursorShape

shape of mouse cursor when this grabber is active

Definition at line 141 of file SoMouseGrabber.h.

◆ flipX

SoSFBool SoMouseGrabber::flipX

flip the mouse movement to x mapping

Definition at line 117 of file SoMouseGrabber.h.

◆ flipY

SoSFBool SoMouseGrabber::flipY

flip the mouse movement to y mapping

Definition at line 119 of file SoMouseGrabber.h.

◆ maskValid

SoSFBool SoMouseGrabber::maskValid

gives the state of the mask, which calculated by the current mousebuttons and modifier key compared to the button1,button2,button3,ctrl,shift,alt settings.

Definition at line 163 of file SoMouseGrabber.h.

◆ normalized

SoSFBool SoMouseGrabber::normalized

if true x and y are set to [xmin,xmax] relative to the viewport

Definition at line 92 of file SoMouseGrabber.h.

◆ on

SoSFBool SoMouseGrabber::on

Fields.

switches the x/y field update on/off

Definition at line 86 of file SoMouseGrabber.h.

◆ released

SoSFTrigger SoMouseGrabber::released

emitted when the mask was valid and switches to invalid again

Definition at line 159 of file SoMouseGrabber.h.

◆ sensitivity

SoSFFloat SoMouseGrabber::sensitivity

set the sensitivity of the mouse movement to x/y mapping, a value of 1 means that 400 pixel mouse movement interpolate between min and max value

Definition at line 124 of file SoMouseGrabber.h.

◆ setEventHandled

SoSFBool SoMouseGrabber::setEventHandled

Set events that depend on the button mask handled if they are indeed handled by this extension.

Definition at line 166 of file SoMouseGrabber.h.

◆ setWheelEventHandled

SoSFBool SoMouseGrabber::setWheelEventHandled

Set wheel events handled.

Definition at line 169 of file SoMouseGrabber.h.

◆ shift

SoSFEnum SoMouseGrabber::shift

mask for shift key

Definition at line 133 of file SoMouseGrabber.h.

◆ shiftPressed

SoSFBool SoMouseGrabber::shiftPressed

Output Fields that are changed when the state changes.

Definition at line 147 of file SoMouseGrabber.h.

◆ swapXY

SoSFBool SoMouseGrabber::swapXY

flip the mouse movement to xy mapping (mouse x -> field y, mouse y -> field x)

Definition at line 121 of file SoMouseGrabber.h.

◆ useManagedInteraction

SoSFBool SoMouseGrabber::useManagedInteraction

If this is on, use managed interaction actions to modify x/y values.

Definition at line 89 of file SoMouseGrabber.h.

◆ wheel

SoSFFloat SoMouseGrabber::wheel

MouseWheel related fields current value that is updated on wheel events

Definition at line 175 of file SoMouseGrabber.h.

◆ wheelDown

SoSFTrigger SoMouseGrabber::wheelDown

tells when the wheel was turned down

Definition at line 186 of file SoMouseGrabber.h.

◆ wheelMax

SoSFFloat SoMouseGrabber::wheelMax

max value for wheel

Definition at line 179 of file SoMouseGrabber.h.

◆ wheelMin

SoSFFloat SoMouseGrabber::wheelMin

min value for wheel

Definition at line 177 of file SoMouseGrabber.h.

◆ wheelOverflow

SoSFBool SoMouseGrabber::wheelOverflow

if it to true, the wheel value is wrapped around when reaching min/max values

Definition at line 189 of file SoMouseGrabber.h.

◆ wheelStep

SoSFFloat SoMouseGrabber::wheelStep

step value that is added/subtracted onto wheel on wheel events

Definition at line 181 of file SoMouseGrabber.h.

◆ wheelUp

SoSFTrigger SoMouseGrabber::wheelUp

tells when the wheel was turned up

Definition at line 184 of file SoMouseGrabber.h.

◆ x

SoSFFloat SoMouseGrabber::x

x value that is changed by mouse movements

Definition at line 97 of file SoMouseGrabber.h.

◆ xmax

SoSFFloat SoMouseGrabber::xmax

max value for the x field

Definition at line 110 of file SoMouseGrabber.h.

◆ xmin

SoSFFloat SoMouseGrabber::xmin

min value for the x field

Definition at line 108 of file SoMouseGrabber.h.

◆ y

SoSFFloat SoMouseGrabber::y

y value that is changed by mouse movements

Definition at line 99 of file SoMouseGrabber.h.

◆ ymax

SoSFFloat SoMouseGrabber::ymax

max value for the y field

Definition at line 114 of file SoMouseGrabber.h.

◆ ymin

SoSFFloat SoMouseGrabber::ymin

min value for the y field

Definition at line 112 of file SoMouseGrabber.h.


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