comparison Samples/Sdl/TrackerSampleApp.h @ 698:8b6adfb62a2f refactor-viewport-controller

Code is broken -- stashing ongoing work in a branch
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 15 May 2019 16:56:17 +0200
parents cb3b76d16234
children 059e1fd05fd6
comparison
equal deleted inserted replaced
660:cb3b76d16234 698:8b6adfb62a2f
16 * 16 *
17 * You should have received a copy of the GNU Affero General Public License 17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/ 19 **/
20 20
21 #include <Framework/Scene2D/OpenGLCompositor.h> 21 #include <Framework/Scene2DViewport/PointerTypes.h>
22
22 #include <Framework/Messages/IObserver.h> 23 #include <Framework/Messages/IObserver.h>
23 24
24 #include "../Common/IFlexiblePointerTracker.h" 25 #include <Framework/Scene2D/OpenGLCompositor.h>
25 #include "../Common/MeasureTools.h" 26
27 #include <Framework/Scene2DViewport/ViewportController.h>
28 #include <Framework/Scene2DViewport/IFlexiblePointerTracker.h>
29 #include <Framework/Scene2DViewport/MeasureTools.h>
26 30
27 #include <SDL.h> 31 #include <SDL.h>
28 32
29 #include <boost/make_shared.hpp> 33 #include <boost/make_shared.hpp>
30 #include <boost/shared_ptr.hpp> 34 #include <boost/shared_ptr.hpp>
31 #include <boost/enable_shared_from_this.hpp> 35 #include <boost/enable_shared_from_this.hpp>
32 36
33 namespace OrthancStone 37 namespace OrthancStone
34 { 38 {
35 class TrackerCommand;
36 typedef boost::shared_ptr<TrackerCommand> TrackerCommandPtr;
37
38 enum GuiTool 39 enum GuiTool
39 { 40 {
40 GuiTool_Rotate = 0, 41 GuiTool_Rotate = 0,
41 GuiTool_Pan, 42 GuiTool_Pan,
42 GuiTool_Zoom, 43 GuiTool_Zoom,
63 void PrepareScene(); 64 void PrepareScene();
64 void Run(); 65 void Run();
65 void SetInfoDisplayMessage(std::string key, std::string value); 66 void SetInfoDisplayMessage(std::string key, std::string value);
66 void DisableTracker(); 67 void DisableTracker();
67 68
68 Scene2D& GetScene(); 69 Scene2DPtr GetScene();
69 70
70 void HandleApplicationEvent(const SDL_Event& event); 71 void HandleApplicationEvent(const SDL_Event& event);
71 72
72 /** 73 /**
73 This method is called when the scene transform changes. It allows to 74 This method is called when the scene transform changes. It allows to
106 std::auto_ptr<OpenGLCompositor> compositor_; 107 std::auto_ptr<OpenGLCompositor> compositor_;
107 /** 108 /**
108 WARNING: the measuring tools do store a reference to the scene, and it 109 WARNING: the measuring tools do store a reference to the scene, and it
109 paramount that the scene gets destroyed AFTER the measurement tools. 110 paramount that the scene gets destroyed AFTER the measurement tools.
110 */ 111 */
111 Scene2D scene_; 112 ViewportControllerPtr controller_;
112 113
113 std::map<std::string, std::string> infoTextMap_; 114 std::map<std::string, std::string> infoTextMap_;
114 FlexiblePointerTrackerPtr activeTracker_; 115 FlexiblePointerTrackerPtr activeTracker_;
115 std::vector<TrackerCommandPtr> undoStack_; 116 std::vector<TrackerCommandPtr> undoStack_;
116 117