Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/OneGesturePointerTracker.cpp @ 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 | 7ec8fea061b9 |
children | ab81ee8fce1f |
comparison
equal
deleted
inserted
replaced
1304:b7fa67bf87fa | 1305:a5326ce4f24b |
---|---|
26 #include "../StoneException.h" | 26 #include "../StoneException.h" |
27 | 27 |
28 namespace OrthancStone | 28 namespace OrthancStone |
29 { | 29 { |
30 OneGesturePointerTracker::OneGesturePointerTracker( | 30 OneGesturePointerTracker::OneGesturePointerTracker( |
31 boost::weak_ptr<ViewportController> controllerW) | 31 IViewport& viewport) |
32 : controllerW_(controllerW) | 32 : viewport_(viewport) |
33 , alive_(true) | 33 , alive_(true) |
34 , currentTouchCount_(1) | 34 , currentTouchCount_(1) |
35 { | 35 { |
36 } | 36 } |
37 | 37 |
58 | 58 |
59 /** | 59 /** |
60 * 2019-12-06 (SJO): Patch to have consistent behavior when mouse | 60 * 2019-12-06 (SJO): Patch to have consistent behavior when mouse |
61 * leaves the canvas while the tracker is still active, then | 61 * leaves the canvas while the tracker is still active, then |
62 * button is released while out-of-canvas. Such an event is not | 62 * button is released while out-of-canvas. Such an event is not |
63 * catched (at least in WebAssembly), so we delete the tracker on | 63 * caught (at least in WebAssembly), so we delete the tracker on |
64 * the next click inside the canvas. | 64 * the next click inside the canvas. |
65 **/ | 65 **/ |
66 alive_ = false; | 66 alive_ = false; |
67 } | 67 } |
68 | 68 |
69 bool OneGesturePointerTracker::IsAlive() const | 69 bool OneGesturePointerTracker::IsAlive() const |
70 { | 70 { |
71 return alive_; | 71 return alive_; |
72 } | 72 } |
73 | |
74 boost::shared_ptr<ViewportController> OneGesturePointerTracker::GetController() | |
75 { | |
76 return controllerW_.lock(); | |
77 } | |
78 } | 73 } |