MeVisLab Toolbox Reference
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 : public SoGroup, public SoInteractionCoordinator
48{
49 SO_NODE_HEADER(SoInteractionController);
50
51public:
53 static void initClass();
54
59
60 // fields
61
65
68
70 SoSFBool inDrag;
71
74
77
80
83
85 void handleEvent(SoHandleEventAction *action) override;
86
88 bool isDragThresholdExceeded() const override { return _dragThresholdExceeded; }
89
90protected:
93 void setDragging(bool dragging = true) override;
94
95private:
97 void updatePointerStatus(SoAction* action);
98
101 SoInteractionHandler* handler, const SoPointerPosition& location, bool allowed = true) override;
102
104 int _currentButtonMask;
105 SbVec2s _clickStartPos;
106 int _clickCount;
107 bool _dragThresholdExceeded;
108 bool _wasDoubleClick;
109};
110
111#endif //__SoInteractionController_H
#define SOMANAGEDINTERACTION_API
File to resolve system dependencies in View2D library.
SoSFBool inDrag
This flag is true if an pointer action is active (dragging).
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
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.
virtual void setSelectedPointingAction(SoPointingAction *action, SoInteractionHandler *handler, const SoPointerPosition &location, bool allowed=true)
SoPointerPosition manages the current position of the mouse cursor.