Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/AngleMeasureTool.h @ 751:712ff6ff3c19
- undo redo now works fine for both measure tool creation commands
- added LayerHolder to streamline layer index management
- added overloads for ORTHANC_ASSERT with no string message (some heavy
preprocessor wizardry in there)
- fixing wasm BasicScene is *not* finished.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 22 May 2019 11:55:52 +0200 |
parents | 059e1fd05fd6 |
children | 92c400a09f1b |
comparison
equal
deleted
inserted
replaced
750:284f37dc1c66 | 751:712ff6ff3c19 |
---|---|
20 | 20 |
21 #pragma once | 21 #pragma once |
22 | 22 |
23 #include "MeasureTools.h" | 23 #include "MeasureTools.h" |
24 | 24 |
25 #include <Framework/Scene2D/Scene2D.h> | 25 #include "../Scene2D/Scene2D.h" |
26 #include <Framework/Scene2D/ScenePoint2D.h> | 26 #include "../Scene2D/ScenePoint2D.h" |
27 #include <Framework/Scene2D/PolylineSceneLayer.h> | 27 #include "../Scene2D/PolylineSceneLayer.h" |
28 #include <Framework/Scene2D/TextSceneLayer.h> | 28 #include "../Scene2D/TextSceneLayer.h" |
29 | |
30 #include "../Scene2DViewport/LayerHolder.h" | |
29 | 31 |
30 #include <boost/shared_ptr.hpp> | 32 #include <boost/shared_ptr.hpp> |
31 #include <boost/weak_ptr.hpp> | 33 #include <boost/weak_ptr.hpp> |
32 | 34 |
33 #include <vector> | 35 #include <vector> |
36 namespace OrthancStone | 38 namespace OrthancStone |
37 { | 39 { |
38 class AngleMeasureTool : public MeasureTool | 40 class AngleMeasureTool : public MeasureTool |
39 { | 41 { |
40 public: | 42 public: |
41 AngleMeasureTool(MessageBroker& broker, ViewportControllerWPtr controllerW) | 43 AngleMeasureTool(MessageBroker& broker, ViewportControllerWPtr controllerW); |
42 : MeasureTool(broker, controllerW) | |
43 , layersCreated(false) | |
44 , polylineZIndex_(-1) | |
45 , textBaseZIndex_(-1) | |
46 { | |
47 | |
48 } | |
49 | 44 |
50 ~AngleMeasureTool(); | 45 ~AngleMeasureTool(); |
51 | 46 |
52 void SetSide1End(ScenePoint2D start); | 47 void SetSide1End(ScenePoint2D start); |
53 void SetCenter(ScenePoint2D start); | 48 void SetCenter(ScenePoint2D start); |
54 void SetSide2End(ScenePoint2D start); | 49 void SetSide2End(ScenePoint2D start); |
55 | 50 |
56 private: | 51 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; | 52 virtual void RefreshScene() ORTHANC_OVERRIDE; |
63 void RemoveFromScene(); | 53 void RemoveFromScene(); |
64 | 54 |
65 private: | 55 private: |
66 ScenePoint2D side1End_; | 56 ScenePoint2D side1End_; |
67 ScenePoint2D side2End_; | 57 ScenePoint2D side2End_; |
68 ScenePoint2D center_; | 58 ScenePoint2D center_; |
69 bool layersCreated; | 59 LayerHolderPtr layerHolder_; |
70 int polylineZIndex_; | |
71 int textBaseZIndex_; | |
72 }; | 60 }; |
73 | |
74 } | 61 } |
75 | 62 |
76 | 63 |