Mercurial > hg > orthanc-stone
comparison Samples/Sdl/TrackerSampleApp.h @ 818:e42b491f1fb2
Removed typedefs to shared_ptr by making them explicit. Removed using namespace
directives to make usage more explicit, too.
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 29 May 2019 10:51:28 +0200 |
parents | 66ac7a2d1e3a |
children | e3c56d4f863f |
comparison
equal
deleted
inserted
replaced
817:68f888812af4 | 818:e42b491f1fb2 |
---|---|
21 | 21 |
22 #include "../../Framework/Messages/IObserver.h" | 22 #include "../../Framework/Messages/IObserver.h" |
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/PointerTypes.h" | 26 #include "../../Framework/Scene2DViewport/PredeclaredTypes.h" |
27 #include "../../Framework/Scene2DViewport/ViewportController.h" | 27 #include "../../Framework/Scene2DViewport/ViewportController.h" |
28 | 28 |
29 #include <SDL.h> | 29 #include <SDL.h> |
30 | 30 |
31 #include <boost/make_shared.hpp> | 31 #include <boost/make_shared.hpp> |
62 void PrepareScene(); | 62 void PrepareScene(); |
63 void Run(); | 63 void Run(); |
64 void SetInfoDisplayMessage(std::string key, std::string value); | 64 void SetInfoDisplayMessage(std::string key, std::string value); |
65 void DisableTracker(); | 65 void DisableTracker(); |
66 | 66 |
67 Scene2DPtr GetScene(); | 67 boost::shared_ptr<Scene2D> GetScene(); |
68 Scene2DConstPtr GetScene() const; | 68 boost::shared_ptr<const Scene2D> GetScene() const; |
69 | 69 |
70 void HandleApplicationEvent(const SDL_Event& event); | 70 void HandleApplicationEvent(const SDL_Event& event); |
71 | 71 |
72 /** | 72 /** |
73 This method is called when the scene transform changes. It allows to | 73 This method is called when the scene transform changes. It allows to |
84 This returns a random point in the canvas part of the scene, but in | 84 This returns a random point in the canvas part of the scene, but in |
85 scene coordinates | 85 scene coordinates |
86 */ | 86 */ |
87 ScenePoint2D GetRandomPointInScene() const; | 87 ScenePoint2D GetRandomPointInScene() const; |
88 | 88 |
89 FlexiblePointerTrackerPtr TrackerHitTest(const PointerEvent& e); | 89 boost::shared_ptr<IFlexiblePointerTracker> TrackerHitTest(const PointerEvent& e); |
90 | 90 |
91 FlexiblePointerTrackerPtr CreateSuitableTracker( | 91 boost::shared_ptr<IFlexiblePointerTracker> CreateSuitableTracker( |
92 const SDL_Event& event, | 92 const SDL_Event& event, |
93 const PointerEvent& e); | 93 const PointerEvent& e); |
94 | 94 |
95 void TakeScreenshot( | 95 void TakeScreenshot( |
96 const std::string& target, | 96 const std::string& target, |
98 unsigned int canvasHeight); | 98 unsigned int canvasHeight); |
99 | 99 |
100 /** | 100 /** |
101 This adds the command at the top of the undo stack | 101 This adds the command at the top of the undo stack |
102 */ | 102 */ |
103 void Commit(TrackerCommandPtr cmd); | 103 void Commit(boost::shared_ptr<TrackerCommand> cmd); |
104 void Undo(); | 104 void Undo(); |
105 void Redo(); | 105 void Redo(); |
106 | 106 |
107 private: | 107 private: |
108 void DisplayFloatingCtrlInfoText(const PointerEvent& e); | 108 void DisplayFloatingCtrlInfoText(const PointerEvent& e); |
113 std::auto_ptr<OpenGLCompositor> compositor_; | 113 std::auto_ptr<OpenGLCompositor> compositor_; |
114 /** | 114 /** |
115 WARNING: the measuring tools do store a reference to the scene, and it | 115 WARNING: the measuring tools do store a reference to the scene, and it |
116 paramount that the scene gets destroyed AFTER the measurement tools. | 116 paramount that the scene gets destroyed AFTER the measurement tools. |
117 */ | 117 */ |
118 ViewportControllerPtr controller_; | 118 boost::shared_ptr<ViewportController> controller_; |
119 | 119 |
120 std::map<std::string, std::string> infoTextMap_; | 120 std::map<std::string, std::string> infoTextMap_; |
121 FlexiblePointerTrackerPtr activeTracker_; | 121 boost::shared_ptr<IFlexiblePointerTracker> activeTracker_; |
122 | 122 |
123 //static const int LAYER_POSITION = 150; | 123 //static const int LAYER_POSITION = 150; |
124 | 124 |
125 int TEXTURE_2x2_1_ZINDEX; | 125 int TEXTURE_2x2_1_ZINDEX; |
126 int TEXTURE_1x1_ZINDEX; | 126 int TEXTURE_1x1_ZINDEX; |