Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/AngleMeasureTool.h @ 1314:9b126de2cde2 broker
Since the observer system now uses shared_ptr and many registrations are
done in the constructors, and since we cannot called shared_from_this() in
the constructors, it is mandatory to split construction from registration.
This has been done by making many ctors protected and replacing them
by factory methods that directly return shared_ptrs + added PostConstructor
method when base classes perform shared_from_this() calls too.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Mon, 16 Mar 2020 11:19:50 +0100 |
parents | a5326ce4f24b |
children | ab81ee8fce1f |
comparison
equal
deleted
inserted
replaced
1313:f30905f5d246 | 1314:9b126de2cde2 |
---|---|
38 namespace OrthancStone | 38 namespace OrthancStone |
39 { | 39 { |
40 class AngleMeasureTool : public MeasureTool | 40 class AngleMeasureTool : public MeasureTool |
41 { | 41 { |
42 public: | 42 public: |
43 AngleMeasureTool(IViewport& viewport); | 43 static boost::shared_ptr<AngleMeasureTool> Create(IViewport& viewport); |
44 | 44 |
45 ~AngleMeasureTool(); | 45 ~AngleMeasureTool(); |
46 | 46 |
47 void SetSide1End(ScenePoint2D start); | 47 void SetSide1End(ScenePoint2D start); |
48 void SetCenter(ScenePoint2D start); | 48 void SetCenter(ScenePoint2D start); |
68 | 68 |
69 | 69 |
70 AngleHighlightArea AngleHitTest(ScenePoint2D p) const; | 70 AngleHighlightArea AngleHitTest(ScenePoint2D p) const; |
71 | 71 |
72 private: | 72 private: |
73 AngleMeasureTool(IViewport& viewport); | |
74 | |
73 virtual void RefreshScene() ORTHANC_OVERRIDE; | 75 virtual void RefreshScene() ORTHANC_OVERRIDE; |
74 void RemoveFromScene(); | 76 void RemoveFromScene(); |
75 void SetAngleHighlightArea(AngleHighlightArea area); | 77 void SetAngleHighlightArea(AngleHighlightArea area); |
76 | 78 |
77 private: | 79 private: |