Clean project structure.
This commit is contained in:
parent
78a4fa99ff
commit
947bf937fd
496 changed files with 206 additions and 137 deletions
53
src/rendering/visual_elements/nodes/TextNode.h
Normal file
53
src/rendering/visual_elements/nodes/TextNode.h
Normal file
|
@ -0,0 +1,53 @@
|
|||
#pragma once
|
||||
|
||||
#include "MaterialNode.h"
|
||||
|
||||
#include "FontItem.h"
|
||||
#include "TextData.h"
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
class FontsManager;
|
||||
|
||||
class TextNode : public MaterialNode
|
||||
{
|
||||
public:
|
||||
TextNode(const std::string& content, const Point& loc);
|
||||
|
||||
~TextNode();
|
||||
|
||||
static std::unique_ptr<TextNode> Create(const std::string& content, const Point& loc);
|
||||
|
||||
std::string getContent() const;
|
||||
std::string getFontLabel() const;
|
||||
|
||||
SceneItem* getSceneItem(std::size_t idx) const override;
|
||||
std::size_t getNumSceneItems() const override;
|
||||
|
||||
double getWidth() const;
|
||||
double getHeight() const;
|
||||
|
||||
void setWidth(double width);
|
||||
void setHeight(double height);
|
||||
|
||||
void setContent(const std::string& content);
|
||||
|
||||
void setFont(const FontItem& font);
|
||||
|
||||
void update(SceneInfo* sceneInfo) override;
|
||||
private:
|
||||
|
||||
void updateLines(FontsManager* fontsManager);
|
||||
|
||||
TextData mTextData;
|
||||
bool mContentIsDirty{true};
|
||||
bool mLinesAreDirty{true};
|
||||
|
||||
double mWidth{1};
|
||||
double mHeight{1};
|
||||
|
||||
std::unique_ptr<SceneItem> mTextItem;
|
||||
};
|
||||
|
||||
using TextNodetr = std::unique_ptr<TextNode>;
|
Loading…
Add table
Add a link
Reference in a new issue