Mercurial > hg > orthanc-stone
comparison 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 |
comparison
equal
deleted
inserted
replaced
699:5c551f078c18 | 700:059e1fd05fd6 |
---|---|
20 | 20 |
21 | 21 |
22 #pragma once | 22 #pragma once |
23 | 23 |
24 | 24 |
25 #include "IPointerTracker.h" | 25 #include "../Scene2DViewport/OneGesturePointerTracker.h" |
26 #include "Internals/FixedPointAligner.h" | 26 #include "Internals/FixedPointAligner.h" |
27 | 27 |
28 namespace OrthancStone | 28 namespace OrthancStone |
29 { | 29 { |
30 class Scene2D; | 30 class Scene2D; |
31 | 31 |
32 class ZoomSceneTracker : public IPointerTracker | 32 class ZoomSceneTracker : public OneGesturePointerTracker |
33 { | 33 { |
34 public: | |
35 ZoomSceneTracker(ViewportControllerWPtr controllerW, | |
36 const PointerEvent& event, | |
37 unsigned int canvasHeight); | |
38 | |
39 virtual void PointerMove(const PointerEvent& event) ORTHANC_OVERRIDE; | |
40 virtual void Cancel() ORTHANC_OVERRIDE; | |
41 | |
34 private: | 42 private: |
35 Scene2D& scene_; | |
36 double clickY_; | 43 double clickY_; |
37 bool active_; | 44 bool active_; |
38 double normalization_; | 45 double normalization_; |
39 Internals::FixedPointAligner aligner_; | 46 Internals::FixedPointAligner aligner_; |
40 AffineTransform2D originalSceneToCanvas_; | 47 AffineTransform2D originalSceneToCanvas_; |
41 | 48 |
42 public: | |
43 ZoomSceneTracker(Scene2D& scene, | |
44 const PointerEvent& event, | |
45 unsigned int canvasHeight); | |
46 | |
47 virtual void Update(const PointerEvent& event); | |
48 | |
49 virtual void Release() | |
50 { | |
51 } | |
52 }; | 49 }; |
53 } | 50 } |