#pragma once
#include "commonobject.h"
#include "gate.h"

class CBlock : public CGate
{
public:
	CBlock(CStringList &slIns, CStringList &slOuts, CString strName, CStringA strOrigin, CPoint TopLeftOrigin);
	//CBlock(int nIns, int nOuts, CString *strIns, CString *strOuts, CString strName, CStringA strOrigin, CPoint TopLeftOrigin,GraphicsPath *gp, GraphicsPath *gpText, CRect *rectIn, CRect *rectOut, bool *bInvIn, bool*bInvOut);
	CBlock(CString *strIns, CString *strOuts, int nIn, int nOut, CPoint TopLeftOrigin, CString strName, CStringA strOrigin, GraphicsPath *gp, CPoint *pntIn, CPoint *pntOut, bool *bInvIn, bool*bInvOut, int *dirIn, int *dirOut);
	CBlock(CPoint TopLeftOrigin, CString strName, CStringA strOrigin, GraphicsPath *gp, 
				  vector<CPoint> pntIn, vector<CPoint> pntOut, vector<bool> bInvIn, vector<bool> bInvOut, vector<int> dirIn, vector<int> dirOut);

	~CBlock(void);

	void OutScreen(Graphics &g);
	void OutXml(stringstream &ss) {};
	void OutXmlDrawing(stringstream &ss);
/*	bool HitTest(CPoint point);*/
	CCommonObject* Clone(CPoint TopLeftOrigin, CString strNewName, int nRotation);
/*	CString GetObjectName(){return m_strUniqueName;}
	void SetConnection(bool bIn, int nPos, CCommonObject* pConnectTo);
	void DisconnectCObject(CCommonObject *pObject);
	void Disconnect();
*/
	void SetRotation(int nRotation);
private:
/*	void ResetGPath();
	void TransformCObject(Matrix* pMat);
	void InitInOutRectangles();*/
	void CreateTags();
	void CreateTextGPath(CString strTag);

	void Init();

public:
	CString *m_strInTags; // used for creating name tags inside block
	CString *m_strOutTags; // used for creating name tags inside block

private:
	int m_nBlockWidth;
	int m_nBlockHeigth;
	Brush *m_pTextBrush;
	//CStringA m_strOrigin; // filepath
	CStringList m_slContent;
};
