Mercurial > hg > orthanc-stone
diff Framework/Scene2DViewport/MeasureCommands.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 | c71ef52602a0 |
line wrap: on
line diff
--- a/Framework/Scene2DViewport/MeasureCommands.h Wed May 29 08:36:13 2019 +0200 +++ b/Framework/Scene2DViewport/MeasureCommands.h Wed May 29 10:51:28 2019 +0200 @@ -22,7 +22,7 @@ #include "../Scene2D/Scene2D.h" // to be moved into Stone -#include "PointerTypes.h" +#include "PredeclaredTypes.h" #include "MeasureTool.h" #include "LineMeasureTool.h" #include "AngleMeasureTool.h" @@ -35,7 +35,7 @@ class TrackerCommand : public boost::noncopyable { public: - TrackerCommand(ViewportControllerWPtr controllerW) + TrackerCommand(boost::weak_ptr<ViewportController> controllerW) : controllerW_(controllerW) { @@ -44,20 +44,20 @@ virtual void Redo() = 0; protected: - ViewportControllerPtr GetController(); - ViewportControllerWPtr controllerW_; + boost::shared_ptr<ViewportController> GetController(); + boost::weak_ptr<ViewportController> controllerW_; }; class CreateMeasureCommand : public TrackerCommand { public: - CreateMeasureCommand(ViewportControllerWPtr controllerW); + CreateMeasureCommand(boost::weak_ptr<ViewportController> controllerW); ~CreateMeasureCommand(); virtual void Undo() ORTHANC_OVERRIDE; virtual void Redo() ORTHANC_OVERRIDE; private: /** Must be implemented by the subclasses that create the actual tool */ - virtual MeasureToolPtr GetMeasureTool() = 0; + virtual boost::shared_ptr<MeasureTool> GetMeasureTool() = 0; }; class CreateLineMeasureCommand : public CreateMeasureCommand @@ -65,18 +65,18 @@ public: CreateLineMeasureCommand( MessageBroker& broker, - ViewportControllerWPtr controllerW, + boost::weak_ptr<ViewportController> controllerW, ScenePoint2D point); // the starting position is set in the ctor void SetEnd(ScenePoint2D scenePos); private: - virtual MeasureToolPtr GetMeasureTool() ORTHANC_OVERRIDE + virtual boost::shared_ptr<MeasureTool> GetMeasureTool() ORTHANC_OVERRIDE { return measureTool_; } - LineMeasureToolPtr measureTool_; + boost::shared_ptr<LineMeasureTool> measureTool_; }; @@ -86,7 +86,7 @@ /** Ctor sets end of side 1*/ CreateAngleMeasureCommand( MessageBroker& broker, - ViewportControllerWPtr controllerW, + boost::weak_ptr<ViewportController> controllerW, ScenePoint2D point); /** This method sets center*/ @@ -96,11 +96,11 @@ void SetSide2End(ScenePoint2D scenePos); private: - virtual MeasureToolPtr GetMeasureTool() ORTHANC_OVERRIDE + virtual boost::shared_ptr<MeasureTool> GetMeasureTool() ORTHANC_OVERRIDE { return measureTool_; } - AngleMeasureToolPtr measureTool_; + boost::shared_ptr<AngleMeasureTool> measureTool_; }; }