annotate OrthancStone/Sources/Scene2DViewport/EditAngleMeasureTracker.cpp @ 1871:7053b8a0aaec

upgrade to year 2022
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 11 Jan 2022 11:18:48 +0100
parents 3889ae96d2e9
children 9c0adcc8feec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
866
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
1 /**
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
2 * Stone of Orthanc
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1871
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
866
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
7 *
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
866
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
11 * the License, or (at your option) any later version.
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
12 *
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
16 * Lesser General Public License for more details.
866
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
17 *
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
19 * License along with this program. If not, see
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
20 * <http://www.gnu.org/licenses/>.
866
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
21 **/
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
22
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
23 #include "EditAngleMeasureTracker.h"
1020
ac88989817e3 TrackerCommand --> MeasureCommand + fuse against exception in MeasureTool dtor
Benjamin Golinvaux <bgo@osimis.io>
parents: 891
diff changeset
24 #include "EditAngleMeasureCommand.h"
866
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
25
1048
f6be9412e42a cleaning up IObservable.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1020
diff changeset
26 #include "../StoneException.h"
f6be9412e42a cleaning up IObservable.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1020
diff changeset
27
866
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
28 namespace OrthancStone
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
29 {
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
30 EditAngleMeasureTracker::EditAngleMeasureTracker(
1059
e713f1a99861 replacing MessageBroker by weak_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1048
diff changeset
31 boost::shared_ptr<MeasureTool> measureTool,
1606
874e178f34e9 - ViewportController now has weak ptr to Viewport
Benjamin Golinvaux <bgo@osimis.io>
parents: 1598
diff changeset
32 boost::weak_ptr<IViewport> viewport,
866
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
33 const PointerEvent& e)
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
34 : EditMeasureTracker(viewport, e)
866
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
35 {
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
36 ScenePoint2D scenePos;
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
37
1203
f3bb9a6dd949 locking abstraction in IViewport
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1059
diff changeset
38 {
1606
874e178f34e9 - ViewportController now has weak ptr to Viewport
Benjamin Golinvaux <bgo@osimis.io>
parents: 1598
diff changeset
39 std::unique_ptr<IViewport::ILock> lock(GetViewportLock());
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
40 ViewportController& controller = lock->GetController();
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
41 scenePos = e.GetMainPosition().Apply(controller.GetScene().GetCanvasToSceneTransform());
1203
f3bb9a6dd949 locking abstraction in IViewport
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1059
diff changeset
42 }
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
43
1059
e713f1a99861 replacing MessageBroker by weak_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1048
diff changeset
44 modifiedZone_ = dynamic_cast<AngleMeasureTool&>(*measureTool).AngleHitTest(scenePos);
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
45 command_.reset(new EditAngleMeasureCommand(measureTool, viewport));
866
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
46 }
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
47
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
48 EditAngleMeasureTracker::~EditAngleMeasureTracker()
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
49 {
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
50
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
51 }
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
52
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
53 void EditAngleMeasureTracker::PointerMove(const PointerEvent& e)
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
54 {
1606
874e178f34e9 - ViewportController now has weak ptr to Viewport
Benjamin Golinvaux <bgo@osimis.io>
parents: 1598
diff changeset
55 std::unique_ptr<IViewport::ILock> lock(GetViewportLock());
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
56
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
57 ViewportController& controller = lock->GetController();
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
58 const Scene2D& scene = controller.GetScene();
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
59
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
60 ScenePoint2D scenePos = e.GetMainPosition().Apply(
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
61 scene.GetCanvasToSceneTransform());
1203
f3bb9a6dd949 locking abstraction in IViewport
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1059
diff changeset
62
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
63 ScenePoint2D delta = scenePos - GetOriginalClickPosition();
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
64
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
65 const AngleMeasureToolMemento& memento =
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
66 dynamic_cast<const AngleMeasureToolMemento&>(command_->GetMementoOriginal());
1203
f3bb9a6dd949 locking abstraction in IViewport
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1059
diff changeset
67
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
68 switch (modifiedZone_)
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
69 {
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
70 case AngleMeasureTool::AngleHighlightArea_Center:
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
71 {
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
72 ScenePoint2D newCenter = memento.center_ + delta;
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
73 GetCommand()->SetCenter(newCenter);
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
74 break;
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
75 }
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
76
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
77 case AngleMeasureTool::AngleHighlightArea_Side1:
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
78 case AngleMeasureTool::AngleHighlightArea_Side2:
1203
f3bb9a6dd949 locking abstraction in IViewport
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1059
diff changeset
79 {
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
80 ScenePoint2D newCenter = memento.center_ + delta;
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
81 ScenePoint2D newSide1End = memento.side1End_ + delta;
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
82 ScenePoint2D newSide2End = memento.side2End_ + delta;
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
83 GetCommand()->SetCenter(newCenter);
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
84 GetCommand()->SetSide1End(newSide1End);
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
85 GetCommand()->SetSide2End(newSide2End);
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
86 break;
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
87 }
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
88
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
89 case AngleMeasureTool::AngleHighlightArea_Side1End:
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
90 {
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
91 ScenePoint2D newSide1End = memento.side1End_ + delta;
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
92 GetCommand()->SetSide1End(newSide1End);
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
93 break;
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
94 }
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
95
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
96 case AngleMeasureTool::AngleHighlightArea_Side2End:
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
97 {
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
98 ScenePoint2D newSide2End = memento.side2End_ + delta;
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
99 GetCommand()->SetSide2End(newSide2End);
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
100 break;
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
101 }
1791
9b650ab68d4c replaced unneeded use of boost::share_ptr for MeasureCommand mementos by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
102
1305
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
103 default:
a5326ce4f24b Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
Benjamin Golinvaux <bgo@osimis.io>
parents: 1279
diff changeset
104 LOG(WARNING) << "Warning: please retry the measuring tool editing operation!";
1203
f3bb9a6dd949 locking abstraction in IViewport
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1059
diff changeset
105 break;
866
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
106 }
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
107 }
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
108
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
109 void EditAngleMeasureTracker::PointerUp(const PointerEvent& e)
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
110 {
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
111 alive_ = false;
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
112 }
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
113
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
114 void EditAngleMeasureTracker::PointerDown(const PointerEvent& e)
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
115 {
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
116 LOG(WARNING) << "Additional touches (fingers, pen, mouse buttons...) "
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
117 "are ignored when the edit angle tracker is active";
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
118 }
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
119
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
120 boost::shared_ptr<EditAngleMeasureCommand> EditAngleMeasureTracker::GetCommand()
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
121 {
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
122 boost::shared_ptr<EditAngleMeasureCommand> ret = boost::dynamic_pointer_cast<EditAngleMeasureCommand>(command_);
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
123 ORTHANC_ASSERT(ret.get() != NULL, "Internal error in EditAngleMeasureTracker::GetCommand()");
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
124 return ret;
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
125 }
c71ef52602a0 Added the ability to edit existing measuring tools (demo not updated yet)
Benjamin Golinvaux <bgo@osimis.io>
parents:
diff changeset
126 }