comparison Framework/Scene2D/RotateSceneTracker.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 c1d6a566dfd3
comparison
equal deleted inserted replaced
699:5c551f078c18 700:059e1fd05fd6
19 **/ 19 **/
20 20
21 21
22 #pragma once 22 #pragma once
23 23
24 #include "IPointerTracker.h" 24 #include "../Scene2DViewport/OneGesturePointerTracker.h"
25 #include "Internals/FixedPointAligner.h" 25 #include "Internals/FixedPointAligner.h"
26 26
27 namespace OrthancStone 27 namespace OrthancStone
28 { 28 {
29 class RotateSceneTracker : public IPointerTracker 29 class ViewportController;
30
31 class RotateSceneTracker : public OneGesturePointerTracker
30 { 32 {
31 private:
32 Scene2D& scene_;
33 ScenePoint2D click_;
34 Internals::FixedPointAligner aligner_;
35 double referenceAngle_;
36 bool isFirst_;
37 AffineTransform2D originalSceneToCanvas_;
38
39 public: 33 public:
40 RotateSceneTracker(Scene2D& scene, 34 RotateSceneTracker(ViewportControllerWPtr controllerW,
41 const PointerEvent& event); 35 const PointerEvent& event);
42 36
43 virtual void Update(const PointerEvent& event); 37 virtual void PointerMove(const PointerEvent& event) ORTHANC_OVERRIDE;
38 virtual void Cancel() ORTHANC_OVERRIDE;
44 39
45 virtual void Release() 40 private:
46 { 41 ScenePoint2D click_;
47 } 42 Internals::FixedPointAligner aligner_;
43 double referenceAngle_;
44 bool isFirst_;
45 AffineTransform2D originalSceneToCanvas_;
48 }; 46 };
49 } 47 }