diff OrthancStone/Sources/Scene2DViewport/MeasureTool.h @ 1576:92fca2b3ba3d

sanitizing the handling of canvas size
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 24 Sep 2020 16:40:30 +0200
parents 85e117739eca
children 8563ea5d8ae4
line wrap: on
line diff
--- a/OrthancStone/Sources/Scene2DViewport/MeasureTool.h	Wed Sep 23 17:25:25 2020 +0200
+++ b/OrthancStone/Sources/Scene2DViewport/MeasureTool.h	Thu Sep 24 16:40:30 2020 +0200
@@ -43,6 +43,39 @@
   private:
     bool     enabled_;
 
+
+  protected:
+    explicit MeasureTool(boost::shared_ptr<IViewport> viewport);
+
+    void PostConstructor();
+
+    /**
+       The measuring tool may exist in a standalone fashion, without any available
+       scene (because the controller is dead or dying). This call allows to check 
+       before accessing the scene.
+    */
+    bool IsSceneAlive() const;
+    
+    /**
+       This is the meat of the tool: this method must [create (if needed) and]
+       update the layers and their data according to the measure tool kind and
+       current state. This is repeatedly called during user interaction
+    */
+    virtual void RefreshScene() = 0;
+
+    /**
+       enabled_ is not accessible by subclasses because there is a state machine
+       that we do not wanna mess with
+    */
+    bool IsEnabled() const;
+
+    /**
+       Protected to allow sub-classes to use this weak pointer in factory methods
+       (pass them to created objects)
+    */
+    boost::shared_ptr<IViewport> viewport_;
+
+
   public:
     virtual ~MeasureTool()
     {
@@ -114,37 +147,6 @@
        A description of the measuring tool, useful in debug logs
     */
     virtual std::string GetDescription() = 0;
-
-  protected:
-    explicit MeasureTool(boost::shared_ptr<IViewport> viewport);
-
-    void PostConstructor();
-
-    /**
-       The measuring tool may exist in a standalone fashion, without any available
-       scene (because the controller is dead or dying). This call allows to check 
-       before accessing the scene.
-    */
-    bool IsSceneAlive() const;
-    
-    /**
-       This is the meat of the tool: this method must [create (if needed) and]
-       update the layers and their data according to the measure tool kind and
-       current state. This is repeatedly called during user interaction
-    */
-    virtual void RefreshScene() = 0;
-
-    /**
-       enabled_ is not accessible by subclasses because there is a state machine
-       that we do not wanna mess with
-    */
-    bool IsEnabled() const;
-
-    /**
-       Protected to allow sub-classes to use this weak pointer in factory methods
-       (pass them to created objects)
-    */
-    boost::shared_ptr<IViewport> viewport_;
   };
 
   class MeasureToolMemento