#pragma once

#include "QuantumCircuitElementNode.h"

class QuantumTerminal;
class EquationNode;
class LatexMathExpression;

class QuantumTerminalNode : public QuantumCircuitElementNode
{
public:
	QuantumTerminalNode(const Transform& transform);

	Point getConnectionLocation(AbstractQuantumWire* wire) const override;

	void setContent(QuantumTerminal* terminal);

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

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

	double mWidth = 20.0;
	double mHeight = 10.0;

	std::unique_ptr<LatexMathExpression> mLabelExpression;
	std::unique_ptr<EquationNode> mLabel;
};