MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
SoInteractionController.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2008, MeVis Medical Solutions AG
4**
5** The user may use this file in accordance with the license agreement provided with
6** the Software or, alternatively, in accordance with the terms contained in a
7** written agreement between the user and MeVis Medical Solutions AG.
8**
9** For further information use the contact form at https://www.mevislab.de/contact
10**
11**************************************************************************************/
12
13#ifndef SO_INTERACTION_CONTROLLER_H
14#define SO_INTERACTION_CONTROLLER_H
15
21
24
25#include <ThirdPartyWarningsDisable.h>
26#include <Inventor/fields/SoFields.h>
27#include <Inventor/nodes/SoSubNode.h>
28#include <Inventor/nodes/SoShape.h>
29#include <Inventor/nodes/SoGroup.h>
30#include <Inventor/sensors/SoFieldSensor.h>
31#include <Inventor/sensors/SoNodeSensor.h>
32#include <Inventor/elements/SoCacheElement.h>
33#include <Inventor/actions/SoCallbackAction.h>
34#include <Inventor/events/SoKeyboardEvent.h>
35#include <Inventor/SbLinear.h>
36#include <Inventor/SbTime.h>
37#include <ThirdPartyWarningsRestore.h>
38
39#include "SoPointingAction.h"
40
47{
48 SO_NODE_HEADER(SoInteractionController);
49
50public:
52 static void initClass();
53
58
59 // fields
60
64
67
70
73
76
79
82
85
87 bool isDragThresholdExceeded() const override
88 {
89 return _dragThresholdExceeded;
90 }
91
92protected:
95 void setDragging(bool dragging = true) override;
96
97private:
99 void updatePointerStatus(SoAction* action);
100
103 const SoPointerPosition& location, bool allowed = true) override;
104
106 int _currentButtonMask;
107 SbVec2s _clickStartPos;
108 int _clickCount;
109 bool _dragThresholdExceeded;
110 bool _wasDoubleClick;
111};
112
113#endif //__SoInteractionController_H
#define SOMANAGEDINTERACTION_API
File to resolve system dependencies in View2D library.
SoInteractionController is the controlling instance of managed interactions.
SoSFBool inDrag
This flag is true if an pointer action is active (dragging).
SoSFString activePointingAction
This field contains the ID of the pointing action that would be activated on left mouse click or whic...
void handleEvent(SoHandleEventAction *action) override
Handles the mouse and keyboard events and send them to interaction nodes.
SoSFBool enableMouseHandling
If this flag is false, no pointing actions are enabled.
~SoInteractionController() override
Destructor.
SoInteractionController()
Default constructor.
static void initClass()
Initialization of the Inventor runtime type system.
SoSFBool enableKeyHandling
If this flag is false, no command actions will be executed when a key is pressed.
void setDragging(bool dragging=true) override
Method inherited from SoInteractionCoordinator, overridden to update the inDrag field.
SoSFBool enableWheelHandling
If this flag is false, no offset actions will be executed when the mouse wheel is rotated.
SoSFString activePointingActionStatus
Status string returned by the pointing action indicated by activePointerAction.
SoSFString activePointingActionProvider
This field contains the ID of the provider of the pointing action.
bool isDragThresholdExceeded() const override
Return whether the drag threshold was exceeded, that is, endPress will get a clickCount of 0.
Provides a coordinating interface to the SoInteractionHandlers in the scene.
virtual void setSelectedPointingAction(SoPointingAction *action, SoInteractionHandler *handler, const SoPointerPosition &location, bool allowed=true)
This method sets the new selected pointing action.
SoInteractionHandler is a mix-in class for instances of SoNode to handle the interactions it provides...
SoPointerPosition manages the current position of the mouse cursor.
SoPointingAction is the base class for any mouse based interaction.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.