MeVisLab Toolbox Reference
SoCSODrawOnSurface.h
Go to the documentation of this file.
1/*************************************************************************************
2**
3** Copyright 2016, 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#pragma once
14
15#include "SoCSOIncludes.h"
16#include "SoCSOSystem.h"
17
18#include <SoInteractionNode.h>
19#include <Inventor/sensors/SoFieldSensor.h>
20
25
27{
28 SO_NODE_HEADER(SoCSODrawOnSurface);
29
30public:
31
33 static void initClass();
34
36 SoSFBool editingOn;
37 SoSFBool isEditing;
38 SoSFEnum modifierKey;
40 SoSFFloat pointsPerMM;
41 SoSFFloat elevation;
43
44 bool hasCSOList() const { return _csoList != nullptr; }
45
46private:
47
48 void cancel();
49 void undo();
50 void redo();
51
52 void startPressAt(const SoPointerPosition& pos);
53 void dragMoveTo(const SoPointerPosition& pos);
54 void endPress();
55
56 void inCSOListCB(SoField*);
57 void editingOnCB(SoField*);
58 void modifierKeyCB(SoField*);
59
60 void enableCancel();
61 void disableCancel();
62 void updateActionsEnabled();
63
64 bool isEditingOn() const { return editingOn.getValue() == TRUE; }
65
66 void appendSeedPointToCurrentCSO(const SoPointerPosition& pos);
67 void storeCurrentPosition(const SoPointerPosition& pos);
68 void handleSingleClickCSO();
69 void interpolate();
70 double getPointsPerMM();
71 void update();
72 void finish();
73
74 ml::CSOList* _csoList;
75 ml::CSO* _currentCSO;
76 SbVec3f _currentPosition;
77
78 SoCSODrawOnSurfaceDrawAction* _drawAction;
79 SoCSODrawOnSurfaceCancelCommandAction* _cancelAction;
80 SoCSODrawOnSurfaceUndoCommandAction* _undoAction;
81 SoCSODrawOnSurfaceRedoCommandAction* _redoAction;
82
87};
#define SOCSO_EXPORT
Header file for system independent resolution.
Definition SoCSOSystem.h:21
friend class SoCSODrawOnSurfaceCancelCommandAction
friend class SoCSODrawOnSurfaceRedoCommandAction
friend class SoCSODrawOnSurfaceDrawAction
friend class SoCSODrawOnSurfaceUndoCommandAction
static void initClass()
SoInteractionNode()
Constructor.
SoPointerPosition manages the current position of the mouse cursor.