Mercurial > hg > orthanc-stone
comparison 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 |
comparison
equal
deleted
inserted
replaced
2000:3e9ced39cd1b | 2001:e943a84da9ac |
---|---|
32 public: | 32 public: |
33 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, AnnotationAddedMessage, AnnotationsSceneLayer); | 33 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, AnnotationAddedMessage, AnnotationsSceneLayer); |
34 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, AnnotationRemovedMessage, AnnotationsSceneLayer); | 34 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, AnnotationRemovedMessage, AnnotationsSceneLayer); |
35 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, AnnotationChangedMessage, AnnotationsSceneLayer); | 35 ORTHANC_STONE_DEFINE_ORIGIN_MESSAGE(__FILE__, __LINE__, AnnotationChangedMessage, AnnotationsSceneLayer); |
36 | 36 |
37 class TextAnnotationRequiredMessage : public OriginMessage<AnnotationsSceneLayer> | |
38 { | |
39 ORTHANC_STONE_MESSAGE(__FILE__, __LINE__); | |
40 | |
41 private: | |
42 ScenePoint2D pointedPosition_; | |
43 ScenePoint2D labelPosition_; | |
44 | |
45 public: | |
46 TextAnnotationRequiredMessage(const AnnotationsSceneLayer& origin, | |
47 ScenePoint2D pointedPosition, | |
48 ScenePoint2D labelPosition) : | |
49 OriginMessage(origin), | |
50 pointedPosition_(pointedPosition), | |
51 labelPosition_(labelPosition) | |
52 { | |
53 } | |
54 | |
55 const ScenePoint2D& GetPointedPosition() const | |
56 { | |
57 return pointedPosition_; | |
58 } | |
59 | |
60 const ScenePoint2D& GetLabelPosition() const | |
61 { | |
62 return labelPosition_; | |
63 } | |
64 }; | |
65 | |
37 enum Tool | 66 enum Tool |
38 { | 67 { |
39 Tool_Edit, | 68 Tool_Edit, |
40 Tool_None, | 69 Tool_None, |
41 Tool_Length, | 70 Tool_Length, |
71 class EditPrimitiveTracker; | 100 class EditPrimitiveTracker; |
72 class CreateTwoHandlesTracker; | 101 class CreateTwoHandlesTracker; |
73 class CreateAngleTracker; | 102 class CreateAngleTracker; |
74 class CreatePixelProbeTracker; | 103 class CreatePixelProbeTracker; |
75 class RemoveTracker; | 104 class RemoveTracker; |
105 class CreateTextAnnotationTracker; | |
76 | 106 |
77 typedef std::set<GeometricPrimitive*> GeometricPrimitives; | 107 typedef std::set<GeometricPrimitive*> GeometricPrimitives; |
78 typedef std::set<Annotation*> Annotations; | 108 typedef std::set<Annotation*> Annotations; |
79 typedef std::set<size_t> SubLayers; | 109 typedef std::set<size_t> SubLayers; |
80 | 110 |
153 | 183 |
154 int GetProbedLayer() const | 184 int GetProbedLayer() const |
155 { | 185 { |
156 return probedLayer_; | 186 return probedLayer_; |
157 } | 187 } |
188 | |
189 void AddTextAnnotation(const std::string& label, | |
190 const ScenePoint2D& pointedPosition, | |
191 const ScenePoint2D& labelPosition); | |
158 }; | 192 }; |
159 } | 193 } |