Mercurial > hg > orthanc-stone
comparison Samples/Sdl/TrackerSampleApp.h @ 900:f9ae731fdc25 am-dev
Merge
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Tue, 16 Jul 2019 12:42:31 +0200 |
parents | 0c5201499af8 |
children | a911f5bb48da |
comparison
equal
deleted
inserted
replaced
897:9c2f6d6b9f4a | 900:f9ae731fdc25 |
---|---|
23 #include "../../Framework/Scene2D/OpenGLCompositor.h" | 23 #include "../../Framework/Scene2D/OpenGLCompositor.h" |
24 #include "../../Framework/Scene2DViewport/IFlexiblePointerTracker.h" | 24 #include "../../Framework/Scene2DViewport/IFlexiblePointerTracker.h" |
25 #include "../../Framework/Scene2DViewport/MeasureTool.h" | 25 #include "../../Framework/Scene2DViewport/MeasureTool.h" |
26 #include "../../Framework/Scene2DViewport/PredeclaredTypes.h" | 26 #include "../../Framework/Scene2DViewport/PredeclaredTypes.h" |
27 #include "../../Framework/Scene2DViewport/ViewportController.h" | 27 #include "../../Framework/Scene2DViewport/ViewportController.h" |
28 #include "../../Framework/Viewport/SdlViewport.h" | |
28 | 29 |
29 #include <SDL.h> | 30 #include <SDL.h> |
30 | 31 |
31 #include <boost/make_shared.hpp> | 32 #include <boost/make_shared.hpp> |
32 #include <boost/shared_ptr.hpp> | 33 #include <boost/shared_ptr.hpp> |
76 | 77 |
77 private: | 78 private: |
78 void SelectNextTool(); | 79 void SelectNextTool(); |
79 void CreateRandomMeasureTool(); | 80 void CreateRandomMeasureTool(); |
80 | 81 |
82 | |
83 /** | |
84 In the case of this app, the viewport is an SDL viewport and it has | |
85 a OpenGLCompositor& GetCompositor() method | |
86 */ | |
87 OpenGLCompositor& GetCompositor(); | |
88 | |
89 /** | |
90 See the other overload | |
91 */ | |
92 const OpenGLCompositor& GetCompositor() const; | |
93 | |
81 /** | 94 /** |
82 This returns a random point in the canvas part of the scene, but in | 95 This returns a random point in the canvas part of the scene, but in |
83 scene coordinates | 96 scene coordinates |
84 */ | 97 */ |
85 ScenePoint2D GetRandomPointInScene() const; | 98 ScenePoint2D GetRandomPointInScene() const; |
106 void DisplayFloatingCtrlInfoText(const PointerEvent& e); | 119 void DisplayFloatingCtrlInfoText(const PointerEvent& e); |
107 void DisplayInfoText(); | 120 void DisplayInfoText(); |
108 void HideInfoText(); | 121 void HideInfoText(); |
109 | 122 |
110 private: | 123 private: |
111 std::auto_ptr<OpenGLCompositor> compositor_; | |
112 /** | 124 /** |
113 WARNING: the measuring tools do store a reference to the scene, and it | 125 WARNING: the measuring tools do store a reference to the scene, and it |
114 paramount that the scene gets destroyed AFTER the measurement tools. | 126 paramount that the scene gets destroyed AFTER the measurement tools. |
115 */ | 127 */ |
116 boost::shared_ptr<ViewportController> controller_; | 128 boost::shared_ptr<ViewportController> controller_; |
128 int FLOATING_INFOTEXT_LAYER_ZINDEX; | 140 int FLOATING_INFOTEXT_LAYER_ZINDEX; |
129 int FIXED_INFOTEXT_LAYER_ZINDEX; | 141 int FIXED_INFOTEXT_LAYER_ZINDEX; |
130 | 142 |
131 GuiTool currentTool_; | 143 GuiTool currentTool_; |
132 boost::shared_ptr<UndoStack> undoStack_; | 144 boost::shared_ptr<UndoStack> undoStack_; |
145 SdlViewport viewport_; | |
133 }; | 146 }; |
134 | 147 |
135 } | 148 } |