Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Scene2DViewport/OneGesturePointerTracker.h @ 1606:874e178f34e9
- ViewportController now has weak ptr to Viewport
- Measuring tools + related commands and all trackers now store only a weak_ptr to the Viewport and lock() on demand for usage
- LayerHolder and FixedPoint aligner store only a weak_ptr to the Viewport, too
- Fixed float/double warning in GrayscaleWindowingSceneTracker
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 28 Oct 2020 20:14:34 +0100 |
parents | 8563ea5d8ae4 |
children | 9ac2a65d4172 |
comparison
equal
deleted
inserted
replaced
1605:b3c439d96d3e | 1606:874e178f34e9 |
---|---|
49 private: | 49 private: |
50 bool alive_; | 50 bool alive_; |
51 int currentTouchCount_; | 51 int currentTouchCount_; |
52 | 52 |
53 protected: | 53 protected: |
54 boost::shared_ptr<IViewport> viewport_; | 54 boost::weak_ptr<IViewport> viewport_; |
55 | |
56 /** | |
57 This will return a scoped lock to the viewport. | |
58 If the viewport does not exist anymore, then nullptr is returned. | |
59 */ | |
60 IViewport::ILock* GetViewportLock(); | |
55 | 61 |
56 public: | 62 public: |
57 explicit OneGesturePointerTracker(boost::shared_ptr<IViewport> viewport); | 63 explicit OneGesturePointerTracker(boost::weak_ptr<IViewport> viewport); |
58 | 64 |
59 virtual void PointerUp(const PointerEvent& event) ORTHANC_OVERRIDE; | 65 virtual void PointerUp(const PointerEvent& event) ORTHANC_OVERRIDE; |
60 | 66 |
61 virtual void PointerDown(const PointerEvent& event) ORTHANC_OVERRIDE; | 67 virtual void PointerDown(const PointerEvent& event) ORTHANC_OVERRIDE; |
62 | 68 |