diff Samples/Common/CreateAngleMeasureTracker.h @ 645:1e9ed656318e

Merge + ongoing measure work
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 13 May 2019 15:12:56 +0200
parents f939f449482c
children 462a5074f914
line wrap: on
line diff
--- a/Samples/Common/CreateAngleMeasureTracker.h	Fri May 10 16:15:55 2019 +0200
+++ b/Samples/Common/CreateAngleMeasureTracker.h	Mon May 13 15:12:56 2019 +0200
@@ -20,6 +20,45 @@
 
 #pragma once
 
+#include "MeasureTrackers.h"
+#include "MeasureCommands.h"
+
+#include <vector>
+
 namespace OrthancStone
 {
+  class CreateAngleMeasureTracker : public CreateMeasureTracker
+  {
+  public:
+    /**
+    When you create this tracker, you need to supply it with the undo stack
+    where it will store the commands that perform the actual measure tool
+    creation and modification.
+    In turn, a container for these commands to store the actual measuring
+    must be supplied, too
+    */
+    CreateAngleMeasureTracker(
+      Scene2D&                        scene,
+      std::vector<TrackerCommandPtr>& undoStack,
+      std::vector<MeasureToolPtr>&    measureTools,
+      const PointerEvent&             e);
+
+    ~CreateAngleMeasureTracker();
+
+    virtual void PointerMove(const PointerEvent& e) ORTHANC_OVERRIDE;
+    virtual void PointerUp(const PointerEvent& e) ORTHANC_OVERRIDE;
+    virtual void PointerDown(const PointerEvent& e) ORTHANC_OVERRIDE;
+
+  private:
+    CreateAngleMeasureCommandPtr GetCommand();
+
+    enum State
+    {
+      CreatingSide1,
+      CreatingSide2,
+      Finished // just for debug
+    };
+    State state_;
+
+  };
 }