Mercurial > hg > orthanc-stone
diff Framework/Scene2D/ZoomSceneTracker.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 | c1d6a566dfd3 |
line wrap: on
line diff
--- a/Framework/Scene2D/ZoomSceneTracker.h Fri May 17 09:20:46 2019 +0200 +++ b/Framework/Scene2D/ZoomSceneTracker.h Sun May 19 16:26:17 2019 +0200 @@ -22,32 +22,29 @@ #pragma once -#include "IPointerTracker.h" +#include "../Scene2DViewport/OneGesturePointerTracker.h" #include "Internals/FixedPointAligner.h" namespace OrthancStone { class Scene2D; - class ZoomSceneTracker : public IPointerTracker + class ZoomSceneTracker : public OneGesturePointerTracker { + public: + ZoomSceneTracker(ViewportControllerWPtr controllerW, + const PointerEvent& event, + unsigned int canvasHeight); + + virtual void PointerMove(const PointerEvent& event) ORTHANC_OVERRIDE; + virtual void Cancel() ORTHANC_OVERRIDE; + private: - Scene2D& scene_; double clickY_; bool active_; double normalization_; Internals::FixedPointAligner aligner_; AffineTransform2D originalSceneToCanvas_; - public: - ZoomSceneTracker(Scene2D& scene, - const PointerEvent& event, - unsigned int canvasHeight); - - virtual void Update(const PointerEvent& event); - - virtual void Release() - { - } }; }