Mercurial > hg > orthanc-stone
diff 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 |
line wrap: on
line diff
--- a/Framework/Scene2DViewport/MeasureTrackers.h Fri May 17 09:20:46 2019 +0200 +++ b/Framework/Scene2DViewport/MeasureTrackers.h Sun May 19 16:26:17 2019 +0200 @@ -35,10 +35,10 @@ { public: virtual void Cancel() ORTHANC_OVERRIDE; - virtual bool IsActive() const ORTHANC_OVERRIDE; + virtual bool IsAlive() const ORTHANC_OVERRIDE; protected: CreateMeasureTracker( - Scene2DWPtr scene, + ViewportControllerWPtr controllerW, std::vector<TrackerCommandPtr>& undoStack, std::vector<MeasureToolPtr>& measureTools); @@ -46,8 +46,10 @@ protected: CreateMeasureCommandPtr command_; - Scene2DWPtr scene_; - bool active_; + ViewportControllerWPtr controllerW_; + bool alive_; + Scene2DPtr GetScene(); + private: std::vector<TrackerCommandPtr>& undoStack_; std::vector<MeasureToolPtr>& measureTools_;