comparison Framework/Scene2D/TextSceneLayer.h @ 585:b9ce24c606ae

TextSceneLayer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 19 Apr 2019 17:57:58 +0200
parents
children 03c4b998fcd0
comparison
equal deleted inserted replaced
584:434ceeb0bcab 585:b9ce24c606ae
1 /**
2 * Stone of Orthanc
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
6 *
7 * This program is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU Affero General Public License
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
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Affero General Public License for more details.
16 *
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/
20
21
22 #pragma once
23
24 #include "ColorSceneLayer.h"
25 #include "../StoneEnumerations.h"
26
27 #include <memory>
28 #include <string>
29
30 namespace OrthancStone
31 {
32 class TextSceneLayer : public ColorSceneLayer
33 {
34 private:
35 double x_;
36 double y_;
37 std::string utf8_;
38 size_t fontIndex_;
39 BitmapAnchor anchor_;
40 unsigned int border_;
41
42 public:
43 TextSceneLayer(double x,
44 double y,
45 const std::string& utf8,
46 size_t fontIndex,
47 BitmapAnchor anchor,
48 unsigned int border);
49
50 virtual ISceneLayer* Clone() const;
51
52 double GetX() const
53 {
54 return x_;
55 }
56
57 double GetY() const
58 {
59 return y_;
60 }
61
62 unsigned int GetBorder() const
63 {
64 return border_;
65 }
66
67 const std::string& GetText() const
68 {
69 return utf8_;
70 }
71
72 size_t GetFontIndex() const
73 {
74 return fontIndex_;
75 }
76
77 BitmapAnchor GetAnchor() const
78 {
79 return anchor_;
80 }
81
82 virtual Type GetType() const
83 {
84 return Type_Text;
85 }
86
87 virtual bool GetBoundingBox(Extent2D& target) const
88 {
89 return false;
90 }
91
92 virtual uint64_t GetRevision() const
93 {
94 return 0;
95 }
96 };
97 }