Mercurial > hg > orthanc-stone
comparison Framework/Scene2D/TextSceneLayer.cpp @ 602:03c4b998fcd0
display scene positions in the basic sample
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 29 Apr 2019 14:40:01 +0200 |
parents | b9ce24c606ae |
children | 61ba4b504e9a |
comparison
equal
deleted
inserted
replaced
600:6129b1e5ba42 | 602:03c4b998fcd0 |
---|---|
21 | 21 |
22 #include "TextSceneLayer.h" | 22 #include "TextSceneLayer.h" |
23 | 23 |
24 namespace OrthancStone | 24 namespace OrthancStone |
25 { | 25 { |
26 TextSceneLayer::TextSceneLayer(double x, | 26 TextSceneLayer::TextSceneLayer() : |
27 double y, | 27 x_(0), |
28 const std::string& utf8, | 28 y_(0), |
29 size_t fontIndex, | 29 fontIndex_(0), |
30 BitmapAnchor anchor, | 30 anchor_(BitmapAnchor_Center), |
31 unsigned int border) : | 31 border_(0), |
32 x_(x), | 32 revision_(0) |
33 y_(y), | |
34 utf8_(utf8), | |
35 fontIndex_(fontIndex), | |
36 anchor_(anchor), | |
37 border_(border) | |
38 { | 33 { |
39 } | 34 } |
40 | 35 |
41 | 36 |
42 ISceneLayer* TextSceneLayer::Clone() const | 37 ISceneLayer* TextSceneLayer::Clone() const |
43 { | 38 { |
44 std::auto_ptr<TextSceneLayer> cloned(new TextSceneLayer(x_, y_, utf8_, fontIndex_, anchor_, border_)); | 39 std::auto_ptr<TextSceneLayer> cloned(new TextSceneLayer); |
45 cloned->SetColor(GetRed(), GetGreen(), GetBlue()); | 40 cloned->SetColor(GetRed(), GetGreen(), GetBlue()); |
41 cloned->x_ = x_; | |
42 cloned->y_ = y_; | |
43 cloned->utf8_ = utf8_; | |
44 cloned->fontIndex_ = fontIndex_; | |
45 cloned->anchor_ = anchor_; | |
46 cloned->border_ = border_; | |
46 return cloned.release(); | 47 return cloned.release(); |
47 } | 48 } |
49 | |
50 void TextSceneLayer::SetPosition(double x, | |
51 double y) | |
52 { | |
53 x_ = x; | |
54 y_ = y; | |
55 revision_ ++; | |
56 } | |
57 | |
58 void TextSceneLayer::SetText(const std::string& utf8) | |
59 { | |
60 utf8_ = utf8; | |
61 revision_ ++; | |
62 } | |
63 | |
64 void TextSceneLayer::SetFontIndex(size_t fontIndex) | |
65 { | |
66 fontIndex_ = fontIndex; | |
67 revision_ ++; | |
68 } | |
69 | |
70 void TextSceneLayer::SetAnchor(BitmapAnchor anchor) | |
71 { | |
72 anchor_ = anchor; | |
73 revision_ ++; | |
74 } | |
75 | |
76 void TextSceneLayer::SetBorder(unsigned int border) | |
77 { | |
78 border_ = border; | |
79 revision_ ++; | |
80 } | |
48 } | 81 } |