Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/AngleMeasureTool.h @ 860:238693c3bc51 am-dev
merge default -> am-dev
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Mon, 24 Jun 2019 14:35:00 +0200 |
parents | e42b491f1fb2 |
children | a29c13497557 |
comparison
equal
deleted
inserted
replaced
856:a6e17a5a39e7 | 860:238693c3bc51 |
---|---|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 **/ | 19 **/ |
20 | 20 |
21 #pragma once | 21 #pragma once |
22 | 22 |
23 #include "MeasureTools.h" | 23 #include "MeasureTool.h" |
24 | 24 |
25 #include <Framework/Scene2D/Scene2D.h> | 25 #include "../Scene2DViewport/LayerHolder.h" |
26 #include <Framework/Scene2D/ScenePoint2D.h> | 26 #include "../Scene2D/Scene2D.h" |
27 #include <Framework/Scene2D/PolylineSceneLayer.h> | 27 #include "../Scene2D/ScenePoint2D.h" |
28 #include <Framework/Scene2D/TextSceneLayer.h> | 28 #include "../Scene2D/PolylineSceneLayer.h" |
29 #include "../Scene2D/TextSceneLayer.h" | |
29 | 30 |
30 #include <boost/shared_ptr.hpp> | 31 #include <boost/shared_ptr.hpp> |
31 #include <boost/weak_ptr.hpp> | 32 #include <boost/weak_ptr.hpp> |
32 | 33 |
33 #include <vector> | 34 #include <vector> |
36 namespace OrthancStone | 37 namespace OrthancStone |
37 { | 38 { |
38 class AngleMeasureTool : public MeasureTool | 39 class AngleMeasureTool : public MeasureTool |
39 { | 40 { |
40 public: | 41 public: |
41 AngleMeasureTool(MessageBroker& broker, ViewportControllerWPtr controllerW) | 42 AngleMeasureTool(MessageBroker& broker, boost::weak_ptr<ViewportController> controllerW); |
42 : MeasureTool(broker, controllerW) | |
43 , layersCreated(false) | |
44 , polylineZIndex_(-1) | |
45 , textBaseZIndex_(-1) | |
46 { | |
47 | |
48 } | |
49 | 43 |
50 ~AngleMeasureTool(); | 44 ~AngleMeasureTool(); |
51 | 45 |
52 void SetSide1End(ScenePoint2D start); | 46 void SetSide1End(ScenePoint2D start); |
53 void SetCenter(ScenePoint2D start); | 47 void SetCenter(ScenePoint2D start); |
54 void SetSide2End(ScenePoint2D start); | 48 void SetSide2End(ScenePoint2D start); |
55 | 49 |
50 | |
51 virtual bool HitTest(ScenePoint2D p) const ORTHANC_OVERRIDE; | |
52 | |
56 private: | 53 private: |
57 PolylineSceneLayer* GetPolylineLayer(); | |
58 | |
59 // 0 --> 3 are for the text background (outline) | |
60 // 4 is for the actual text | |
61 TextSceneLayer* GetTextLayer(int index); | |
62 virtual void RefreshScene() ORTHANC_OVERRIDE; | 54 virtual void RefreshScene() ORTHANC_OVERRIDE; |
63 void RemoveFromScene(); | 55 void RemoveFromScene(); |
64 | 56 |
65 private: | 57 private: |
66 ScenePoint2D side1End_; | 58 ScenePoint2D side1End_; |
67 ScenePoint2D side2End_; | 59 ScenePoint2D side2End_; |
68 ScenePoint2D center_; | 60 ScenePoint2D center_; |
69 bool layersCreated; | 61 boost::shared_ptr<LayerHolder> layerHolder_; |
70 int polylineZIndex_; | |
71 int textBaseZIndex_; | |
72 }; | 62 }; |
73 | |
74 } | 63 } |
75 | 64 |
76 | 65 |