Mercurial > hg > orthanc-stone
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 |
rev | line source |
---|---|
585 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
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 | 7 * |
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 | 10 * as published by the Free Software Foundation, either version 3 of |
11 * the License, or (at your option) any later version. | |
12 * | |
13 * This program is distributed in the hope that it will be useful, but | |
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 | 21 **/ |
22 | |
23 | |
24 #pragma once | |
25 | |
26 #include "ColorSceneLayer.h" | |
27 #include "../StoneEnumerations.h" | |
28 | |
29 #include <memory> | |
30 #include <string> | |
31 | |
32 namespace OrthancStone | |
33 { | |
34 class TextSceneLayer : public ColorSceneLayer | |
35 { | |
36 private: | |
37 double x_; | |
38 double y_; | |
39 std::string utf8_; | |
40 size_t fontIndex_; | |
41 BitmapAnchor anchor_; | |
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 | 44 |
45 public: | |
602
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
46 TextSceneLayer(); |
585 | 47 |
1571 | 48 virtual ISceneLayer* Clone() const ORTHANC_OVERRIDE; |
585 | 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 | 61 double GetX() const |
62 { | |
63 return x_; | |
64 } | |
65 | |
66 double GetY() const | |
67 { | |
68 return y_; | |
69 } | |
70 | |
71 unsigned int GetBorder() const | |
72 { | |
73 return border_; | |
74 } | |
75 | |
76 const std::string& GetText() const | |
77 { | |
78 return utf8_; | |
79 } | |
80 | |
81 size_t GetFontIndex() const | |
82 { | |
83 return fontIndex_; | |
84 } | |
85 | |
86 BitmapAnchor GetAnchor() const | |
87 { | |
88 return anchor_; | |
89 } | |
90 | |
1571 | 91 virtual Type GetType() const ORTHANC_OVERRIDE |
585 | 92 { |
93 return Type_Text; | |
94 } | |
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 | 97 { |
1796
20a0aba0ede5
creation of AnnotationsOverlay
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1739
diff
changeset
|
98 target.Clear(); // Not implemented |
585 | 99 } |
100 | |
1571 | 101 virtual uint64_t GetRevision() const ORTHANC_OVERRIDE |
585 | 102 { |
602
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
103 return revision_; |
585 | 104 } |
105 }; | |
106 } |