Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Scene2DViewport/LineMeasureTool.h @ 1606:874e178f34e9
- ViewportController now has weak ptr to Viewport
- Measuring tools + related commands and all trackers now store only a weak_ptr to the Viewport and lock() on demand for usage
- LayerHolder and FixedPoint aligner store only a weak_ptr to the Viewport, too
- Fixed float/double warning in GrayscaleWindowingSceneTracker
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 28 Oct 2020 20:14:34 +0100 |
parents | 8563ea5d8ae4 |
children | 9ac2a65d4172 |
comparison
equal
deleted
inserted
replaced
1605:b3c439d96d3e | 1606:874e178f34e9 |
---|---|
37 namespace OrthancStone | 37 namespace OrthancStone |
38 { | 38 { |
39 class LineMeasureTool : public MeasureTool | 39 class LineMeasureTool : public MeasureTool |
40 { | 40 { |
41 public: | 41 public: |
42 static boost::shared_ptr<LineMeasureTool> Create(boost::shared_ptr<IViewport> viewport); | 42 static boost::shared_ptr<LineMeasureTool> Create(boost::weak_ptr<IViewport> viewport); |
43 | 43 |
44 ~LineMeasureTool(); | 44 ~LineMeasureTool(); |
45 | 45 |
46 void SetStart(ScenePoint2D start); | 46 void SetStart(ScenePoint2D start); |
47 void SetEnd(ScenePoint2D end); | 47 void SetEnd(ScenePoint2D end); |
66 | 66 |
67 | 67 |
68 LineHighlightArea LineHitTest(ScenePoint2D p); | 68 LineHighlightArea LineHitTest(ScenePoint2D p); |
69 | 69 |
70 private: | 70 private: |
71 explicit LineMeasureTool(boost::shared_ptr<IViewport> viewport); | 71 explicit LineMeasureTool(boost::weak_ptr<IViewport> viewport); |
72 | 72 |
73 virtual void RefreshScene() ORTHANC_OVERRIDE; | 73 virtual void RefreshScene() ORTHANC_OVERRIDE; |
74 void RemoveFromScene(); | 74 void RemoveFromScene(); |
75 void SetLineHighlightArea(LineHighlightArea area); | 75 void SetLineHighlightArea(LineHighlightArea area); |
76 | 76 |