annotate OrthancStone/Sources/Scene2D/TextSceneLayer.h @ 2110:352cb0fa57b2

fixed handling of DefineSourceBasenameForTarget
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 20 Dec 2023 22:20:58 +0100
parents 07964689cb0b
children c23eef785569
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
2077
07964689cb0b upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
07964689cb0b upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
16 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
17 *
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
19 * License along with this program. If not, see
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
20 * <http://www.gnu.org/licenses/>.
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "ColorSceneLayer.h"
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include "../StoneEnumerations.h"
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #include <memory>
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include <string>
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 namespace OrthancStone
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 class TextSceneLayer : public ColorSceneLayer
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 {
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 private:
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 double x_;
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 double y_;
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 std::string utf8_;
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 size_t fontIndex_;
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 BitmapAnchor anchor_;
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 unsigned int border_;
602
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
43 uint64_t revision_;
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 public:
602
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
46 TextSceneLayer();
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
48 virtual ISceneLayer* Clone() const ORTHANC_OVERRIDE;
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
602
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
50 void SetPosition(double x,
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
51 double y);
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
52
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
53 void SetText(const std::string& utf8);
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
54
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
55 void SetFontIndex(size_t fontIndex);
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
56
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
57 void SetAnchor(BitmapAnchor anchor);
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
58
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
59 void SetBorder(unsigned int border);
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
60
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 double GetX() const
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 {
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 return x_;
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 }
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 double GetY() const
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 {
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 return y_;
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 }
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 unsigned int GetBorder() const
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 {
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 return border_;
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 }
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 const std::string& GetText() const
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 {
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 return utf8_;
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 }
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 size_t GetFontIndex() const
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 {
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 return fontIndex_;
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 }
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 BitmapAnchor GetAnchor() const
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 {
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 return anchor_;
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 }
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
91 virtual Type GetType() const ORTHANC_OVERRIDE
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 {
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 return Type_Text;
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 }
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
1610
b7630b1a0253 ISceneLayer::GetBoundingBox() returns void
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
96 virtual void GetBoundingBox(Extent2D& target) const ORTHANC_OVERRIDE
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 {
1796
20a0aba0ede5 creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1739
diff changeset
98 target.Clear(); // Not implemented
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 }
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
101 virtual uint64_t GetRevision() const ORTHANC_OVERRIDE
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 {
602
03c4b998fcd0 display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 585
diff changeset
103 return revision_;
585
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 }
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 };
b9ce24c606ae TextSceneLayer
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 }