Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Scene2D/TextSceneLayer.h @ 1640:52b8b96cb55f
cleaning namespaces
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 10 Nov 2020 16:55:22 +0100 |
parents | b7630b1a0253 |
children | 9ac2a65d4172 |
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 | |
1270
2d8ab34c8c91
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
602
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
585 | 6 * |
7 * 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
|
8 * modify it under the terms of the GNU Lesser General Public License |
585 | 9 * as published by the Free Software Foundation, either version 3 of |
10 * the License, or (at your option) any later version. | |
11 * | |
12 * This program is distributed in the hope that it will be useful, but | |
13 * 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
|
14 * 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
|
15 * Lesser General Public License for more details. |
1596
4fb8fdf03314
removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1571
diff
changeset
|
16 * |
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
|
17 * 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
|
18 * 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
|
19 * <http://www.gnu.org/licenses/>. |
585 | 20 **/ |
21 | |
22 | |
23 #pragma once | |
24 | |
25 #include "ColorSceneLayer.h" | |
26 #include "../StoneEnumerations.h" | |
27 | |
28 #include <memory> | |
29 #include <string> | |
30 | |
31 namespace OrthancStone | |
32 { | |
33 class TextSceneLayer : public ColorSceneLayer | |
34 { | |
35 private: | |
36 double x_; | |
37 double y_; | |
38 std::string utf8_; | |
39 size_t fontIndex_; | |
40 BitmapAnchor anchor_; | |
41 unsigned int border_; | |
602
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
42 uint64_t revision_; |
585 | 43 |
44 public: | |
602
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
45 TextSceneLayer(); |
585 | 46 |
1571 | 47 virtual ISceneLayer* Clone() const ORTHANC_OVERRIDE; |
585 | 48 |
602
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
49 void SetPosition(double x, |
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
50 double y); |
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
51 |
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
52 void SetText(const std::string& utf8); |
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
53 |
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
54 void SetFontIndex(size_t fontIndex); |
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
55 |
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
56 void SetAnchor(BitmapAnchor anchor); |
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
57 |
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
58 void SetBorder(unsigned int border); |
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
59 |
585 | 60 double GetX() const |
61 { | |
62 return x_; | |
63 } | |
64 | |
65 double GetY() const | |
66 { | |
67 return y_; | |
68 } | |
69 | |
70 unsigned int GetBorder() const | |
71 { | |
72 return border_; | |
73 } | |
74 | |
75 const std::string& GetText() const | |
76 { | |
77 return utf8_; | |
78 } | |
79 | |
80 size_t GetFontIndex() const | |
81 { | |
82 return fontIndex_; | |
83 } | |
84 | |
85 BitmapAnchor GetAnchor() const | |
86 { | |
87 return anchor_; | |
88 } | |
89 | |
1571 | 90 virtual Type GetType() const ORTHANC_OVERRIDE |
585 | 91 { |
92 return Type_Text; | |
93 } | |
94 | |
1610
b7630b1a0253
ISceneLayer::GetBoundingBox() returns void
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
95 virtual void GetBoundingBox(Extent2D& target) const ORTHANC_OVERRIDE |
585 | 96 { |
1610
b7630b1a0253
ISceneLayer::GetBoundingBox() returns void
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
97 target.Clear(); |
585 | 98 } |
99 | |
1571 | 100 virtual uint64_t GetRevision() const ORTHANC_OVERRIDE |
585 | 101 { |
602
03c4b998fcd0
display scene positions in the basic sample
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
585
diff
changeset
|
102 return revision_; |
585 | 103 } |
104 }; | |
105 } |