diff Framework/Scene2DViewport/ViewportController.h @ 1215:9efa66d8d3f8 broker

removed ViewportBase, and removed dependency of ViewportController on IViewport
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 04 Dec 2019 20:12:15 +0100
parents 741201eab130
children 5147277850cf
line wrap: on
line diff
--- a/Framework/Scene2DViewport/ViewportController.h	Wed Dec 04 19:12:08 2019 +0100
+++ b/Framework/Scene2DViewport/ViewportController.h	Wed Dec 04 20:12:15 2019 +0100
@@ -22,7 +22,8 @@
 
 #include "PredeclaredTypes.h"
 
-#include "../Viewport/IViewport.h"
+#include "../Messages/IObservable.h"
+#include "../Scene2D/Scene2D.h"
 #include "../Scene2DViewport/IFlexiblePointerTracker.h"
 
 #include <boost/enable_shared_from_this.hpp>
@@ -39,8 +40,9 @@
     }
 
     virtual IFlexiblePointerTracker* CreateTracker(boost::shared_ptr<ViewportController> controller,
-                                                   IViewport& viewport,
-                                                   const PointerEvent& event) = 0;
+                                                   const PointerEvent& event,
+                                                   unsigned int viewportWidth,
+                                                   unsigned int viewportHeight) = 0;
   };
 
 
@@ -49,8 +51,9 @@
   {
   public:
     virtual IFlexiblePointerTracker* CreateTracker(boost::shared_ptr<ViewportController> controller,
-                                                   IViewport& viewport,
-                                                   const PointerEvent& event) ORTHANC_OVERRIDE;
+                                                   const PointerEvent& event,
+                                                   unsigned int viewportWidth,
+                                                   unsigned int viewportHeight) ORTHANC_OVERRIDE;
   };
 
 
@@ -139,7 +142,8 @@
     void SetSceneToCanvasTransform(const AffineTransform2D& transform);
 
     /** Forwarded to the underlying scene, and broadcasted to the observers */
-    void FitContent(IViewport& viewport);
+    void FitContent(unsigned int viewportWidth,
+                    unsigned int viewportHeight);
 
     /** Adds a new measure tool */
     void AddMeasureTool(boost::shared_ptr<MeasureTool> measureTool);
@@ -191,9 +195,10 @@
 
 
     // Must be expressed in canvas coordinates
-    void HandleMousePress(IViewport& viewport,
-                          IViewportInteractor& interactor,
-                          const PointerEvent& event);
+    void HandleMousePress(IViewportInteractor& interactor,
+                          const PointerEvent& event,
+                          unsigned int viewportWidth,
+                          unsigned int viewportHeight);
 
     // Must be expressed in canvas coordinates
     void HandleMouseMove(const PointerEvent& event);