#pragma once

#include "LineEndNode.h"

#include <vector>

class Plot;
class LineNode;
class PlotCaptionNode;
class PlotSeriesNode;

class PlotNode : public AbstractVisualNode
{
public:
    PlotNode(const Transform& transform = {});

    void setContent(Plot* content);

    void setAxisEndStyle(LineEndNode::Style style);

    void update(SceneInfo* sceneInfo) override;

protected:
    void createOrUpdateGeometry(SceneInfo* sceneInfo);

    Plot* mContent{ nullptr };
    bool mContentDirty = true;

    std::unique_ptr<LineNode> mXAxis;
    std::unique_ptr<LineNode> mYAxis;
    LineEndNode::Style mAxisEndStyle{ LineEndNode::Style::NONE };

    std::unique_ptr<PlotCaptionNode> mXAxisCaption;
    std::unique_ptr<PlotCaptionNode> mYAxisCaption;

    std::vector<std::unique_ptr<PlotSeriesNode> > mSeries;

};

