diff OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.h @ 2001:e943a84da9ac

creation of text annotations
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Nov 2022 14:56:35 +0100
parents 709b90ae0f89
children 86e0e92a2e0d 07964689cb0b
line wrap: on
line diff
--- a/OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.h	Wed Nov 02 13:52:14 2022 +0100
+++ b/OrthancStone/Sources/Scene2D/AnnotationsSceneLayer.h	Wed Nov 02 14:56:35 2022 +0100
@@ -34,6 +34,35 @@
     ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, AnnotationRemovedMessage, AnnotationsSceneLayer);
     ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, AnnotationChangedMessage, AnnotationsSceneLayer);
 
+    class TextAnnotationRequiredMessage : public OriginMessage<AnnotationsSceneLayer>
+    {
+      ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
+
+    private:
+      ScenePoint2D pointedPosition_;
+      ScenePoint2D labelPosition_;
+
+    public:
+      TextAnnotationRequiredMessage(const AnnotationsSceneLayer& origin,
+                                    ScenePoint2D pointedPosition,
+                                    ScenePoint2D labelPosition) :
+        OriginMessage(origin),
+        pointedPosition_(pointedPosition),
+        labelPosition_(labelPosition)
+      {
+      }
+      
+      const ScenePoint2D& GetPointedPosition() const
+      {
+        return pointedPosition_;
+      }
+      
+      const ScenePoint2D& GetLabelPosition() const
+      {
+        return labelPosition_;
+      }
+    };
+    
     enum Tool
     {
       Tool_Edit,
@@ -73,6 +102,7 @@
     class CreateAngleTracker;
     class CreatePixelProbeTracker;
     class RemoveTracker;
+    class CreateTextAnnotationTracker;
 
     typedef std::set<GeometricPrimitive*>  GeometricPrimitives;
     typedef std::set<Annotation*>          Annotations;
@@ -155,5 +185,9 @@
     {
       return probedLayer_;
     }
+
+    void AddTextAnnotation(const std::string& label,
+                           const ScenePoint2D& pointedPosition,
+                           const ScenePoint2D& labelPosition);
   };
 }