MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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:
35 enum {
36 TypeId = TypeOffsetAction
37 };
38
46 DOUBLE_AXES
47 };
48
51 enum {
56 };
57
60
62 typedef std::list<Trigger> TriggerList;
63
69 SoOffsetAction(SoInteractionOwner* owner, std::string id, OffsetType offsetType = DOUBLE_AXES);
70
71 ~SoOffsetAction() override;
72
75 {
76 return _offsetType;
77 }
78
81
84
87
89 const TriggerList& getTriggers() const
90 {
91 return _triggers;
92 }
93
94
101 virtual void offsetBy(double dx, double dy, void* /*info*/)
102 {
103 offsetBy(dx, dy);
104 }
105
107 virtual void offsetBy(double /*dx*/, double /*dy*/)
108 {}
109
110
118 virtual int getCurrentCursor(SoViewerProxy* /*viewerProxy*/) const
119 {
120 return -1;
121 }
122
127 virtual std::string getCurrentStatusMessage() const
128 {
129 return std::string();
130 }
131
132private:
134 SoPointingAction* _getProxyPointingAction();
135
138 TriggerList _triggers;
139
141 SoPointingAction* _proxyPointingAction;
142
144 OffsetType _offsetType;
145};
146
147#endif // __SoPointingAction_H
#define SOMANAGEDINTERACTION_API
File to resolve system dependencies in View2D library.
Class ManagedOffsetTrigger may contain a ManagedMouseButtonTrigger, a ManagedMouseWheelTrigger,...
SoInteractionHandler is a mix-in class for instances of SoNode to handle the interactions it provides...
SoInteractionOwner is a mix-in class for instances of SoNode that should have interaction objects.
SoInteraction is the base class for SoCommandAction, SoPointingAction, and SoOffsetAction.
SoOffsetAction is the base class for any interaction that only provides (numeric) offsets in one or t...
virtual std::string getCurrentStatusMessage() const
Returns a status message for display in the status bar of MeVisLab (make it short!...
std::list< Trigger > TriggerList
List of triggers.
void clearTriggers()
Clears the list of default triggers.
~SoOffsetAction() override
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
Returns the cursor shape ID for display, as defined in SoViewerProxy.
OffsetType
Type of offset action (single or double axis).
@ SINGLE_AXIS
Only one offset axis is 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 *)
Performs offset operation with given values.
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)
Standard constructor.
SoPointingAction is the base class for any mouse based interaction.
This class gives access to state of a viewer during scene graph traversal.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.