MeVisLab Toolbox Reference
SoOffsetPointingAction.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_POINTING_ACTION_H
14 #define SO_OFFSET_POINTING_ACTION_H
15 
18 
19 #include "SoPointingAction.h"
20 
22 {
23 public:
24 
27 
28  bool isEnabled() const override;
29  void setEnabled(bool enabled) override;
30 
31  bool isSensitiveAt(const SoPointerPosition&) override { return true; }
32  int getCurrentCursor(SoViewerProxy* viewerProxy) const override;
33  std::string getCurrentStatusMessage() const override;
34  void startPressAt(const SoPointerPosition& pos) override;
35  void dragMoveTo(const SoPointerPosition& pos) override;
36  SoPointingAction* endPress(int clickCount) override;
37 
38  void setOffsetParameters(double sensitivityX, double sensitivityY, bool swapAxes);
39 
40 protected:
41  SoOffsetAction* proxiedOffsetAction() const override { return _offsetAction; }
42 
43 private:
44  SoOffsetAction* _offsetAction;
45  double _sensitivityX;
46  double _sensitivityY;
47  int _lastPosX;
48  int _lastPosY;
49  bool _swapAxes;
50 };
51 
52 #endif // __SoOffsetPointingAction_H
#define SOMANAGEDINTERACTION_API
File to resolve system dependencies in View2D library.
SoOffsetAction is the base class for any interaction that only provides (numeric) offsets in one or t...
SoOffsetPointingAction is an internal proxy class that helps controlling SoOffsetActions through a So...
int getCurrentCursor(SoViewerProxy *viewerProxy) const override
Returns the cursor ID to display for this action, as defined in SoViewerProxy.h - this gets (at least...
std::string getCurrentStatusMessage() const override
Returns a status message for display in status bar (make it short!), this will get called at same tim...
void setEnabled(bool enabled) override
Sets the enabled status of this interaction.
void startPressAt(const SoPointerPosition &pos) override
Starts a drag at given device position.
SoPointingAction * endPress(int clickCount) override
Ends the drag at last device position.
SoOffsetAction * proxiedOffsetAction() const override
void setOffsetParameters(double sensitivityX, double sensitivityY, bool swapAxes)
bool isSensitiveAt(const SoPointerPosition &) override
Returns true if the gesture is startable at the given device position.
bool isEnabled() const override
SoOffsetPointingAction(SoOffsetAction *offsetAction)
Standard constructor.
void dragMoveTo(const SoPointerPosition &pos) override
Continues the drag to given device position.
SoPointerPosition manages the current position of the mouse cursor.
SoPointingAction is the base class for any mouse based interaction.
This class gives access to state of a viewer during scene graph traversal.
Definition: SoViewerProxy.h:30