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
25class SoView2DGenericPointingAction;
26
27//=============================================================
31//=============================================================
33{
35
36 SO_NODE_ABSTRACT_HEADER(SoView2DInteractionExtension);
37
38public:
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
58protected:
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.
SoView2DExtension()
Constructor.
virtual bool isEditingOn()
check if editing is on
virtual int getCurrentCursor(SoViewerProxy *viewerProxy)
bool implementsManagedInteractionAndClassicEventHandling() const override
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 bool isSensitiveAt(const SoPointerPosition &)
~SoView2DInteractionExtension() override
destructor
virtual SoPointingAction * endPress(int)
void buttonMaskChanged(SoField *field) override
called when one of the button/modifier fields is touched:
virtual void setHighlightAt(const SoPointerPosition &)
SoView2DInteractionExtension()
Constructor.