#pragma once

#include "MaterialNode.h"

struct SceneInfo;
class SceneModel;

class GeometryNode : public MaterialNode
{
public:
    enum class Type
    {
        Path,
        Rectangle,
        Circle,
        Arc,
        Line,
        Polygon
    };

public:
    GeometryNode(const Transform& transform);
    virtual ~GeometryNode();

    virtual Type getType() = 0;

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

    double getStrokeThickness() const;
    void setStrokeThickness(double thickness);

    void update(SceneInfo* sceneInfo) override;

protected:
    virtual void createOrUpdateGeometry(SceneInfo* sceneInfo) = 0;
    virtual void updateMaterial();

    double mStrokeThickness{0};
    Type mType;
    bool mGeometryIsDirty{true};

    std::unique_ptr<SceneModel> mBackgroundItem;
};

using GeometryNodePtr = std::unique_ptr<GeometryNode>;
