Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Scene2DViewport/ViewportController.h @ 1557:a6f339d8e4c2
reorganization
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 20 Aug 2020 11:17:16 +0200 |
parents | 301571299212 |
children | 85e117739eca |
comparison
equal
deleted
inserted
replaced
1556:8898f8f755c8 | 1557:a6f339d8e4c2 |
---|---|
23 #include "PredeclaredTypes.h" | 23 #include "PredeclaredTypes.h" |
24 | 24 |
25 #include "../Messages/IObservable.h" | 25 #include "../Messages/IObservable.h" |
26 #include "../Scene2D/Scene2D.h" | 26 #include "../Scene2D/Scene2D.h" |
27 #include "../Scene2DViewport/IFlexiblePointerTracker.h" | 27 #include "../Scene2DViewport/IFlexiblePointerTracker.h" |
28 #include "../Viewport/IViewportInteractor.h" | |
28 | 29 |
29 #include <Compatibility.h> | 30 #include <Compatibility.h> |
30 | 31 |
31 #include <boost/enable_shared_from_this.hpp> | 32 #include <boost/enable_shared_from_this.hpp> |
32 #include <stack> | 33 #include <stack> |
33 | 34 |
34 namespace OrthancStone | 35 namespace OrthancStone |
35 { | 36 { |
36 // TODO - Move this to another file | |
37 class IViewportInteractor : public boost::noncopyable | |
38 { | |
39 public: | |
40 virtual ~IViewportInteractor() | |
41 { | |
42 } | |
43 | |
44 virtual IFlexiblePointerTracker* CreateTracker(boost::shared_ptr<IViewport> viewport, | |
45 const PointerEvent& event, | |
46 unsigned int viewportWidth, | |
47 unsigned int viewportHeight) = 0; | |
48 }; | |
49 | |
50 | |
51 // TODO - Move this to another file | |
52 class DefaultViewportInteractor : public IViewportInteractor | |
53 { | |
54 private: | |
55 // Index of the layer whose windowing is altered by clicking the | |
56 // left mouse button | |
57 int windowingLayer_; | |
58 | |
59 public: | |
60 DefaultViewportInteractor() : | |
61 windowingLayer_(0) | |
62 { | |
63 } | |
64 | |
65 int GetWindowingLayer() const | |
66 { | |
67 return windowingLayer_; | |
68 } | |
69 | |
70 void SetWindowingLayer(int layerIndex) | |
71 { | |
72 windowingLayer_ = layerIndex; | |
73 } | |
74 | |
75 virtual IFlexiblePointerTracker* CreateTracker(boost::shared_ptr<IViewport> viewport, | |
76 const PointerEvent& event, | |
77 unsigned int viewportWidth, | |
78 unsigned int viewportHeight) ORTHANC_OVERRIDE; | |
79 }; | |
80 | |
81 | |
82 class UndoStack; | 37 class UndoStack; |
83 | 38 |
84 const double ARC_RADIUS_CANVAS_COORD = 30.0; | 39 const double ARC_RADIUS_CANVAS_COORD = 30.0; |
85 const double TEXT_CENTER_DISTANCE_CANVAS_COORD = 90; | 40 const double TEXT_CENTER_DISTANCE_CANVAS_COORD = 90; |
86 | 41 |