MeVisLab Toolbox Reference
SoOffsetAction.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2014, 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_OFFSET_ACTION_H
14#define SO_OFFSET_ACTION_H
15
16#include "SoInteraction.h"
18
19class SoViewerProxy;
22
31{
33
34public:
36
46
49 enum {
54 };
55
58
60 typedef std::list<Trigger> TriggerList;
61
67 SoOffsetAction(SoInteractionOwner* owner, std::string id, OffsetType offsetType = DOUBLE_AXES);
68
69 ~SoOffsetAction() override;
70
72 OffsetType getOffsetType() const { return _offsetType; }
73
76
78 void setTrigger(const Trigger& trigger);
79
81 void addTrigger(const Trigger& trigger);
82
84 const TriggerList& getTriggers() const { return _triggers; }
85
86
93 virtual void offsetBy(double dx, double dy, void* /*info*/) { offsetBy(dx, dy); }
94
96 virtual void offsetBy(double /*dx*/, double /*dy*/) {}
97
98
106 virtual int getCurrentCursor(SoViewerProxy* /*viewerProxy*/) const { return -1; }
107
112 virtual std::string getCurrentStatusMessage() const { return std::string(); }
113
114private:
116 SoPointingAction* _getProxyPointingAction();
117
120 TriggerList _triggers;
121
123 SoPointingAction* _proxyPointingAction;
124
126 OffsetType _offsetType;
127};
128
129#endif // __SoPointingAction_H
#define SOMANAGEDINTERACTION_API
File to resolve system dependencies in View2D library.
SoInteraction(InteractionType type, SoInteractionOwner *owner, const std::string &id, bool registerWithOwner=true)
virtual std::string getCurrentStatusMessage() const
std::list< Trigger > TriggerList
List of triggers.
void clearTriggers()
Clears the list of default triggers.
friend class SoInteractionHandler
~SoOffsetAction() override
@ Button2Mask
Middle button.
@ AllButtonsMask
All buttons.
@ Button3Mask
Right button.
@ Button1Mask
Left button.
const TriggerList & getTriggers() const
Returns the default triggers set for this action.
void setTrigger(const Trigger &trigger)
Sets the (only) default trigger.
virtual int getCurrentCursor(SoViewerProxy *) const
OffsetType
Type of offset action (single or double axis).
@ SINGLE_AXIS
and vertical mouse movement are given as the first argument.
@ DOUBLE_AXES
Two offset axes are used.
virtual void offsetBy(double, double)
Variant without additional information parameter. You need to override one of these methods.
virtual void offsetBy(double dx, double dy, void *)
OffsetType getOffsetType() const
Returns whether one or two axes are used by this action.
void addTrigger(const Trigger &trigger)
Adds another default trigger.
ManagedOffsetTrigger Trigger
The trigger type for this action.
SoOffsetAction(SoInteractionOwner *owner, std::string id, OffsetType offsetType=DOUBLE_AXES)