Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/MeasureTrackers.h @ 700:059e1fd05fd6 refactor-viewport-controller
Introduced the ViewportController that sits between the application and the
Scene2D to handle the trackers and measuring tools. This is a work in progress.
The Scene2D is no longer an observable. Message sending is managed by the
ViewportController.
Move some refs to shared and weak to prevent lifetime issues.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Sun, 19 May 2019 16:26:17 +0200 |
parents | 8b6adfb62a2f |
children | 28b9e3a54200 |
comparison
equal
deleted
inserted
replaced
699:5c551f078c18 | 700:059e1fd05fd6 |
---|---|
33 { | 33 { |
34 class CreateMeasureTracker : public IFlexiblePointerTracker | 34 class CreateMeasureTracker : public IFlexiblePointerTracker |
35 { | 35 { |
36 public: | 36 public: |
37 virtual void Cancel() ORTHANC_OVERRIDE; | 37 virtual void Cancel() ORTHANC_OVERRIDE; |
38 virtual bool IsActive() const ORTHANC_OVERRIDE; | 38 virtual bool IsAlive() const ORTHANC_OVERRIDE; |
39 protected: | 39 protected: |
40 CreateMeasureTracker( | 40 CreateMeasureTracker( |
41 Scene2DWPtr scene, | 41 ViewportControllerWPtr controllerW, |
42 std::vector<TrackerCommandPtr>& undoStack, | 42 std::vector<TrackerCommandPtr>& undoStack, |
43 std::vector<MeasureToolPtr>& measureTools); | 43 std::vector<MeasureToolPtr>& measureTools); |
44 | 44 |
45 ~CreateMeasureTracker(); | 45 ~CreateMeasureTracker(); |
46 | 46 |
47 protected: | 47 protected: |
48 CreateMeasureCommandPtr command_; | 48 CreateMeasureCommandPtr command_; |
49 Scene2DWPtr scene_; | 49 ViewportControllerWPtr controllerW_; |
50 bool active_; | 50 bool alive_; |
51 Scene2DPtr GetScene(); | |
52 | |
51 private: | 53 private: |
52 std::vector<TrackerCommandPtr>& undoStack_; | 54 std::vector<TrackerCommandPtr>& undoStack_; |
53 std::vector<MeasureToolPtr>& measureTools_; | 55 std::vector<MeasureToolPtr>& measureTools_; |
54 bool commitResult_; | 56 bool commitResult_; |
55 }; | 57 }; |