#pragma once

#include "MaterialNode.h"

class AbstractMesh;

class MeshNode : public MaterialNode
{
public:
    MeshNode(const DiscretePoint& location);
    void setMesh(AbstractMesh* mesh);

    SceneItem* getSceneItem(std::size_t idx) const override;
    unsigned getNumSceneItems() const override;

    void setWidth(unsigned width);
    void setHeight(unsigned height);

    void update(FontsManager* fontsManager) override;

private:
    bool mMeshIsDirty{true};
    AbstractMesh* mWorkingMesh{nullptr};

    unsigned mWidth{1};
    unsigned mHeight{1};
    std::unique_ptr<SceneModel> mModel;
};
