#include "TextNode.h" #include "Rectangle.h" #include "FontsManager.h" #include "IFontEngine.h" #include "MeshPrimitives.h" #include "FontItem.h" #include "Color.h" TextNode::TextNode(const std::string& content, const DiscretePoint& loc) : AbstractVisualNode(loc) { mTextData.mContent = content; mTextData.mFont = FontItem("Arial", 16); mTextData.mLocation = loc; mTextData.mFillColor = Color(255, 255, 255); mTextData.mStrokeColor = Color(0, 0, 0); } TextNode::~TextNode() { } std::unique_ptr TextNode::Create(const std::string& content, const DiscretePoint& loc) { return std::make_unique(content, loc); } const Color& TextNode::getFillColor() const { return mTextData.mFillColor; } const Color& TextNode::getStrokeColor() const { return mTextData.mStrokeColor; } std::string TextNode::getFontLabel() const { return {}; } std::string TextNode::getContent() const { return mTextData.mContent; } void TextNode::setContent(const std::string& content) { mTextData.mContent = content; } void TextNode::setFillColor(const Color& color) { mTextData.mFillColor = color; } void TextNode::setStrokeColor(const Color& color) { mTextData.mStrokeColor = color; } void TextNode::update(FontsManager* drawingManager) { updateMesh(); updateTexture(drawingManager); } const TextData& TextNode::getTextData() const { return mTextData; } void TextNode::updateMesh() { } void TextNode::updateTexture(FontsManager* fontsManager) { }