MeVisLab Toolbox Reference
SoView2DInteractionExtension.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2012, 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 
17 
18 #pragma once
19 
20 #include "SoView2DSystem.h"
21 #include "SoView2DExtension.h"
22 #include <SoPointerPosition.h>
23 #include "View2DPosition.h"
24 
25 class SoView2DGenericPointingAction;
26 
27 //=============================================================
31 //=============================================================
33 {
34  friend class SoView2DGenericPointingAction;
35 
36  SO_NODE_ABSTRACT_HEADER(SoView2DInteractionExtension);
37 
38 public:
39  SoView2DInteractionExtension(const std::string& actionID, bool positionSensitive = true);
40 
43  SoSFTrigger singleClicked;
44 
46  SoSFTrigger doubleClicked;
47 
49  static void initClass();
50 
53 
56  bool implementsManagedInteractionAndClassicEventHandling() const override { return true; }
57 
58 protected:
61 
64 
65  virtual bool shouldPointingActionBeEnabled() { return isEditingOn(); }
66 
69  virtual int getCurrentCursor(SoViewerProxy* viewerProxy);
70  virtual bool isSensitiveAt(const SoPointerPosition& /*pos*/);
71  virtual void setHighlightAt(const SoPointerPosition& /*pos*/) {}
72  virtual void unsetHighlight() {}
73  virtual void startPressAt(const SoPointerPosition& /*pos*/) {}
74  virtual void dragMoveTo(const SoPointerPosition& /*pos*/) {}
75  virtual SoPointingAction* endPress(int /*clickCount*/) { return nullptr; }
76  virtual int getNumInteractionModes() const { return 1; }
77  virtual void setInteractionMode(int /*mode*/) {}
79 
81  void editingOnChanged(SoField* field) override;
82 
84  void buttonMaskChanged(SoField* field) override;
85 
87 };
#define SOVIEW2D_API
File to resolve system dependencies in View2D library.
SoPointerPosition manages the current position of the mouse cursor.
SoPointingAction is the base class for any mouse based interaction.
SoView2DExtension Base class for all View2DExtensions used for drawing and event handling on the View...
virtual bool isEditingOn()
check if editing is on
SoView2DInteractionExtension is base class for all SoView2DExtensions that want to support the Manage...
SoSFTrigger singleClicked
this is triggered when the user clicks without moving the mouse (this only is supported when using Ma...
virtual int getCurrentCursor(SoViewerProxy *viewerProxy)
interface forwarded from SoPointingAction:
bool implementsManagedInteractionAndClassicEventHandling() const override
this node is a hybrid module providing managed interaction and classic event handling
SoSFTrigger doubleClicked
the same for the second click in a row
virtual void startPressAt(const SoPointerPosition &)
virtual void dragMoveTo(const SoPointerPosition &)
bool isValidLocation(const SoPointerPosition &pos)
return true if the position is inside the image or needsValidVoxel is not set
static void initClass()
Initializes this class.
void editingOnChanged(SoField *field) override
called when editingOn field is touched:
SoView2DInteractionExtension(const std::string &actionID, bool positionSensitive=true)
virtual SoPointingAction * endPress(int)
virtual bool isSensitiveAt(const SoPointerPosition &)
~SoView2DInteractionExtension() override
destructor
void buttonMaskChanged(SoField *field) override
called when one of the button/modifier fields is touched:
virtual void setHighlightAt(const SoPointerPosition &)
SoView2DInteractionExtension()
Constructor.
This class gives access to state of a viewer during scene graph traversal.
Definition: SoViewerProxy.h:30