diff Framework/Scene2D/Internals/FixedPointAligner.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 7efa2543699d
children c0fcb2757b0a
line wrap: on
line diff
--- a/Framework/Scene2D/Internals/FixedPointAligner.h	Fri May 17 09:20:46 2019 +0200
+++ b/Framework/Scene2D/Internals/FixedPointAligner.h	Sun May 19 16:26:17 2019 +0200
@@ -18,11 +18,10 @@
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  **/
 
-
 #pragma once
 
-#include "../Scene2D.h"
-#include "../ScenePoint2D.h"
+#include <Framework/Scene2DViewport/PointerTypes.h>
+#include <Framework/Scene2D/ScenePoint2D.h>
 
 namespace OrthancStone
 {
@@ -33,12 +32,12 @@
     class FixedPointAligner : public boost::noncopyable
     {
     private:
-      Scene2D&      scene_;
-      ScenePoint2D  pivot_;
-      ScenePoint2D  canvas_;
+      ViewportControllerWPtr controllerW_;
+      ScenePoint2D           pivot_;
+      ScenePoint2D           canvas_;
 
     public:
-      FixedPointAligner(Scene2D& scene,
+      FixedPointAligner(ViewportControllerWPtr controllerW,
                         const ScenePoint2D& p);
 
       void Apply();