Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/LineMeasureTool.h @ 1305:a5326ce4f24b broker
Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 04 Mar 2020 09:45:38 +0100 |
parents | 7ec8fea061b9 |
children | 9b126de2cde2 |
comparison
equal
deleted
inserted
replaced
1304:b7fa67bf87fa | 1305:a5326ce4f24b |
---|---|
36 namespace OrthancStone | 36 namespace OrthancStone |
37 { | 37 { |
38 class LineMeasureTool : public MeasureTool | 38 class LineMeasureTool : public MeasureTool |
39 { | 39 { |
40 public: | 40 public: |
41 LineMeasureTool(boost::weak_ptr<ViewportController> controllerW); | 41 LineMeasureTool(IViewport& viewport); |
42 | 42 |
43 ~LineMeasureTool(); | 43 ~LineMeasureTool(); |
44 | 44 |
45 void SetStart(ScenePoint2D start); | 45 void SetStart(ScenePoint2D start); |
46 void SetEnd(ScenePoint2D end); | 46 void SetEnd(ScenePoint2D end); |
47 void Set(ScenePoint2D start, ScenePoint2D end); | 47 void Set(ScenePoint2D start, ScenePoint2D end); |
48 | 48 |
49 | 49 |
50 virtual bool HitTest(ScenePoint2D p) const ORTHANC_OVERRIDE; | 50 virtual bool HitTest(ScenePoint2D p) ORTHANC_OVERRIDE; |
51 virtual void Highlight(ScenePoint2D p) ORTHANC_OVERRIDE; | 51 virtual void Highlight(ScenePoint2D p) ORTHANC_OVERRIDE; |
52 virtual void ResetHighlightState() ORTHANC_OVERRIDE; | 52 virtual void ResetHighlightState() ORTHANC_OVERRIDE; |
53 virtual boost::shared_ptr<IFlexiblePointerTracker> CreateEditionTracker(const PointerEvent& e) ORTHANC_OVERRIDE; | 53 virtual boost::shared_ptr<IFlexiblePointerTracker> CreateEditionTracker(const PointerEvent& e) ORTHANC_OVERRIDE; |
54 virtual boost::shared_ptr<MeasureToolMemento> GetMemento() const ORTHANC_OVERRIDE; | 54 virtual boost::shared_ptr<MeasureToolMemento> GetMemento() const ORTHANC_OVERRIDE; |
55 virtual void SetMemento(boost::shared_ptr<MeasureToolMemento>) ORTHANC_OVERRIDE; | 55 virtual void SetMemento(boost::shared_ptr<MeasureToolMemento>) ORTHANC_OVERRIDE; |
62 LineHighlightArea_End, | 62 LineHighlightArea_End, |
63 LineHighlightArea_Segment | 63 LineHighlightArea_Segment |
64 }; | 64 }; |
65 | 65 |
66 | 66 |
67 LineHighlightArea LineHitTest(ScenePoint2D p) const; | 67 LineHighlightArea LineHitTest(ScenePoint2D p); |
68 | 68 |
69 private: | 69 private: |
70 virtual void RefreshScene() ORTHANC_OVERRIDE; | 70 virtual void RefreshScene() ORTHANC_OVERRIDE; |
71 void RemoveFromScene(); | 71 void RemoveFromScene(); |
72 void SetLineHighlightArea(LineHighlightArea area); | 72 void SetLineHighlightArea(LineHighlightArea area); |