Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/MeasureTrackers.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 | ab81ee8fce1f |
comparison
equal
deleted
inserted
replaced
1304:b7fa67bf87fa | 1305:a5326ce4f24b |
---|---|
38 { | 38 { |
39 public: | 39 public: |
40 virtual void Cancel() ORTHANC_OVERRIDE; | 40 virtual void Cancel() ORTHANC_OVERRIDE; |
41 virtual bool IsAlive() const ORTHANC_OVERRIDE; | 41 virtual bool IsAlive() const ORTHANC_OVERRIDE; |
42 protected: | 42 protected: |
43 CreateMeasureTracker(boost::weak_ptr<ViewportController> controllerW); | 43 CreateMeasureTracker(IViewport& viewport); |
44 | 44 |
45 ~CreateMeasureTracker(); | 45 ~CreateMeasureTracker(); |
46 | 46 |
47 protected: | 47 protected: |
48 boost::shared_ptr<CreateMeasureCommand> command_; | 48 boost::shared_ptr<CreateMeasureCommand> command_; |
49 boost::weak_ptr<ViewportController> controllerW_; | 49 IViewport& viewport_; |
50 bool alive_; | 50 bool alive_; |
51 | 51 |
52 private: | 52 private: |
53 bool commitResult_; | 53 bool commitResult_; |
54 }; | 54 }; |
57 { | 57 { |
58 public: | 58 public: |
59 virtual void Cancel() ORTHANC_OVERRIDE; | 59 virtual void Cancel() ORTHANC_OVERRIDE; |
60 virtual bool IsAlive() const ORTHANC_OVERRIDE; | 60 virtual bool IsAlive() const ORTHANC_OVERRIDE; |
61 protected: | 61 protected: |
62 EditMeasureTracker(boost::weak_ptr<ViewportController> controllerW, const PointerEvent& e); | 62 EditMeasureTracker(IViewport& viewport, const PointerEvent& e); |
63 | 63 |
64 ~EditMeasureTracker(); | 64 ~EditMeasureTracker(); |
65 | 65 |
66 protected: | 66 protected: |
67 boost::shared_ptr<EditMeasureCommand> command_; | 67 boost::shared_ptr<EditMeasureCommand> command_; |
68 boost::weak_ptr<ViewportController> controllerW_; | 68 IViewport& viewport_; |
69 bool alive_; | 69 bool alive_; |
70 | 70 |
71 ScenePoint2D GetOriginalClickPosition() const | 71 ScenePoint2D GetOriginalClickPosition() const |
72 { | 72 { |
73 return originalClickPosition_; | 73 return originalClickPosition_; |