comparison Samples/Common/MeasureTrackers.h @ 632:500c3f70b6c2

- Added a ClearAllChains method to PolylineSceneLayer --> revision must change when calling it ==> BumpRevision has been added to base class - Added some docs = Added GetMinDepth + GetMaxDepth to Scene2D (to alleviate the need for app- specific "Z depth registry" : clients may simply add a new layer on top or at the bottom of the existing layer set. - Added the line tracker measurement tools, commands and trackers. Generic base classes + Line measure - started work on the line measure handles
author Benjamin Golinvaux <bgo@osimis.io>
date Thu, 09 May 2019 10:41:31 +0200
parents
children f939f449482c
comparison
equal deleted inserted replaced
618:0925b27e8750 632:500c3f70b6c2
1 /**
2 * Stone of Orthanc
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
6 *
7 * This program is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU Affero General Public License
9 * as published by the Free Software Foundation, either version 3 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/
20
21 #pragma once
22
23 #include "../../Framework/Scene2D/IPointerTracker.h"
24 #include "../../Framework/Scene2D/Scene2D.h"
25
26 #include "MeasureTools.h"
27 #include "MeasureCommands.h"
28
29 #include <vector>
30
31 namespace OrthancStone
32 {
33 class CreateMeasureTracker : public IPointerTracker
34 {
35 public:
36 virtual void Update(const PointerEvent& e) ORTHANC_OVERRIDE;
37 virtual void Release() ORTHANC_OVERRIDE;
38 protected:
39 CreateMeasureTracker(
40 Scene2D& scene,
41 std::vector<TrackerCommandPtr>& undoStack,
42 std::vector<MeasureToolPtr>& measureTools);
43
44 ~CreateMeasureTracker();
45
46 private:
47 Scene2D& scene_;
48 std::vector<TrackerCommandPtr>& undoStack_;
49 std::vector<MeasureToolPtr>& measureTools_;
50 bool commitResult_;
51
52 protected:
53 CreateMeasureCommandPtr command_;
54 };
55
56 class CreateLineMeasureTracker : public CreateMeasureTracker
57 {
58 public:
59 /**
60 When you create this tracker, you need to supply it with the undo stack
61 where it will store the commands that perform the actual measure tool
62 creation and modification.
63 In turn, a container for these commands to store the actual measuring
64 must be supplied, too
65 */
66 CreateLineMeasureTracker(
67 Scene2D& scene,
68 std::vector<TrackerCommandPtr>& undoStack,
69 std::vector<MeasureToolPtr>& measureTools,
70 const PointerEvent& e);
71
72 ~CreateLineMeasureTracker();
73 };
74 }