comparison Framework/Scene2DViewport/OneGesturePointerTracker.h @ 1305:a5326ce4f24b broker

Trackers and measuring tools now use the viewport instead of ViewportController, so that proper locks can be used
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 04 Mar 2020 09:45:38 +0100
parents 2d8ab34c8c91
children ab81ee8fce1f
comparison
equal deleted inserted replaced
1304:b7fa67bf87fa 1305:a5326ce4f24b
20 20
21 #pragma once 21 #pragma once
22 22
23 #include "IFlexiblePointerTracker.h" 23 #include "IFlexiblePointerTracker.h"
24 24
25 #include "../Viewport/IViewport.h"
26
27 #include <boost/shared_ptr.hpp>
28 #include <boost/weak_ptr.hpp>
29
25 namespace OrthancStone 30 namespace OrthancStone
26 { 31 {
27 /** 32 /**
28 This base is class allows to write simple trackers that deal with single 33 This base is class allows to write simple trackers that deal with single
29 drag gestures with only one touch. It is *not* suitable for multi-touch and 34 drag gestures with only one touch. It is *not* suitable for multi-touch and
37 42
38 */ 43 */
39 class OneGesturePointerTracker : public IFlexiblePointerTracker 44 class OneGesturePointerTracker : public IFlexiblePointerTracker
40 { 45 {
41 public: 46 public:
42 OneGesturePointerTracker(boost::weak_ptr<ViewportController> controllerW); 47 OneGesturePointerTracker(IViewport& viewport);
43 virtual void PointerUp(const PointerEvent& event) ORTHANC_OVERRIDE; 48 virtual void PointerUp(const PointerEvent& event) ORTHANC_OVERRIDE;
44 virtual void PointerDown(const PointerEvent& event) ORTHANC_OVERRIDE; 49 virtual void PointerDown(const PointerEvent& event) ORTHANC_OVERRIDE;
45 virtual bool IsAlive() const ORTHANC_OVERRIDE; 50 virtual bool IsAlive() const ORTHANC_OVERRIDE;
46 51
47 protected: 52 protected:
48 boost::shared_ptr<ViewportController> GetController(); 53 IViewport& viewport_;
49 54
50 private: 55 private:
51 boost::weak_ptr<ViewportController> controllerW_;
52 bool alive_; 56 bool alive_;
53 int currentTouchCount_; 57 int currentTouchCount_;
54 }; 58 };
55 } 59 }
56 60