#pragma once

#include "CircuitElementNode.h"

#include "CircleNode.h"

class LogicGate;
class PathNode;

class LogicGateNode : public CircuitElementNode
{
public:
    LogicGateNode(const Transform& transform);

    virtual ~LogicGateNode();

    Point getConnectionLocation(Wire* wire) const override;

    void setContent(LogicGate* content);

    void update(SceneInfo* sceneInfo);
private:
    void createOrUpdateGeometry(SceneInfo* sceneInfo);

    LogicGate* mContent{ nullptr };
    bool mContentDirty{ true };

    std::unique_ptr<PathNode> mPrimaryPath;
    std::unique_ptr<CircleNode> mNegationGlyph;
};
