Mercurial > hg > orthanc-stone
diff 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 |
line wrap: on
line diff
--- a/Framework/Scene2D/TextSceneLayer.cpp Sat Apr 27 12:38:25 2019 +0200 +++ b/Framework/Scene2D/TextSceneLayer.cpp Mon Apr 29 14:40:01 2019 +0200 @@ -23,26 +23,59 @@ namespace OrthancStone { - TextSceneLayer::TextSceneLayer(double x, - double y, - const std::string& utf8, - size_t fontIndex, - BitmapAnchor anchor, - unsigned int border) : - x_(x), - y_(y), - utf8_(utf8), - fontIndex_(fontIndex), - anchor_(anchor), - border_(border) + TextSceneLayer::TextSceneLayer() : + x_(0), + y_(0), + fontIndex_(0), + anchor_(BitmapAnchor_Center), + border_(0), + revision_(0) { } ISceneLayer* TextSceneLayer::Clone() const { - std::auto_ptr<TextSceneLayer> cloned(new TextSceneLayer(x_, y_, utf8_, fontIndex_, anchor_, border_)); + std::auto_ptr<TextSceneLayer> cloned(new TextSceneLayer); cloned->SetColor(GetRed(), GetGreen(), GetBlue()); + cloned->x_ = x_; + cloned->y_ = y_; + cloned->utf8_ = utf8_; + cloned->fontIndex_ = fontIndex_; + cloned->anchor_ = anchor_; + cloned->border_ = border_; return cloned.release(); } + + void TextSceneLayer::SetPosition(double x, + double y) + { + x_ = x; + y_ = y; + revision_ ++; + } + + void TextSceneLayer::SetText(const std::string& utf8) + { + utf8_ = utf8; + revision_ ++; + } + + void TextSceneLayer::SetFontIndex(size_t fontIndex) + { + fontIndex_ = fontIndex; + revision_ ++; + } + + void TextSceneLayer::SetAnchor(BitmapAnchor anchor) + { + anchor_ = anchor; + revision_ ++; + } + + void TextSceneLayer::SetBorder(unsigned int border) + { + border_ = border; + revision_ ++; + } }