comparison Framework/Scene2DViewport/MeasureTool.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 a29c13497557
comparison
equal deleted inserted replaced
817:68f888812af4 818:e42b491f1fb2
22 22
23 #include "../Scene2D/PolylineSceneLayer.h" 23 #include "../Scene2D/PolylineSceneLayer.h"
24 #include "../Scene2D/Scene2D.h" 24 #include "../Scene2D/Scene2D.h"
25 #include "../Scene2D/ScenePoint2D.h" 25 #include "../Scene2D/ScenePoint2D.h"
26 #include "../Scene2D/TextSceneLayer.h" 26 #include "../Scene2D/TextSceneLayer.h"
27 #include "../Scene2DViewport/PointerTypes.h" 27 #include "../Scene2DViewport/PredeclaredTypes.h"
28 #include "../Scene2DViewport/ViewportController.h" 28 #include "../Scene2DViewport/ViewportController.h"
29 29
30 #include <boost/shared_ptr.hpp> 30 #include <boost/shared_ptr.hpp>
31 #include <boost/weak_ptr.hpp> 31 #include <boost/weak_ptr.hpp>
32 32
70 true, then a click at that position will return a tracker to edit the 70 true, then a click at that position will return a tracker to edit the
71 measuring tool 71 measuring tool
72 */ 72 */
73 virtual bool HitTest(ScenePoint2D p) const = 0; 73 virtual bool HitTest(ScenePoint2D p) const = 0;
74 protected: 74 protected:
75 MeasureTool(MessageBroker& broker, ViewportControllerWPtr controllerW); 75 MeasureTool(MessageBroker& broker, boost::weak_ptr<ViewportController> controllerW);
76 76
77 /** 77 /**
78 The measuring tool may exist in a standalone fashion, without any available 78 The measuring tool may exist in a standalone fashion, without any available
79 scene (because the controller is dead or dying). This call allows to check 79 scene (because the controller is dead or dying). This call allows to check
80 before accessing the scene. 80 before accessing the scene.
86 update the layers and their data according to the measure tool kind and 86 update the layers and their data according to the measure tool kind and
87 current state. This is repeatedly called during user interaction 87 current state. This is repeatedly called during user interaction
88 */ 88 */
89 virtual void RefreshScene() = 0; 89 virtual void RefreshScene() = 0;
90 90
91 ViewportControllerConstPtr GetController() const; 91 boost::shared_ptr<const ViewportController> GetController() const;
92 ViewportControllerPtr GetController(); 92 boost::shared_ptr<ViewportController> GetController();
93 93
94 Scene2DConstPtr GetScene() const; 94 boost::shared_ptr<const Scene2D> GetScene() const;
95 Scene2DPtr GetScene(); 95 boost::shared_ptr<Scene2D> GetScene();
96 96
97 /** 97 /**
98 enabled_ is not accessible by subclasses because there is a state machine 98 enabled_ is not accessible by subclasses because there is a state machine
99 that we do not wanna mess with 99 that we do not wanna mess with
100 */ 100 */
101 bool IsEnabled() const; 101 bool IsEnabled() const;
102 102
103 private: 103 private:
104 ViewportControllerWPtr controllerW_; 104 boost::weak_ptr<ViewportController> controllerW_;
105 bool enabled_; 105 bool enabled_;
106 }; 106 };
107 } 107 }
108 108
109 extern void TrackerSample_SetInfoDisplayMessage( 109 extern void TrackerSample_SetInfoDisplayMessage(