#ifndef LinkManager_h
#define LinkManager_h

#include "2ObjIDTbl.h"	// For MC2ObjIDTbl.

/*************************************************************************
 * <_xZkqqHx_iNfMjBkCjBmM_xHqqkZx_>	MC2MolipRec
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJ_xHqqkZx_ID_xZkqqHx_iBhLiDiCiDiKiDhGiCmMiDiMiDfCiBfLiDgIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	MOLIP(_xZkqqHx_iDiCiDiLiDhG_xHqqkZx_) = MOve LInk Point
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.17 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
struct MC2MolipRec
{
	MC2MolipRec () : dwObjID(0), lMolipIdx(0) {}
	MC2MolipRec (DWORD id, long idx) : dwObjID(id), lMolipIdx(idx) {}

	DWORD	dwObjID;
	long	lMolipIdx;
}; // struct MC2MolipRec.

inline bool operator < (const MC2MolipRec& mlp0, const MC2MolipRec& mlp1)
{
	if (mlp0.dwObjID == mlp1.dwObjID)
		return mlp0.lMolipIdx < mlp1.lMolipIdx;
	return mlp0.dwObjID < mlp1.dwObjID;
} // bool operator < .

inline bool operator != (const MC2MolipRec& mlp0, const MC2MolipRec& mlp1)
{
	return (mlp0.dwObjID != mlp1.dwObjID) || (mlp0.lMolipIdx != mlp1.lMolipIdx);
} // bool operator < .

inline bool operator == (const MC2MolipRec& mlp0, const MC2MolipRec& mlp1)
{
	return !(mlp0 != mlp1);
} // bool operator < .

/*************************************************************************
 * <_xZkqqHx_iNfMjBkCjBmM_xHqqkZx_>	MC2MolipInfo
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	MC2PolyJoint_xZkqqHx_jEhKjHpBiCmGiDiCiDiKiDhGiBeFiDiKiDjDiDeOiCmMiKnGiMfHiCpAiLeMjIfOiClFiBeBjIeBiMiLjDfPiCmMjFmAiCnHjBnGiCkG_xHqqkZx_
 *			_xZkqqHx_iCmJiNiHiCoNiClJiCmE_xHqqkZx_MC2MolipInfo_xZkqqHx_jEhKjHpBiCoAjFmAiCnHjBnGiCkGiCmEiBeBiDiKiDjDiDeOjAoGiDiCiDiKiDhGiCmM_xHqqkZx_
 *			_xZkqqHx_jFmPiNfIiPpDiLlFiCpAiOoGiCoIiPgPiClHiInHiCmJiOgHjHhAiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.21 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
struct MC2MolipInfo
{
	MC2MolipInfo () {}
	DWORDVector vLinkFrom;
	DWORDVector vLinkTo;
}; // struct MC2MolipInfo.

typedef vector <MC2MolipInfo> FTMolipInfoVector;

//----- MC2LinkRec::wLinkKind_xZkqqHx_iCmMiDfOiDeDiDhG_xHqqkZx_ -----

/*************************************************************************
 * <_xZkqqHx_iNfMjBkCjBmM_xHqqkZx_>	MC2LinkRec
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOiCmMiDiMiDfCiBfLiDgIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.17 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
struct MC2LinkRec
{
	MC2LinkRec () : mlpFrom(0,0), mlpTo(0,0), mmptOffset(0,0),
						wLinkKind(FDLM_LINK_ON_COORD) {}
	MC2LinkRec (const MC2MolipRec& pntFrom, const MC2MolipRec& pntTo,
					const DBLPoint& mmpt, WORD kind)
				: mlpFrom(pntFrom), mlpTo(pntTo),
					mmptOffset(mmpt), wLinkKind(kind) {}

	MC2MolipRec	mlpFrom;		// _xZkqqHx_iDiKiDjDiDeOiMlDiDiCiDiKiDhGiBeC_xHqqkZx_
	MC2MolipRec	mlpTo;			// _xZkqqHx_iDiKiDjDiDeOjAoGiDiCiDiKiDhGiBeC_xHqqkZx_
	DBLPoint	mmptOffset;		// _xZkqqHx_iDiKiDjDiDeOiMlDiCkJiCoHiDiKiDjDiDeOjAoGiCnGiCmMiDeJiDhEiDfKiDgCiDgHiBeC_xHqqkZx_
	WORD		wLinkKind;		// mmptOffset_xZkqqHx_iCmMiOoNjHnOiBeC_xHqqkZx_FDLMLinkKind_xZkqqHx_iCmMiCfAiCmCiBeC_xHqqkZx_
}; // struct MC2MolipRec.

/*************************************************************************
 * <_xZkqqHx_iDeOiDiJiDfI_xHqqkZx_>	MC2LinkManager
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiKnEiCmMiDiKiDjDiDeOiPoOjFpBiCpAiKmHjHjNiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.14 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
class MC2LinkManager
{
public:
	MC2LinkManager ();
	~MC2LinkManager ();

	void	ClearAll ();
	void	OutStream (MC2ARCHIVE& ar);
	void	InStream (MC2ARCHIVE& ar);

protected:
	MC2ObjIDTbl				m_tblLinkID;		// _xZkqqHx_iDiKiDjDiDeO_xHqqkZx_ID->_xZkqqHx_iDiKiDjDiDeO_xHqqkZx_ _xZkqqHx_iDiBiDeDiDjDiDgFiBfLiDhFiDiLiBeC_xHqqkZx_
}; // class MC2LinkManager.

#endif//LinkManager_h
