Mercurial > hg > orthanc-stone
comparison Framework/Viewport/IMouseTracker.h @ 457:3b4df9925db6 am-touch-events
added support for 'touch' in mouse trackers. This is still a bit hacky and we need to refactor it to make it clean. Thanks to that, Pan and zoom are available together with 2 touches
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Thu, 24 Jan 2019 16:42:27 +0100 |
parents | b70e9be013e4 |
children | b716763571ad |
comparison
equal
deleted
inserted
replaced
456:b70fcc134ba4 | 457:3b4df9925db6 |
---|---|
20 | 20 |
21 | 21 |
22 #pragma once | 22 #pragma once |
23 | 23 |
24 #include "CairoSurface.h" | 24 #include "CairoSurface.h" |
25 #include <vector> | |
25 | 26 |
26 namespace OrthancStone | 27 namespace OrthancStone |
27 { | 28 { |
29 struct Touch | |
30 { | |
31 float x; | |
32 float y; | |
33 | |
34 Touch(float x, float y) | |
35 : x(x), | |
36 y(y) | |
37 { | |
38 } | |
39 Touch() | |
40 : x(0.0f), | |
41 y(0.0f) | |
42 { | |
43 } | |
44 }; | |
45 | |
46 | |
28 // this is tracking a mouse in screen coordinates/pixels unlike | 47 // this is tracking a mouse in screen coordinates/pixels unlike |
29 // the IWorldSceneMouseTracker that is tracking a mouse | 48 // the IWorldSceneMouseTracker that is tracking a mouse |
30 // in scene coordinates/mm. | 49 // in scene coordinates/mm. |
31 class IMouseTracker : public boost::noncopyable | 50 class IMouseTracker : public boost::noncopyable |
32 { | 51 { |
39 | 58 |
40 virtual void MouseUp() = 0; | 59 virtual void MouseUp() = 0; |
41 | 60 |
42 // Returns "true" iff. the background scene must be repainted | 61 // Returns "true" iff. the background scene must be repainted |
43 virtual void MouseMove(int x, | 62 virtual void MouseMove(int x, |
44 int y) = 0; | 63 int y, |
64 const std::vector<Touch>& displayTouches) = 0; | |
65 | |
66 virtual bool IsTouchTracker() const {return false;} | |
45 }; | 67 }; |
46 } | 68 } |