#include "stdafx.h"
#include "DynamicDraw.h"
#include "UtilCoord.h"		// For mm2lg.etc.
#include "UtilBezier.h"			// For CalcBezier2.
#include "Arrow.h"				// For FCStdArrow.
#include "UtilGraph.h"			// For FCEditDraw.
#include "UtilObj.h"			// For FFObjTypeToStr.
#include "ObjDynabase.h"			// For FCObjDynabase.
#include "FoundDoc.h"			// For g_pDoc.
#include "LinkManager.h"		// For FCMolipRec.
#include "DynamicDrawView.h"		// For g_pView.
#include "MainFrame.h"			// For MoveRulerMMK,etc..
// 05.06.07 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//#include "ZOrder.h"				// For FCZOrder.
#include "DlgLinkProperty.h"	// For CFCDlgLinkProperty.
#include "ToolLink.h"			// This header.

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


// 02.12.05 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//FCToolLink g_toolLink;

//////////////////////////////////////////////////////////////////////////
// FCToolLink _xZkqqHx_iDiNiBfLiDeKiDiLiKnGjAjEiBeC_xHqqkZx_

//----- 05.06.07 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	myGetMolipPos
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiCmMjFjEjFgJiCmMiOhHjCoIiCmMiDiCiDiKiDhG_xHqqkZx_ID_xZkqqHx_iCmMiDiCiDiKiDhGiImKjChFiCpAiOoGjDlOiClHiCoJiKnGjAjEiBeC_xHqqkZx_
// *			_xZkqqHx_iDiCiDiKiDhGiInKjDkOiDgFiBfLiDhFiDiL_xHqqkZx_ m_mpObjIdToMolipInfo _xZkqqHx_iCpAiNgMjHlGiClFiCmEiDiCiDiKiDhGiImKjChFiCpA_xHqqkZx_
// *			_xZkqqHx_iMhGiOfKiClHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	mmpt		:_xZkqqHx_iDiCiDiKiDhGiImKjChFiCpAjFnEiClHiBeC_xHqqkZx_
// *			dwData		:_xZkqqHx_iClBiCmMiKnGjAjEjHhAiCmMiDgGiBfLiDfOiCpAiOhHjCoIiBeC_xHqqkZx_
// *			pObj		:_xZkqqHx_iDfOiBfLiDfBiDgCiDgHiCmMjFjEjFgJiCpAiOhHjCoIiBeC_xHqqkZx_
// *			lMolipId	:_xZkqqHx_iDiCiDiKiDhG_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
// *			lTerminalIdx:_xZkqqHx_iDiCiDiKiDhGiCmMiDfOiBfLiDhOiDgJiDiLiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iOoGjDlOiCmFiCkLiClNiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//static BOOL myGetMolipPos (	DBLPoint& mmpt, DWORD dwData, const FCObjDynabase* pObj,
//							long lMolipId, long lTerminalIdx = 0)
//{
//	if (lTerminalIdx != 0) return FALSE;
//	pObj->GetMolipPos(mmpt, lMolipId, 0);
//	FCToolLink* pTool = (FCToolLink*)dwData;
//	map<DWORD, FCTLMolipInfo>::const_iterator iOmi;
//	iOmi = pTool->m_mpObjIdToMolipInfo.find(pObj->GetObjID());
//	if (iOmi != pTool->m_mpObjIdToMolipInfo.end())
//	{
//		map<long, DBLPoint>::const_iterator iLd;
//		iLd = (*iOmi).second.m_mpIdToOffset.find(lMolipId);
//		if (iLd != (*iOmi).second.m_mpIdToOffset.end())
//		{
//			mmpt += (*iLd).second;
//		}
//	}
//	return TRUE;
//} // myGetMolipPos.
//----- 05.06.07 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 05.06.06 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//static BOOL myCheckAndPickOffInfo (map<DWORD, FCTLMolipInfo>& mpInfo,
//									const FCObjDynabase* pObj)
//{
//	BOOL bModified = FALSE;
//	map<DWORD, FCTLMolipInfo>::iterator iOmi;
//	iOmi = mpInfo.find(pObj->GetObjID());
//	if (iOmi != mpInfo.end())
//	//----- _xZkqqHx_iOhHjCoIiCmMjFjEjFgJiCmJiKnGiClHiCoJiDiCiDiKiDhGiInKjDkOiPoOjFpBiCkKjBlGiNnNiClHiCoJiPoKiNiH_xHqqkZx_ -----
//	{
//		if ((*iOmi).second.m_lMolipCount != pObj->GetMolipCount())
//		//----- _xZkqqHx_iDiCiDiKiDhGiInKjDkOiPoOjFpBiCmJjFnLjBlGiClDiCoKiCmEiCkCiCoJiDiCiDiKiDhGjAjEiCmGiBeB_xHqqkZx_
//		//		_xZkqqHx_iMlLiNnNiCmMjFjEjFgJiCmMiDiCiDiKiDhGjAjEiCkKiIoKjChGiClFiCmIiCkCiPoKiNiH_xHqqkZx_ -----
//		{
//			mpInfo.erase(iOmi);
//			bModified = TRUE;
//		} else
//		{
//			const DBLRect mmrtResizeFrame = pObj->GetResizeFrame();
//			map<long, DBLPoint>::iterator iLd;
//			iLd = (*iOmi).second.m_mpIdToOffset.begin();
//			while (iLd != (*iOmi).second.m_mpIdToOffset.end())
//			{
//				DBLPoint mmptMolipPos;
//				pObj->GetMolipPos(mmptMolipPos, (*iLd).first);
//				mmptMolipPos += (*iLd).second;
//				if (!mmrtResizeFrame.PtInRect(mmptMolipPos))
//				//----- _xZkqqHx_iInKjDkOiClFiClNiDiCiDiKiDhGiCkKiDhEiDiMiBfLiDiAiCmJiOpLiCnMiCoHiCmIiCkCiPoKiNiH_xHqqkZx_ -----
//				{
//					iLd = (*iOmi).second.m_mpIdToOffset.erase(iLd);
//					bModified = TRUE;
//				} else
//				{
//					iLd++;
//				}
//			}
//			if ((*iOmi).second.m_mpIdToOffset.empty())
//			{
//				mpInfo.erase(iOmi);
//				bModified = TRUE;
//			}
//		}
//	}
//	return bModified;
//} // myCheckAndPickOffInfo.
//
//static void myPickOffInfo (map<DWORD, FCTLMolipInfo>& mpInfo,
//							const FCObjDynabase* pObj, long lMolipId)
//{
//	map<DWORD, FCTLMolipInfo>::iterator iOmi;
//	iOmi = mpInfo.find(pObj->GetObjID());
//	if (iOmi != mpInfo.end())
//	{
//		map<long, DBLPoint>::iterator iLd;
//		iLd = (*iOmi).second.m_mpIdToOffset.find(lMolipId);
//		if (iLd != (*iOmi).second.m_mpIdToOffset.end())
//			(*iOmi).second.m_mpIdToOffset.erase(iLd);
//		if ((*iOmi).second.m_mpIdToOffset.empty())
//			mpInfo.erase(iOmi);
//	}
//} // myPickOffInfo.
//
//static void myInsertInfo (	map<DWORD, FCTLMolipInfo>& mpInfo,
//							const FCObjDynabase* pObj, long lMolipId,
//							const DBLPoint& mmptOffset)
//{
//	mpInfo[pObj->GetObjID()].m_lMolipCount = pObj->GetMolipCount();
//	mpInfo[pObj->GetObjID()].m_mpIdToOffset[lMolipId] = mmptOffset;
//} // myInsertInfo.
//----- 05.06.06 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//////////////////////////////////////////////////////////////////////////
// FCToolLink _xZkqqHx_iDiBiDjDiDgPiKnGjAjEiBeC_xHqqkZx_

//----- 06.12.09 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::OnDraw
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	View_xZkqqHx_iCmM_xHqqkZx_OnDraw_xZkqqHx_iCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC		:_xZkqqHx_jFfMiOkGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *			pmmrtRgn:_xZkqqHx_iDiKiBfLiDfHiDiHiDjDjEhKjHpBiCpAiOhHjCoIiBeCiOgHiCoNiCmIiCkCiPoKiNiHiCmN_xHqqkZx_NULL_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
// *			lRgnSize:pmmrtRgn_xZkqqHx_iCmMjEhKjHpBiDfEiDeDiDfJiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.03.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLink::OnDraw (CDC* pDC)
//{
//	// FDA_xZkqqHx_iCmMiMlLiNnNiCmMiPpDjBnEiBeC_xHqqkZx_
//	switch (GetCurrentState())
//	{
//	case STATE_LINKING:				// _xZkqqHx_iDiKiDjDiDeOjCiGiBeC_xHqqkZx_
//	  {
//		// _xZkqqHx_iPeDjAlDjApMjFgAiJoGjHhAiDeOiDiJiDfIiCpAiNoMjAkMiBeC_xHqqkZx_
//		FCEditDraw eDraw(pDC, 0);
//		//----- _xZkqqHx_iDiKiDjDiDeOjApMiCpAjFgAiJoG_xHqqkZx_ -----
//		eDraw.Line(&mm2lg(m_mmptFromMolip), &mm2lg(m_mmptLast));
//		break;
//	  }
////----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
////	case STATE_ENCLOSING_LINK:		// _xZkqqHx_iDiKiDjDiDeOjFoPiImNjCiGiBeC_xHqqkZx_
////		DrawCurFocusFrame(pDC);
////		break;
////----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//	case STATE_MOVING_MOLIP_MARK:	// _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOjCiGiBeC_xHqqkZx_
//	  {
//		// _xZkqqHx_iPeDjAlDjApMjFgAiJoGjHhAiDeOiDiJiDfIiCpAiNoMjAkMiBeC_xHqqkZx_
//		FCEditDraw eDraw(pDC, 0);
//		// _xZkqqHx_iInKjDkOjCiGiDiCiDiKiDhGiNmAjFfHiCmJiLoJiMgAiCpAjFgAiJoGiBeC_xHqqkZx_
//		eDraw.UnselMark(mm2lg(m_mmptLast));
//		break;
//	  }
//	}
//	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
//	BASE_CLASS::OnDraw(pDC);
//} // FCToolLink::OnDraw.
//----- 06.12.09 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::OnSelectObjModified
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgDiBfLiDiLiCmFjBeJjBpAjCiGiCmMjFjEjFgJiCkKiBeBiDgDiBfLiDiLiImIiKePiCmMiPoKiPiKiCmFiPeDjAlDiClDiCoKiClNiPoKiNiHiCmJ_xHqqkZx_
 *			_xZkqqHx_iOmAiNhDiClDiCoKiCoJiBeCjFnCiPfHjHhAiDhNiBfLiDeOiCmMiNmEjFgAiJoGiCmMjFeLjHhGiCmNjGlDiCkCiBgJjFmKjDhCiMmEiCmOiCoKiCoJiInHiBgKiBeC_xHqqkZx_
 *			_xZkqqHx_iDgDiBfLiDiLjCiGiCmJjFjEjFgJiCmMjBkOjAkLiCpAiOmKiClFiOjNiCmBiCmEiCkCiCoJiPoKiNiHiCmNiBeBjFjEjFgJiCmJiNiHiCoNiClJiCmE_xHqqkZx_
 *			_xZkqqHx_iNfIjAfGiClHiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iDhGiDiNiDhAiDgFiDeCiCmFjFjEjFgJiCmMjBkOjAkLiCkKjFmPiNfIiClDiCoKiClNiOjOiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::OnSelectObjModified ()
{
//----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	ObjDynabaseVector::const_iterator iObj;
//	for (iObj = g_pView->SelectObjVector().begin();
//		 iObj != g_pView->SelectObjVector().end(); iObj++)
//	{
//		myCheckAndPickOffInfo(m_mpObjIdToMolipInfo, *iObj);
//	}
//----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	m_mpMolipIdToOffset.clear();
//----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnSelectObjModified();
} // FCToolLink::OnSelectObjModified.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::Select
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMiDgDiBfLiDiLiCkKjBeJjBpAiClDiCoKiClNiCmGiCkLiBeBiDfCiBfLiDiLiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.15 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::Select (CDC* pDC)
{
	// _xZkqqHx_iDiCiDiKiDhGiInKjDkOiDeJiDhEiDfKiDgCiDgHjFmPjAjEiCpAiPmBiLiOiBeC_xHqqkZx_DrawSelectMark_xZkqqHx_iCmJiJgFiLlPiCpA_xHqqkZx_
	// _xZkqqHx_jHfOiCkGiCoJiClNiCnPiBeB_xHqqkZx_BASE_CLASS::Select _xZkqqHx_iCmMjBePiCmJiOmAiNhDiBeC_xHqqkZx_
// 05.06.06 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	m_mpObjIdToMolipInfo.clear();
	m_mpMolipIdToOffset.clear();
	// _xZkqqHx_jBeJjBpAjCiGiDiKiDjDiDeOiPoOjFpBiCpAiPmBiLiOiBeC_xHqqkZx_DrawSelectMark_xZkqqHx_iCmJiJgFiLlPiCpA_xHqqkZx_
	// _xZkqqHx_jHfOiCkGiCoJiClNiCnPiBeB_xHqqkZx_BASE_CLASS::Unselect _xZkqqHx_iCmMiMoDiCmFiOmAiNhDiBeC_xHqqkZx_
	m_setSelLinkID.clear();

	// Superclass_xZkqqHx_iKnGjAjEiCpAiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::Select(pDC);

//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	//----- _xZkqqHx_iDiKiDjDiDeOiMjPiNpFiDhBiDgCiDgHiLeMjIfOjHhAjFmPjAjE_xHqqkZx_ -----
//	m_dwHitLinkID = DWORD(-1);	// _xZkqqHx_iDfOiBfLiDfBiDgCiDgHjCiGiCmMiDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
} // FCToolLink::Select.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::Unselect
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMiDgDiBfLiDiLiCkKjBeJjBpAiJpAiPjMiClDiCoKiClNiCmGiCkLiBeBiDfCiBfLiDiLiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::Unselect (CDC* pDC)
{
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	//
//	// _xZkqqHx_jFmPjAjEiPmBiLiOiPiIjHjNjDjJiCmNiBeBiClBiClBiCmFiNhDiCkEiBeC_xHqqkZx_
//	//
//	//----- _xZkqqHx_iDiKiDjDiDeOiMjPiNpFiDhBiDgCiDgHiLeMjIfOjHhAjFmPjAjE_xHqqkZx_ -----
//	m_dwHitLinkID = DWORD(-1);	// _xZkqqHx_iDfOiBfLiDfBiDgCiDgHjCiGiCmMiDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::Unselect(pDC);

	// _xZkqqHx_iDiCiDiKiDhGiInKjDkOiDeJiDhEiDfKiDgCiDgHjFmPjAjEiCpAiPmBiLiOiBeC_xHqqkZx_DrawSelectMark_xZkqqHx_iCmJiJgFiLlPiCpA_xHqqkZx_
	// _xZkqqHx_jHfOiCkGiCoJiClNiCnPiBeB_xHqqkZx_BASE_CLASS::Unselect _xZkqqHx_iCmMiMoDiCmFiOmAiNhDiBeC_xHqqkZx_
// 05.06.06 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	m_mpObjIdToMolipInfo.clear();
	m_mpMolipIdToOffset.clear();
	// _xZkqqHx_jBeJjBpAjCiGiDiKiDjDiDeOiPoOjFpBiCpAiPmBiLiOiBeC_xHqqkZx_DrawSelectMark_xZkqqHx_iCmJiJgFiLlPiCpA_xHqqkZx_
	// _xZkqqHx_jHfOiCkGiCoJiClNiCnPiBeB_xHqqkZx_BASE_CLASS::Unselect _xZkqqHx_iCmMiMoDiCmFiOmAiNhDiBeC_xHqqkZx_
	m_setSelLinkID.clear();
} // FCToolLink::Unselect.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::CanSelectTool
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMiDgDiBfLiDiLiCkKjBeJjBpAiJmCjEfMiCkJiCmHiCkEiCkJiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jBeJjBpAiJmCjEfMiCmMiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.12.23 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCToolLink::CanSelectTool () const
{
	// _xZkqqHx_jFlGiPjBiCkKiKeKiCkCiCmEiCkCiCmIiCkPiCoKiCmOiClBiCmMiDgDiBfLiDiLiCmMjBeJjBpAiCmNjFhDiJmCiBeC_xHqqkZx_
	// _xZkqqHx_iClNiClOiClFiBeB_xHqqkZx_ReadOnly_xZkqqHx_iCmFiCoAiDgDiBfLiDiLjBeJjBpAiCmNiJmCjEfMiBeC_xHqqkZx_
	if (!g_pDoc->GetIsDocumentOpened()) return FALSE;
	return TRUE;
} // FCToolLink::CanSelectTool.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::CanHandle
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNjFjEjFgJiCkKiClBiCmMiDgDiBfLiDiLiCmFiIlFiCkGiCoJiCkJiCmHiCkEiCkJiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pObj	:_xZkqqHx_jFjEjFgJiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iJmCjEfMiCmMiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeBjFhDiJmCjEfMiCmMiPoKiNiHiCmN_xHqqkZx_ FALSE _xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.14 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCToolLink::CanHandle (const FCObjDynabase* pObj) const
{
	// FCToolBaseEdit::CanHandle _xZkqqHx_iCmJiCkIiCkCiCmEiBeBjFnCiPfHiJmCjEfMiCmIiDiMiDeDiDiEiBfLiCmJjBkOiClFiCmE_xHqqkZx_
	// _xZkqqHx_iCkCiCmIiCkCiPoKiNiHiCmNjFhDiJmCiCmGiCmIiCoJiClNiCnPiBeBiClBiCmMiKnGjAjEiCpAiDeJiBfLiDgPiBfLiDiJiDeDiDgIiClHiCoJiBeC_xHqqkZx_

	// pObj _xZkqqHx_iCkKiBeBjBeJjBpAiJmCjEfMiCmIiDiMiDeDiDiEiBfLiCmJjBkOiClFiCmEiCkCiCoJiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
	if (g_pDoc->CanDoOnObject(pObj, FDOZ_ON_SELECT)) return TRUE;
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	return BASE_CLASS::CanHandle(pObj);
} // FCToolLink::CanHandle.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::DrawSelectMark
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMjFfMiOkGiOjOiCmMjBeJjBpAiDhNiBfLiDeOiCpAjFfMiOkGiBgJjEpBjFfMiOkGiBgKiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFfMiOkGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiBeC_xHqqkZx_
 *			pObj:_xZkqqHx_jFfMiOkGiClHiCoJjFjEjFgJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_jBeJjBpAiClDiCoKiClNjFjEjFgJiCmJiKnGiClHiCoJiDiKiDjDiDeOiPoOjFpBiCpAjDkPiOjOiCmJjFfMiOkGiClHiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iDiKiDjDiDeOiCpAiOkGiClHjGoOiIpDiCmNiBeBjAnNiMhGiDgNiBfLiDgH_xHqqkZx_P244_xZkqqHx_iCpAiOfBiPmGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.15 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::DrawSelectMark (CDC* pDC, FCObjDynabase* pObj)
{
	// _xZkqqHx_iPeDjAlDjApMjFgAiJoGjHhAiDeOiDiJiDfIiCpAiNoMjAkMiBeC_xHqqkZx_
	FCEditDraw eDraw(pDC, 0);

	//----- _xZkqqHx_jFjEjFgJiOgMiLpHiCmJjBeJjBpAiDhNiBfLiDeOiCpAjFgAiJoG_xHqqkZx_ -----
	// _xZkqqHx_iDiKiDfEiDeDiDfJiDhEiDiMiBfLiDiAiCpAiOoGjDlOiBeC_xHqqkZx_
	const CRect lgrt = mm2lg(pObj->GetResizeFrame());
	if (lgrt.left == lgrt.right && lgrt.top == lgrt.bottom)
	// _xZkqqHx_jBoFiCkLiClDiCkKjGlDiCkCiPoKiNiHiBeC_xHqqkZx_
	{
		eDraw.SmallMark(CPoint(lgrt.left, lgrt.top));
	} else
	if (lgrt.left == lgrt.right || lgrt.top == lgrt.bottom)
	// _xZkqqHx_jAiCjClMiBeFjAiFjFlNjApMiCmMiPoKiNiHiBeC_xHqqkZx_
	{
		eDraw.SmallMark(CPoint(lgrt.left, lgrt.top));
		eDraw.SmallMark(CPoint(lgrt.right, lgrt.bottom));
	} else
	// _xZkqqHx_iLoJiMgAiCmMiPoKiNiHiBeC_xHqqkZx_
	{
		eDraw.SmallMark(CPoint(lgrt.left, lgrt.top));
		eDraw.SmallMark(CPoint(lgrt.left, lgrt.bottom));
		eDraw.SmallMark(CPoint(lgrt.right, lgrt.top));
		eDraw.SmallMark(CPoint(lgrt.right, lgrt.bottom));
	}

	//----- _xZkqqHx_iDiCiDiKiDhGiImKjChFiCmJiLoJiMgAiCpAjFgAiJoG_xHqqkZx_ -----
	for (long lIdx = -1; lIdx < pObj->GetMolipCount(); lIdx++)
	{
		// _xZkqqHx_jFjEjFgJiCmMiDiCiDiKiDhGiNmAjFfHiCpAiOoGjDlOiBeC_xHqqkZx_
		DBLPoint mmpt;

// 05.06.07 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//		myGetMolipPos(mmpt, DWORD(this), pObj, lIdx);
		GetMyMolipPos(mmpt, pObj, lIdx);

		// _xZkqqHx_iDiCiDiKiDhGiNmAjFfHiCmJiLoJiMgAiCpAjFgAiJoGiBeC_xHqqkZx_
		eDraw.UnselMark(mm2lg(mmpt));
	}

	DBLRect mmrtClient;
	g_pView->GetClientRectMM(mmrtClient);
	DWORDSet stAffected;
	// _xZkqqHx_iOhHjCoIiClDiCoKiClNjFjEjFgJiCkJiCoHiJiEiCnBiCoJiDiKiDjDiDeOiCmMiPfHiNiHiCpAiOoGjDlOiBeC_xHqqkZx_
	g_pDoc->LinkManager()->GetAffectedByFrom(stAffected,
											 FCMolipRec(pObj->GetObjID(), -1));
	DWORDSet::iterator iLt;
	for (iLt = stAffected.begin(); iLt != stAffected.end(); iLt++)
	{
		// _xZkqqHx_iDiKiDjDiDeOjGoOiIpDjApMiCpAjFgAiJoGiBeC_xHqqkZx_
		DrawLinkLine(pDC, FALSE, &mmrtClient, *iLt);
		// _xZkqqHx_jBeJjBpAiNmPiCnNiDiKiDjDiDeOjApMiCmIiCoHiCmOiBeBjBeJjBpAiDiKiDjDiDeOjApMiCpAjFgAiJoGiBeC_xHqqkZx_
		if (IsSelectedXXX(XXX_LINK, *iLt)) DrawSelectLink(*iLt, pDC);
	}
} // FCToolLink::DrawSelectMark.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::OnAppendSelectObj
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNjFjEjFgJiCpAjBeJjBpAiPpDjBnEiCmJiClHiCoJiBeCiDgDiBfLiDiLiCkKjDmGiOkJiCmMiDgFiBfLiDhFiDiLiCmF_xHqqkZx_
 *			_xZkqqHx_jBeJjBpAjFjEjFgJiCpAiKmHjHjNiClFiCmEiCkCiCoJiPoKiNiHiCmNiBeBiClLiClBiCmJjFjEjFgJiCpAjCmHiJmBiClHiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iJoGjGmKjFfMiOkGiCpAjBeJjBpAiPpDjBnEiCmJjFmPiNfIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFfMiOkGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiBeCjFfMiOkGjFmPiNfIiClFiCmIiCkCiPoKiNiHiCmN_xHqqkZx_NULL_xZkqqHx_iBeC_xHqqkZx_
 *			pObj:_xZkqqHx_jBeJjBpAiClHiCoJjFjEjFgJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	CFCDynamicDrawView::AppendSelectObj_xZkqqHx_iCkJiCoHiCmMjAoKjHhAiKnGjAjEiBeC_xHqqkZx_
 *			CFCDynamicDrawView_xZkqqHx_iCmMjBeJjBpAiDgFiBfLiDhFiDiLiCmNjFmPiNfIiClFiCmIiCkCiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::OnAppendSelectObj (CDC* pDC, FCObjDynabase* pObj)
{
//----- 05.06.06 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	// _xZkqqHx_jBmOiPnLjFjEjFgJiCmFiCmNiCmIiCkCiPoKiNiHiCmNjFjMiLeBiBeC_xHqqkZx_
//	if (!CanHandle(pObj)) return;
//	// pObj _xZkqqHx_iCmJjHiNiCnOiDiCiDiKiDhGiInKjDkOiPoOjFpBiCpAiDgAiDeGiDgCiDeOiBjFiPeDjAlDiBeC_xHqqkZx_
//	myCheckAndPickOffInfo(m_mpObjIdToMolipInfo, pObj);
//----- 05.06.06 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	// Superclass_xZkqqHx_iKnGjAjEiCpAiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnAppendSelectObj(pDC, pObj);
} // FCToolLink::OnAppendSelectObj.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::OnRemoveSelectObj
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNjFjEjFgJiCpAjEpBjBeJjBpAiPpDjBnEiCmJiClHiCoJiBeCiDgDiBfLiDiLiCkKjDmGiOkJiCmMiDgFiBfLiDhFiDiLiCmF_xHqqkZx_
 *			_xZkqqHx_jBeJjBpAjFjEjFgJiCpAiKmHjHjNiClFiCmEiCkCiCoJiPoKiNiHiCmNiBeBiClLiClBiCkJiCoHjFjEjFgJiCpAiNoNiPjMiClHiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iJoGjGmKjFfMiOkGiCpAjEpBjBeJjBpAiPpDjBnEiCmJjFmPiNfIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFfMiOkGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiBeCjFfMiOkGjFmPiNfIiClFiCmIiCkCiPoKiNiHiCmN_xHqqkZx_NULL_xZkqqHx_iBeC_xHqqkZx_
 *			pObj:_xZkqqHx_jBeJjBpAiClHiCoJjFjEjFgJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	CFCDynamicDrawView::RemoveSelectObj_xZkqqHx_iCkJiCoHiCmMjAoKjHhAiKnGjAjEiBeC_xHqqkZx_
 *			CFCDynamicDrawView_xZkqqHx_iCmMjBeJjBpAiDgFiBfLiDhFiDiLiCmNjFmPiNfIiClFiCmIiCkCiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::OnRemoveSelectObj (CDC* pDC, FCObjDynabase* pObj)
{
//----- 01.08.20 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_jBmOiPnLjFjEjFgJiCmFiCmNiCmIiCkCiPoKiNiHiCmNjFjMiLeBiBeC_xHqqkZx_
	if (!CanHandle(pObj)) return;
//----- 01.08.20 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	// _xZkqqHx_iNoNiPjMiClDiCoKiClNjFjEjFgJiCpAiDiKiDjDiDeOiMlDiCmJiClHiCoJiDiKiDjDiDeOiCpAjBeJjBpAiCkJiCoHjGjFiPmBiClHiCoJiBeC_xHqqkZx_
	const DWORD dwObjID = pObj->GetObjID();
	DWORDSet::iterator iLs;
	for (iLs = m_setSelLinkID.begin(); iLs != m_setSelLinkID.end();)
	{
		// _xZkqqHx_iDiKiDjDiDeOiDiMiDfCiBfLiDgIiCpAiOoGjDlOiBeC_xHqqkZx_
		const FCLinkRec* linkRec = g_pDoc->LinkManager()->LinkIDtoLinkRec(*iLs);
		if (linkRec->m_mlpFrom.dwObjID == dwObjID)
		{
			// _xZkqqHx_jBeJjBpAiDiKiDjDiDeOjApMiCpAiPmBiLiOiBeC_xHqqkZx_
			if (pDC != NULL) DrawSelectLink(*iLs, pDC);
			// _xZkqqHx_jBeJjBpAiPfHiNiHiCkJiCoHiNoNiPjMiBeC_xHqqkZx_
			iLs = m_setSelLinkID.erase(iLs);
		} else
		{
			iLs++;
		}
	}
	// Superclass_xZkqqHx_iKnGjAjEiCpAiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnRemoveSelectObj(pDC, pObj);
} // FCToolLink::OnRemoveSelectObj.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::CanObjectProperties
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhGiDiNiDhAiDgFiDeCjFnCiPfHiJmCjEfMiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iJmCjEfMiCmMiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeBjFhDiJmCjEfMiCmMiPoKiNiHiCmN_xHqqkZx_ FALSE _xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.29 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCToolLink::CanObjectProperties () const
{
// 05.10.23 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
	if (!FFCanEditReadOnlyDocumentEnv()) return FALSE;
	return !m_setSelLinkID.empty();
} // FCToolLink::CanObjectProperties.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::OnObjectProperties
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iJeFiDhLiDfOiDjDiDeOiDiKiDgCiDeOiCmJiCoGiCmBiCmEjFfMiOkGiClDiCoKiCoJiDiBiDgKiDiFiBfLiCmMiDhGiDiNiDhAiDgFiDeC_xHqqkZx_
 *			_xZkqqHx_jBeJjBpAiCmFiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iCfAiCmCiImIiPoDjBeJjBpAiClDiCoKiClNjFjEjFgJiCkKiCkAiCoJiOjOiClOiCkPiMmEiCmOiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.29 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::OnObjectProperties ()
{
	CFCDlgLinkProperty dlg;
	dlg.SetLinkIdList(m_setSelLinkID);
	dlg.DoModal();
} // FCToolLink::OnObjectProperties.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::CanDelete
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iNoNiPjMiJmCjEfMiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iNoNiPjMiJmCjEfMiCmMiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeBjFhDiJmCjEfMiCmMiPoKiNiHiCmN_xHqqkZx_ FALSE _xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCToolLink::CanDelete () const
{
	// _xZkqqHx_iPpDjBnEiCkK_xHqqkZx_IDLE_xZkqqHx_jDjJiCmJiMmAjCoIiBeC_xHqqkZx_
	// _xZkqqHx_jAhNiMgAiCpAiDgIiDiJiDgCiDePiClFiCmEiInKjDkOjCiGiCmJ_xHqqkZx_BS_xZkqqHx_iDeMiBfLiCpAiJjPiClHiCmGiCkIiClPiCoJiClNiCnPiBeB_xHqqkZx_
	return (GetCurrentState() == STATE_IDLE ||
			GetCurrentState() == STATE_CONTEXT_MENU ||
			GetCurrentState() == STATE_CONTEXT_MENU_LINK) &&
			FFCanEditDocument() &&
			!m_setSelLinkID.empty();
} // FCToolLink::CanDelete.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::OnDelete
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iNoNiPjMiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::OnDelete (CDC* pDC)
{
//----- 02.08.18 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ (_xZkqqHx_jAhNiMgAiCpAiDgIiDiJiDgCiDePiClFiCmEiInKjDkOjCiGiCmJ_xHqqkZx_BS_xZkqqHx_iDeMiBfLiCpAiJjPiClHiCmGiCkIiClPiCoJ_xHqqkZx_)-----
	// Delete_xZkqqHx_iDeMiBfLiCpA_xHqqkZx_IDLE_xZkqqHx_iImIiKePiCmFiLnGiOhOiClHiCoJiBeCiClBiCoKiCpAiClFiCmIiCkCiCmG_xHqqkZx_
	// _xZkqqHx_jAhNiMgAiCpAiDgIiDiJiDgCiDePiClFiCmEiInKjDkOjCiGiCmJ_xHqqkZx_BS_xZkqqHx_iDeMiBfLiCpAiJjPiClHiCmGiCkIiClPiCoJiBeC_xHqqkZx_
// 05.09.10 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	if (GetCurrentState() != STATE_IDLE || m_setSelLinkID.empty()) return;
	if (!CanDelete()) return;
//----- 02.08.18 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ (_xZkqqHx_jAhNiMgAiCpAiDgIiDiJiDgCiDePiClFiCmEiInKjDkOjCiGiCmJ_xHqqkZx_BS_xZkqqHx_iDeMiBfLiCpAiJjPiClHiCmGiCkIiClPiCoJ_xHqqkZx_)-----
	// _xZkqqHx_iNmEjFgAiJoGiCkKjFeLjHhGiCmIjFjEjFgJiBeC_xHqqkZx_
	ObjDynabaseSet stRedrawObj;

	// _xZkqqHx_iDfCiDhNiDjDiDgIiDfKiDgCiDfGiDiHiDjDiKeKiOgOiBeC_xHqqkZx_
	g_pDoc->SessionBegin();
	DWORDSet::const_iterator iLs;
	// _xZkqqHx_jBeJjBpAjCiGiCmMiDiKiDjDiDeOjApMiCpAjBfDiCmEiPmBiLiOiBeC_xHqqkZx_
	for (iLs = m_setSelLinkID.begin(); iLs != m_setSelLinkID.end(); iLs++)
	{
		// _xZkqqHx_jBeJjBpAiDiKiDjDiDeOjApMiCpAiPmBiLiOiBeC_xHqqkZx_
		DrawSelectLink(*iLs, pDC);
		// _xZkqqHx_iDiKiDjDiDeOjGoOiIpDjApMiCpAiPmBiLiOiBeC_xHqqkZx_
		DrawLinkLine(pDC, FALSE, NULL, *iLs);
		// _xZkqqHx_iDiKiDjDiDeOiNoNiPjMiDfCiDhNiDjDiDgIiCpAjEkNiNhDiBeC_xHqqkZx_
		g_pDoc->CmdDelete1Link(stRedrawObj, *iLs);
	}
	// _xZkqqHx_jBeJjBpAiPfHiNiHiCpAiPmBiLiOiBeC_xHqqkZx_
	m_setSelLinkID.clear();
	// _xZkqqHx_iDfCiDhNiDjDiDgIiDfKiDgCiDfGiDiHiDjDiPeJjHlJiBeC_xHqqkZx_
	g_pDoc->SessionEnd();

	if (!stRedrawObj.empty())
	//----- _xZkqqHx_iNmEjFgAiJoGjFjEjFgJiCkKiCkAiCoJiPoKiNiH_xHqqkZx_ -----
	{
		g_pView->AppendToLastRgn(stRedrawObj);
		g_pView->SendRgnRedraw();
	}
} // FCToolLink::OnDelete.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::CanExchangeHeadTail
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiBiDgKiDiFiBfLiBhFiOgOjDfPiCmGiPeJjDfPiCmMjBkOjAkLiCpAiMpAiKlHiBhGiCmMjHeMiMpIiBeFjGlDiMpIiCpAiMiIjCoIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCToolLink::CanExchangeHeadTail () const
{
	if (!FFCanEditDocument()) return FALSE;
	if (GetSelectedXXX(XXX_LINK) == 0) return FALSE;
	return TRUE;
} // FCToolLink::CanExchangeHeadTail.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::OnExchangeHeadTail
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDhNiDjDiDgIiBhFiOgOjDfPiCmGiPeJjDfPiCmMjBkOjAkLiCpAiMpAiKlHiBhGiCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.26 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::OnExchangeHeadTail ()
{
	// _xZkqqHx_jBeJjBpAjCiGiDiKiDjDiDeOiCmMiIoKjHjHiCpAiOoGjDlOiBeC_xHqqkZx_
	DWORDSet stLinkSelected;
	GetSelectedXXX(XXX_LINK, NULL, &stLinkSelected);
	// _xZkqqHx_iLeMjIfOiDfKiDgCiDfGiDiHiDjDiKeKiOgOiKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	g_pDoc->SessionBegin();
	DWORDSet::const_iterator iLs;
	for (iLs = stLinkSelected.begin(); iLs != stLinkSelected.end(); iLs++)
	{
		FCLinkRec linkRec = *g_pDoc->LinkManager()->LinkIDtoLinkRec(*iLs);
		ObjDynabaseSet stRedrawObj;
		g_pDoc->CmdModify1LinkMolip(stRedrawObj,
									*iLs,
									linkRec.m_mlpTo,
									linkRec.m_mlpFrom);
		// _xZkqqHx_iDiCiDiKiDhGiKnEiCmMiDeJiDhEiDfKiDgCiDgHjCgMiCpAiMhGiOfKiBeC_xHqqkZx_
		linkRec = *g_pDoc->LinkManager()->LinkIDtoLinkRec(*iLs);
		linkRec.ApplyNewOffset();
		// _xZkqqHx_iDiKiDjDiDeOiMlDiCkJiCoHiDiKiDjDiDeOjAoGiCnGiCmMiDeJiDhEiDfKiDgCiDgHiBeC_xHqqkZx_
		g_pDoc->CmdModify1LinkOffset(	*iLs,
										linkRec.m_mmptOffset);
		//----- _xZkqqHx_iNmEjFgAiJoGjFjEjFgJiCkKiCkAiCoJiPoKiNiH_xHqqkZx_ -----
		if (!stRedrawObj.empty())
			g_pView->AppendToLastRgn(stRedrawObj);
		// _xZkqqHx_iDiKiDjDiDeOiCmMiLmIjApMiCpAiNmEjFgAiJoGjHmMiIoGiCmJjCmHiJmBiBeCjGoOiIpDiCmMjDkKjFjEjFkKiCoAiKnMiCnPiCmEjBoFiCkLiCnPiCmJiKgHjCkDiClHiCoJiBeC_xHqqkZx_
		g_pView->AppendToLastRgn(GetFrameRectXXX(XXX_LINK, *iLs).ExtendRect(lg2mm(50)));
	}
	// _xZkqqHx_iLeMjIfOiDfKiDgCiDfGiDiHiDjDiCmMiPeJjHlJiBeC_xHqqkZx_
	g_pDoc->SessionEnd();
	// _xZkqqHx_jFnCiPfHiDgOiDjDiDgIiDiLiDiKiDfIiDgHiCpAiNmEjAnNjCoIiBeCiDiKiDjDiDeOjApMiCmNjFmPiNfIiClDiCoKiCmEiCkCiCoJiCmMiCmFiBeB_xHqqkZx_
	// _xZkqqHx_jHmMiIoGiCmMiNmEjDgPjIfOiCkKjFeLjHhGiBeCiClBiCoKiCpAiMmEiCmOiCmIiCkCiCmGiBeBiOjPiCmMiDeOiDiKiDgCiDeOiCmF_xHqqkZx_
	// _xZkqqHx_iDiKiDjDiDeOjApMiCkKiDhBiDgCiDgHiClFiCmIiCkNiCmIiCoJiBeC_xHqqkZx_
	ResetEditHandleList();
	// _xZkqqHx_iNmEjFgAiJoGiBeC_xHqqkZx_
	g_pView->SendRgnRedraw();
} // FCToolLink::OnExchangeHeadTail.

//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::GetSelObjLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jBeJjBpAjCiGiCmMjFjEjFgJiCkJiCoHiJiEiCnBiCoJjBfDiCmEiCmMiDiKiDjDiDeOiCmMiPfHiNiHiCpAjFnEiClHiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	setLink	:_xZkqqHx_iDiKiDjDiDeOiPfHiNiHiCpAjFnEiClHiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *			99.05.24 Fukushiro M. set_xZkqqHx_iPfHiNiHiCmJjFmPiNfIiBeC_xHqqkZx_
// *************************************************************************/
//void FCToolLink::GetSelObjLink (DWORDSet& setLink) const
//{
//	ObjDynabaseVector::const_reverse_iterator rObj;
//	for (rObj = g_pView->SelectObjVector().rbegin();
//		 rObj != g_pView->SelectObjVector().rend(); rObj++)
//	{
//		// _xZkqqHx_iOhHjCoIiClDiCoKiClNjFjEjFgJiCkJiCoHiJiEiCnBiCoJiDiKiDjDiDeOiCmMiPfHiNiHiCpAiOoGjDlOiBeC_xHqqkZx_
//		g_pDoc->LinkManager()->GetAffectedByFrom(setLink,
//									 FCMolipRec((*rObj)->GetObjID(), -1));
//	}
//} // FCToolLink::GetSelObjLink.
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::Calc3Joint
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOiMlDiBeFiDiKiDjDiDeOjAoGiDiCiDiKiDhGiCkJiCoHiBeBiClBiCoKiCpAiCmCiCmIiCkOiDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiClHiCoJ_xHqqkZx_
 *			_xZkqqHx_iClNiCnPiCmMiCfCiCmCiCmMjIeBiMiLjDfPiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	jointArray	:_xZkqqHx_iCfCiCmCiCmMjIeBiMiLjDfPiCpAjFnEiClHiBeC_xHqqkZx_
 *			mlpFrom		:_xZkqqHx_iDiKiDjDiDeOjApMiCmMiDiKiDjDiDeOiMlDiDiCiDiKiDhGiBeC_xHqqkZx_
 *			mlpTo		:_xZkqqHx_iDiKiDjDiDeOjApMiCmMiDiKiDjDiDeOjAoGiDiCiDiKiDhGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	jointArray_xZkqqHx_iCmNiBeBiDiKiDjDiDeOjAoGiDiCiDiKiDhG_xHqqkZx_ -> _xZkqqHx_iDiKiDjDiDeOiMlDiDiCiDiKiDhGiCmMiPiHiCmJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *			01.04.12 Fukushiro M. jointArray_xZkqqHx_iCmMiPiHjEnEiCpAjDpMjBnGiCkGiBeCjGoOiIpDiCmMiClNiCnPiBeC_xHqqkZx_
 *************************************************************************/
void FCToolLink::Calc3Joint (FCPolyJoint jointArray[], DWORD dwLinkID) const
{
	// _xZkqqHx_iDiKiDjDiDeOiDiMiDfCiBfLiDgIiCpAiOoGjDlOiBeC_xHqqkZx_
	const FCLinkRec* linkRec = g_pDoc->LinkManager()->LinkIDtoLinkRec(dwLinkID);
	DBLPoint mmptFrom;
	DBLPoint mmptTo;
	// _xZkqqHx_iDiKiDjDiDeOiMlDjFjEjFgJiCpAiOoGjDlOiBeC_xHqqkZx_
	FCObjDynabase* pObjFrom = g_pDoc->ObjID2Object(linkRec->m_mlpFrom.dwObjID);
	// _xZkqqHx_iDiKiDjDiDeOiMlDiDiCiDiKiDhGiNmAjFfHiCpAiOoGjDlOiBeC_xHqqkZx_
// 05.06.07 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	myGetMolipPos(mmptFrom, DWORD(this), pObjFrom, linkRec->m_mlpFrom.lMolipId);
	GetMyMolipPos(mmptFrom, pObjFrom, linkRec->m_mlpFrom.lMolipId);

	// _xZkqqHx_iDiKiDjDiDeOjAoGjFjEjFgJiCpAiOoGjDlOiBeC_xHqqkZx_
	FCObjDynabase* pObjTo = g_pDoc->ObjID2Object(linkRec->m_mlpTo.dwObjID);
	// _xZkqqHx_iDiKiDjDiDeOjAoGiDiCiDiKiDhGiNmAjFfHiCpAiOoGjDlOiBeC_xHqqkZx_
// 05.06.07 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	myGetMolipPos(mmptTo, DWORD(this), pObjTo, linkRec->m_mlpTo.lMolipId);
	GetMyMolipPos(mmptTo, pObjTo, linkRec->m_mlpTo.lMolipId);

	// _xZkqqHx_iDiKiDjDiDeOiMlDiDiCiDiKiDhGjDfPiCmGiDiKiDjDiDeOjAoGiDiCiDiKiDhGjDfPiCmMjCiGiKnEjDfPiCpAiMhGiOfKiBeC_xHqqkZx_
	const DBLPoint mmptMid = (mmptFrom + mmptTo) / 2.0;
	// _xZkqqHx_iDiKiDjDiDeOiMlDiDiCiDiKiDhGjDfPiCmGiDiKiDjDiDeOjAoGiDiCiDiKiDhGjDfPiCpAiMiLiCnEjApMjFkKiCpAiMhGiOfKiBeC_xHqqkZx_
	DBLPoint mmptLine;
// 01.01.03 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	if (mmptTo == mmptFrom)
	if (almosteq(mmptTo, mmptFrom))
	{
		if (linkRec->m_mlpFrom < linkRec->m_mlpTo)
			mmptLine.SetPoint(1, 0);
		else
			mmptLine.SetPoint(-1, 0);
	} else
	{
		mmptLine = mmptTo - mmptFrom;
	}

	const double mmLine = mmptLine.Len();
	// _xZkqqHx_jBoGiCfBjDfPiCmGiBeBjBoGiCfAjDfPiBeFjBoGiCfCjDfPiCpAiMiLiCnEjClMjApMiCkJiCoHiCmMiLjHjHkDiCpAiMhGiOfKiBeC_xHqqkZx_
	double mmW = lg2mm(30);
	if (mmW < mmLine / 10) mmW = mmLine / 10;
	// _xZkqqHx_jBoGiCfBjDfPiCmMiIpIjDfPiCmMiImKjChFiCpAiMhGiOfKiBeC_xHqqkZx_
	DBLPoint mmptPull;
	if (lg2mm(30) < mmLine / 3)
		mmptPull = mmptLine / 3;
	else
		mmptPull = mmptLine * lg2mm(30) / mmLine;

	jointArray[1].m_mmptPivot.x = mmptMid.x - mmptLine.y * mmW / mmLine;
	jointArray[1].m_mmptPivot.y = mmptMid.y + mmptLine.x * mmW / mmLine;
	jointArray[1].m_mmptPrev = mmptPull;
	jointArray[1].m_mmptNext = -mmptPull;
	jointArray[2] = FCPolyJoint(FDJT_NONE, mmptFrom, DBLPoint(0,0), DBLPoint(0,0));
	jointArray[0] = FCPolyJoint(FDJT_NONE, mmptTo, DBLPoint(0,0), DBLPoint(0,0));
} // FCToolLink::Calc3Joint.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::DrawLinkLine
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDiKiDjDiDeOjApMiCpAjFgAiJoGiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC			:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiBeC_xHqqkZx_
 *			bIsBold		:_xZkqqHx_iDiKiDjDiDeOjApMiCkKiLkNjClCiCmIiCoHiCmO_xHqqkZx_ TRUE _xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			mmrtpClip	:_xZkqqHx_iDeOiDiKiDgCiDhGiLoJiMgAiBeCjGlDiCkCiPoKiNiHiCmN_xHqqkZx_NULL_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			mlpFrom		:_xZkqqHx_iDiKiDjDiDeOjApMiCmMiDiKiDjDiDeOiMlDiDiCiDiKiDhGiBeC_xHqqkZx_
 *			mlpTo		:_xZkqqHx_iDiKiDjDiDeOjApMiCmMiDiKiDjDiDeOjAoGiDiCiDiKiDhGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *			01.04.12 Fukushiro M. _xZkqqHx_jFmPiNfI_xHqqkZx_
 *************************************************************************/
void FCToolLink::DrawLinkLine (CDC* pDC, BOOL bIsBold, const DBLRect* mmrtpClip,
								DWORD dwLinkID) const
{
	//
	// _xZkqqHx_jGoOiIpDjFgAiJoGiCmNiBeBjAhNiMgAjFgAiJoGiCmGiIoBiCkCiMlFjGkHiCmFiCkAiCoJjFeLjHhGiCmNjGlDiCkCiBeC_xHqqkZx_
	// _xZkqqHx_iClBiCmMiClNiCnPiBeBiMhGiOfKjAlIjDhIiCmMjGnKiImA_xHqqkZx_ g_->lgdPrecision _xZkqqHx_iCpAiCfCjEhLiCmJiClFiCmEiBeB_xHqqkZx_
	// _xZkqqHx_jAlIjDhIiCpAjHiOiCmGiClFjBkMjDhIiCpAiPoDiClAiCoJiBeC_xHqqkZx_
	//
	DBLPointVector vlgdptPoly;
	FCPolyJoint jnt[3];
	// _xZkqqHx_iKeKiOgOjDfPiBeFiPeJjHlJjDfPiNmAjFfHiCkJiCoHjGoOiIpDjApMiCmMiDhIiDfHiDeHiLmIjApMjHhAiCmMjIeBiMiLjDfPjEhKjHpBiCpAiOoGjDlOiBeC_xHqqkZx_
	Calc3Joint(jnt, dwLinkID);
	// _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiBeC_xHqqkZx_
	if (mmrtpClip != NULL)
		::CalcBezier2(vlgdptPoly, jnt, 3, 1.0,
					0, 2, 3 * g_->lgdPrecision, g_->dZoom, &mm2lg(*mmrtpClip), 1);
	else
		::CalcBezier2(vlgdptPoly, jnt, 3, 1.0,
					0, 2, 3 * g_->lgdPrecision, g_->dZoom, (CRect*)NULL, 0);
	//
	// _xZkqqHx_iDfJiBfLiDiA_xHqqkZx_ = 1.0 _xZkqqHx_iCmGiClFiCmEiBeBiCmHiCmMiDfJiBfLiDiAiCmFiCoAjGoOiIpDiCmMjBoFiCkLiClDiCkKiIoKjCoIiCmJjFgAiJoGiClDiCoKiCoJ_xHqqkZx_
	// _xZkqqHx_iCoGiCkEiCmJiClHiCoJiBeCiClBiCmMiClNiCnPiBeBjGoOiIpDiCmMiOlCjApM_xHqqkZx_ vlgdptPoly _xZkqqHx_iCmNiBeBjIfPjHjNiNmAjFfHiCmFiMhGiOfKiBeC_xHqqkZx_
	//
	double dZoom = g_->dZoom;
	g_->dZoom = 1.0;
	// _xZkqqHx_iPeDjAlDjApMjFgAiJoGjHhAiDeOiDiJiDfIiCpAiNoMjAkMiBeC_xHqqkZx_
	FCEditDraw eDraw(pDC, FTEditPenType(bIsBold ? FDPN_BOLD : FDPN_TIMID));
	FCStdArrow arrow(FCUGArrowParams(FDUG_ARW_TYPE_TYPICAL,
								FDUG_ARW_STYL_ARROW_C1, 10, 0), FALSE);
	// _xZkqqHx_iPoNiCmJjDkPiClGjIfPjHjNjFjNiCmJiCmIiCoJiCoGiCkEiCmJiBeC_xHqqkZx_
	arrow.InitByPoly(vlgdptPoly, 1.0, 3 * g_->lgdPrecision,
					FD_PEN_STYLE_SOLID, 0.0, FD_S_COLOR_BLACK,
					FD_PATTERN_UNUSE, FD_S_COLOR_TRANSPARENT, FD_S_COLOR_BLACK,
					FD_S_COLOR_TRANSPARENT);
	arrow.FillArrow(eDraw, 3 * g_->lgdPrecision);
	CPointVector vlgptPoly;
	mm2lg(vlgptPoly, vlgdptPoly);
	// _xZkqqHx_jGoOiIpDiCmMjApMjFjEjFkKiCpAjFgAiJoGiBeC_xHqqkZx_
	eDraw.Polyline(vlgptPoly.begin(), vlgptPoly.size());
	g_->dZoom = dZoom;
} // FCToolLink::DrawLinkLine.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::DrawSelectLink
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDiKiDjDiDeOiCmJiBeBjBeJjBpAjCiGiCmMjBlOjApMiCpAjFgAiJoGiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwLinkID	:_xZkqqHx_jFgAiJoGiClHiCoJiDiKiDjDiDeOiBeC_xHqqkZx_
 *			pDC			:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::DrawSelectLink (DWORD dwLinkID, CDC* pDC) const
{
	// _xZkqqHx_iDiKiDjDiDeOjGoOiIpDjApMiCpAiPmBiLiOiBeC_xHqqkZx_
	DrawLinkLine(pDC, FALSE, NULL, dwLinkID);
	// _xZkqqHx_iDiKiDjDiDeOjGoOiIpDjApMiCpAjFgAiJoGiBeC_xHqqkZx_
	DrawLinkLine(pDC, TRUE, NULL, dwLinkID);
} // FCToolLink::DrawSelectLink.

//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::IsSelectLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOiCkKjBeJjBpAiNmPiCnNiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwLinkID	:_xZkqqHx_jClCiCnHiCoJiDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jBeJjBpAiNmPiCnNiCmIiCoHiCmO_xHqqkZx_ TRUE_xZkqqHx_iBeBiClLiCoKiImIiKePiCmN_xHqqkZx_ FALSE _xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//BOOL FCToolLink::IsSelectLink (DWORD dwLinkID) const
//{
//	return (m_setSelLinkID.find(dwLinkID) != m_setSelLinkID.end());
//} // FCToolLink::IsSelectLink.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::AppendSelectLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDiKiDjDiDeOiCpAjBeJjBpAiNmPiCnNiCmJiClFiCmEiBeBjBeJjBpAiDiKiDjDiDeOjApMiCpAjFgAiJoGiClHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwLinkID	:_xZkqqHx_jBeJjBpAiClHiCoJiDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
// *			pDC			:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLink::AppendSelectLink (DWORD dwLinkID, CDC* pDC)
//{
//	// _xZkqqHx_jBeJjBpAiPfHiNiHiCmJjCmHiJmBiBeC_xHqqkZx_
//	m_setSelLinkID.insert(dwLinkID);
//	// _xZkqqHx_jBeJjBpAiDiKiDjDiDeOjApMiCpAjFgAiJoGiBeC_xHqqkZx_
//	DrawSelectLink(dwLinkID, pDC);
//} // FCToolLink::AppendSelectLink.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::RemoveSelectLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDiKiDjDiDeOiCpAjBeJjBpAiJpAiPjMiCmJiClFiCmEiBeBjBeJjBpAiDiKiDjDiDeOjApMiCpAiPmBiLiOiClHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwLinkID	:_xZkqqHx_jBeJjBpAiClHiCoJiDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
// *			pDC			:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLink::RemoveSelectLink (DWORD dwLinkID, CDC* pDC)
//{
//	// _xZkqqHx_jBeJjBpAiPfHiNiHiCkJiCoHiNoNiPjMiBeC_xHqqkZx_
//	m_setSelLinkID.erase(dwLinkID);
//	// _xZkqqHx_jBeJjBpAiDiKiDjDiDeOjApMiCpAiPmBiLiOiBeC_xHqqkZx_
//	DrawSelectLink(dwLinkID, pDC);
//} // FCToolLink::RemoveSelectLink.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::ClearSelectLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jBeJjBpAjCiGiCmMjBfDiDiKiDjDiDeOiCpAjBeJjBpAiJpAiPjMiClFiCmEiBeBjBeJjBpAiDiKiDjDiDeOjApMiCpAiPmBiLiOiClHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.05.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLink::ClearSelectLink (CDC* pDC)
//{
//	DWORDSet::const_iterator iLs;
//	// _xZkqqHx_jBeJjBpAiDiKiDjDiDeOjApMiCpAjBfDiCmEiPmBiLiOiBeC_xHqqkZx_
//	for (iLs = m_setSelLinkID.begin(); iLs != m_setSelLinkID.end(); iLs++)
//		DrawSelectLink(*iLs, pDC);
//	// _xZkqqHx_jBeJjBpAiPfHiNiHiCpAiPmBiLiOiBeC_xHqqkZx_
//	m_setSelLinkID.clear();
//} // FCToolLink::ClearSelectLink.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::IsLinkInRect
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiDiKiDjDiDeOiCkKiOhHjCoIiClDiCoKiClNiDhEiDiMiBfLiDiAjDoAiCmJiCkAiCoJiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	dwLinkID	:_xZkqqHx_iDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiClHiCoJiBeC_xHqqkZx_
// *			lgrtFrame	:_xZkqqHx_iDhEiDiMiBfLiDiAiCpAiOhHjCoIiClHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDhEiDiMiBfLiDiAjDoAiCmJiCkAiCoJiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeBjGlDiCkCiPoKiNiHiCmN_xHqqkZx_ FALSE _xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//BOOL FCToolLink::IsLinkInRect (DWORD dwLinkID, const CRect& lgrtFrame) const
//{
//	//
//	// _xZkqqHx_jGoOiIpDjFgAiJoGiCmNiBeBjAhNiMgAjFgAiJoGiCmGiIoBiCkCiMlFjGkHiCmFiCkAiCoJjFeLjHhGiCmNjGlDiCkCiBeC_xHqqkZx_
//	// _xZkqqHx_iClBiCmMiClNiCnPiBeBiMhGiOfKjAlIjDhIiCmMjGnKiImA_xHqqkZx_ g_->lgdPrecision _xZkqqHx_iCpAiCfCjEhLiCmJiClFiCmEiBeB_xHqqkZx_
//	// _xZkqqHx_jAlIjDhIiCpAjHiOiCmGiClFjBkMjDhIiCpAiPoDiClAiCoJiBeC_xHqqkZx_
//	//
//	CPointVector vlgptPoly;
//	FCPolyJoint jnt[3];
//	// _xZkqqHx_iKeKiOgOjDfPiBeFiPeJjHlJjDfPiNmAjFfHiCkJiCoHjGoOiIpDjApMiCmMiDhIiDfHiDeHiLmIjApMjHhAiCmMjIeBiMiLjDfPjEhKjHpBiCpAiOoGjDlOiBeC_xHqqkZx_
//	Calc3Joint(jnt, dwLinkID);
//	// _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCmMjIeBiMiLjDfPiCmMiCkCiClIiCoKiCkJiCkKiDhEiDiMiBfLiDiAiKePiCmJiCkAiCoJiPoKiNiHiCmN_xHqqkZx_ FALSE_xZkqqHx_iBeC_xHqqkZx_
//	if (!lgrtFrame.PtInRect(mm2lg(jnt[0].m_mmptPivot)) ||
//		!lgrtFrame.PtInRect(mm2lg(jnt[1].m_mmptPivot)) ||
//		!lgrtFrame.PtInRect(mm2lg(jnt[2].m_mmptPivot))) return FALSE;
//	// _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiBeC_xHqqkZx_
//	::CalcBezier2(vlgptPoly, jnt, 3, 1,
//				0, 2, 3 * g_->lgdPrecision, g_->dZoom, (CRect*)NULL, 0);
//	// _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCmJiKePjAnKiClHiCoJiDhEiDiMiBfLiDiAiCpAiMhGiOfKiBeC_xHqqkZx_
//	CRect lgrtOut;
//	::FFCalcFrame(lgrtOut, vlgptPoly.size(), vlgptPoly.begin());
//	// _xZkqqHx_iKePjAnKiDhEiDiMiBfLiDiAiCmMiCfDjDfPiCkKiMjPiNlIiDhEiDiMiBfLiDiAiCmMjDoAiCmJiCkAiCoJiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
//	return (lgrtFrame.PtInRect(CPoint(lgrtOut.left, lgrtOut.top)) &&
//			lgrtFrame.PtInRect(CPoint(lgrtOut.right, lgrtOut.top)) &&
//			lgrtFrame.PtInRect(CPoint(lgrtOut.right, lgrtOut.bottom)) &&
//			lgrtFrame.PtInRect(CPoint(lgrtOut.left, lgrtOut.bottom)));
//} // FCToolLink::IsLinkInRect.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::CheckHitLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOjApMiPoDiCmJiDhNiDeFiDfIiCkKiDhBiDgCiDgHiClFiCmEiCkCiCoJiCkJjClCiCnHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDhBiDgCiDgHiClFiCmEiCkCiCoJiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeBiClFiCmEiCkCiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ FALSE _xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iDiBiDjDiDgPjFmPjAjE_xHqqkZx_ m_dwHitLinkID _xZkqqHx_iCmJiMjPiNpFiMiLiJmKiCpAjFnEiClHiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//BOOL FCToolLink::CheckHitLink ()
//{
////----- 02.07.21 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ (A3_xZkqqHx_iJkBjClH_xHqqkZx_,_xZkqqHx_jHfNjEjC_xHqqkZx_0_xZkqqHx_iCmJjAnNjCoIiClFiBeBjHhAiOiGiCkCiCmBiCmPiCkCiCmJjBoFiCkLiCkCiOgMiKhAiCmFjFfMiOkGiCkKjHjAiCoKiCoJ_xHqqkZx_)-----
////	//----- _xZkqqHx_iDiKiDjDiDeOiMjPiNpFiDhBiDgCiDgHiLeMjIfOjHhAjFmPjAjEiCpAiPiJiKpKiJlL_xHqqkZx_ -----
////	m_dwHitLinkID = DWORD(-1);		// _xZkqqHx_iDfOiBfLiDfBiDgCiDgHjCiGiCmMiDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
////	const CPoint& lgptMsc = mm2lg(m_mmptMsc);
////	// _xZkqqHx_jBeJjBpAjCiGjFjEjFgJiCkJiCoHiJiEiCnBiCoJiDiKiDjDiDeOiCmMiIoKjHjHiCpAiOoGjDlOiBeC_xHqqkZx_
////	DWORDSet setLink;
////	GetSelObjLink(setLink);
////	// _xZkqqHx_iDiKiDjDiDeOjApMiCmMiCfAiCmCiClIiCmCiCpAiDiLiBfLiDhGiBeC_xHqqkZx_
////	DWORDSet::const_iterator iLs;
////	for (iLs = setLink.begin(); iLs != setLink.end(); iLs++)
////	{
////		FCPolyJoint jnt[3];
////		// _xZkqqHx_iKeKiOgOjDfPiBeFiPeJjHlJjDfPiNmAjFfHiCkJiCoHjGoOiIpDjApMiCmMiDhIiDfHiDeHiLmIjApMjHhAiCmMjIeBiMiLjDfPjEhKjHpBiCpAiOoGjDlOiBeC_xHqqkZx_
////		Calc3Joint(jnt, *iLs);
////		//----- _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiClHiCoJjBePiCmJiBeBjIeBiMiLjDfPiCmMjBePjElMiBeFiMoDjElMiCmJiKePjAnK_xHqqkZx_
////		//		_xZkqqHx_iClHiCoJiDhEiDiMiBfLiDiAiCpAiMhGiOfKiClFiBeBiClLiCmMiDhEiDiMiBfLiDiAiCmFiDhBiDgCiDgHiCpAjClCiCnHiCoJ_xHqqkZx_ -----
////		//----- _xZkqqHx_jBePjElMiLoJiMgAiCpAiMhGiOfK_xHqqkZx_ -----
////		DBLRect mmrtPrev(jnt[0].m_mmptPivot, jnt[1].m_mmptPivot);
////		mmrtPrev.NormalizeRect();
////		SmallerOrLarger(mmrtPrev.left, mmrtPrev.right,
////						jnt[1].m_mmptPivot.x + jnt[1].m_mmptPrev.x);
////		SmallerOrLarger(mmrtPrev.top, mmrtPrev.bottom,
////						jnt[1].m_mmptPivot.y + jnt[1].m_mmptPrev.y);
////		CRect lgrtPrev = mm2lg(mmrtPrev);
////		lgrtPrev.InflateRect(5, 5);
////		//----- _xZkqqHx_iMoDjElMiLoJiMgAiCpAiMhGiOfK_xHqqkZx_ -----
////		DBLRect mmrtNext(jnt[1].m_mmptPivot, jnt[2].m_mmptPivot);
////		mmrtNext.NormalizeRect();
////		SmallerOrLarger(mmrtNext.left, mmrtNext.right,
////						jnt[1].m_mmptPivot.x + jnt[1].m_mmptNext.x);
////		SmallerOrLarger(mmrtNext.top, mmrtNext.bottom,
////						jnt[1].m_mmptPivot.y + jnt[1].m_mmptNext.y);
////		CRect lgrtNext = mm2lg(mmrtNext);
////		lgrtNext.InflateRect(5, 5);
////		// _xZkqqHx_iCmHiClPiCoHiCmMiLoJiMgAiCmJiCoAiDhBiDgCiDgHiClFiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ _xZkqqHx_iOjPiCnGiBeC_xHqqkZx_
////		if (!lgrtPrev.PtInRect(lgptMsc) && !lgrtNext.PtInRect(lgptMsc)) continue;
////		//
////		// _xZkqqHx_jGoOiIpDjFgAiJoGiCmNiBeBjAhNiMgAjFgAiJoGiCmGiIoBiCkCiMlFjGkHiCmFiCkAiCoJjFeLjHhGiCmNjGlDiCkCiBeC_xHqqkZx_
////		// _xZkqqHx_iClBiCmMiClNiCnPiBeBiMhGiOfKjAlIjDhIiCmMjGnKiImA_xHqqkZx_ g_->lgdPrecision _xZkqqHx_iCpAiCfCjEhLiCmJiClFiCmEiBeB_xHqqkZx_
////		// _xZkqqHx_jAlIjDhIiCpAjHiOiCmGiClFjBkMjDhIiCpAiPoDiClAiCoJiBeC_xHqqkZx_
////		//
////		//----- _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiClFiBeBjApMiPoDiCmMiDhBiDgCiDgHiCpAjClCiCnHiCoJ_xHqqkZx_ -----
////		CPointVector vlgptPoly;
////		// _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiBeC_xHqqkZx_
////		::CalcBezier2(vlgptPoly, jnt, 3, 1,
////					0, 2, 3 * g_->lgdPrecision, g_->dZoom, (CRect*)NULL, 0);
////		if (::PolyIntersect(lgptMsc, vlgptPoly.begin(), vlgptPoly.size(), 5) != 0)
////		{
////			m_dwHitLinkID = *iLs;	// _xZkqqHx_iDfOiBfLiDfBiDgCiDgHjCiGiCmMiDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
////			return TRUE;
////		}
////	}
////	return FALSE;
////----- 02.07.21 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ (A3_xZkqqHx_iJkBjClH_xHqqkZx_,_xZkqqHx_jHfNjEjC_xHqqkZx_0_xZkqqHx_iCmJjAnNjCoIiClFiBeBjHhAiOiGiCkCiCmBiCmPiCkCiCmJjBoFiCkLiCkCiOgMiKhAiCmFjFfMiOkGiCkKjHjAiCoKiCoJ_xHqqkZx_)-----
////----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
////	//----- _xZkqqHx_iDiKiDjDiDeOiMjPiNpFiDhBiDgCiDgHiLeMjIfOjHhAjFmPjAjEiCpAiPiJiKpKiJlL_xHqqkZx_ -----
////	m_dwHitLinkID = DWORD(-1);		// _xZkqqHx_iDfOiBfLiDfBiDgCiDgHjCiGiCmMiDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
////	// _xZkqqHx_jBeJjBpAjCiGjFjEjFgJiCkJiCoHiJiEiCnBiCoJiDiKiDjDiDeOiCmMiIoKjHjHiCpAiOoGjDlOiBeC_xHqqkZx_
////	DWORDSet setLink;
////	GetSelObjLink(setLink);
////	// _xZkqqHx_iDiKiDjDiDeOjApMiCmMiCfAiCmCiClIiCmCiCpAiDiLiBfLiDhGiBeC_xHqqkZx_
////	DWORDSet::const_iterator iLs;
////	for (iLs = setLink.begin(); iLs != setLink.end(); iLs++)
////	{
////		FCPolyJoint jnt[3];
////		// _xZkqqHx_iKeKiOgOjDfPiBeFiPeJjHlJjDfPiNmAjFfHiCkJiCoHjGoOiIpDjApMiCmMiDhIiDfHiDeHiLmIjApMjHhAiCmMjIeBiMiLjDfPjEhKjHpBiCpAiOoGjDlOiBeC_xHqqkZx_
////		Calc3Joint(jnt, *iLs);
////		//----- _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiClHiCoJjBePiCmJiBeBjIeBiMiLjDfPiCmMjBePjElMiBeFiMoDjElMiCmJiKePjAnK_xHqqkZx_
////		//		_xZkqqHx_iClHiCoJiDhEiDiMiBfLiDiAiCpAiMhGiOfKiClFiBeBiClLiCmMiDhEiDiMiBfLiDiAiCmFiDhBiDgCiDgHiCpAjClCiCnHiCoJ_xHqqkZx_ -----
////		//----- _xZkqqHx_jBePjElMiLoJiMgAiCpAiMhGiOfK_xHqqkZx_ -----
////		DBLRect mmrtPrev(jnt[0].m_mmptPivot, jnt[1].m_mmptPivot);
////		mmrtPrev.NormalizeRect();
////		SmallerOrLarger(mmrtPrev.left, mmrtPrev.right,
////						jnt[1].m_mmptPivot.x + jnt[1].m_mmptPrev.x);
////		SmallerOrLarger(mmrtPrev.top, mmrtPrev.bottom,
////						jnt[1].m_mmptPivot.y + jnt[1].m_mmptPrev.y);
////		mmrtPrev.Extend(lg2mm(5));
////		//----- _xZkqqHx_iMoDjElMiLoJiMgAiCpAiMhGiOfK_xHqqkZx_ -----
////		DBLRect mmrtNext(jnt[1].m_mmptPivot, jnt[2].m_mmptPivot);
////		mmrtNext.NormalizeRect();
////		SmallerOrLarger(mmrtNext.left, mmrtNext.right,
////						jnt[1].m_mmptPivot.x + jnt[1].m_mmptNext.x);
////		SmallerOrLarger(mmrtNext.top, mmrtNext.bottom,
////						jnt[1].m_mmptPivot.y + jnt[1].m_mmptNext.y);
////		mmrtNext.Extend(lg2mm(5));
////		// _xZkqqHx_iCmHiClPiCoHiCmMiLoJiMgAiCmJiCoAiDhBiDgCiDgHiClFiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ _xZkqqHx_iOjPiCnGiBeC_xHqqkZx_
////		if (!mmrtPrev.PtInRect(m_mmptMsc) && !mmrtNext.PtInRect(m_mmptMsc)) continue;
////		//
////		// _xZkqqHx_jGoOiIpDjFgAiJoGiCmNiBeBjAhNiMgAjFgAiJoGiCmGiIoBiCkCiMlFjGkHiCmFiCkAiCoJjFeLjHhGiCmNjGlDiCkCiBeC_xHqqkZx_
////		// _xZkqqHx_iClBiCmMiClNiCnPiBeBiMhGiOfKjAlIjDhIiCmMjGnKiImA_xHqqkZx_ g_->lgdPrecision _xZkqqHx_iCpAiCfCjEhLiCmJiClFiCmEiBeB_xHqqkZx_
////		// _xZkqqHx_jAlIjDhIiCpAjHiOiCmGiClFjBkMjDhIiCpAiPoDiClAiCoJiBeC_xHqqkZx_
////		//
////		//----- _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiClFiBeBjApMiPoDiCmMiDhBiDgCiDgHiCpAjClCiCnHiCoJ_xHqqkZx_ -----
////		DBLPointVector vmmptPoly;
////		// _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiBeC_xHqqkZx_
////		::CalcBezier2(vmmptPoly, jnt, 3, 1, 0, 2,
////					lg2mm(3 * g_->lgdPrecision), 1.0, (DBLRect*)NULL, 0);
////		if (::FFPolyIntersect(m_mmptMsc, vmmptPoly.begin(), vmmptPoly.size(), lg2mm(5)) != 0)
////		{
////			m_dwHitLinkID = *iLs;	// _xZkqqHx_iDfOiBfLiDfBiDgCiDgHjCiGiCmMiDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
////			return TRUE;
////		}
////	}
////	return FALSE;
////----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
//	//----- _xZkqqHx_iDiKiDjDiDeOiMjPiNpFiDhBiDgCiDgHiLeMjIfOjHhAjFmPjAjEiCpAiPiJiKpKiJlL_xHqqkZx_ -----
//	m_dwHitLinkID = DWORD(-1);		// _xZkqqHx_iDfOiBfLiDfBiDgCiDgHjCiGiCmMiDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
//
//	// _xZkqqHx_iMlLiNnNiCmMiDhNiDeFiDfIiNmAjFfHiCmJiDhBiDgCiDgHiClHiCoJjFnCiPfHiDgOiDjDiDgIiDiLiCpAjClCiCnHiCoJiBeC_xHqqkZx_
//	set<FCHandleId> stIds;
//	CheckHitHandle(stIds, m_mmptMsc);
//	// _xZkqqHx_iIoKiCmCiCoAiDhBiDgCiDgHiClFiCmEiCkCiCmIiCkCiPoKiNiHiCmN_xHqqkZx_FALSE_xZkqqHx_iBeC_xHqqkZx_
//	if (stIds.empty()) return FALSE;
//	// _xZkqqHx_iDiKiDjDiDeOjGoOiIpDjApMiCmJiDhBiDgCiDgHiClFiCmEiCkCiCmIiCkCiPoKiNiHiCmN_xHqqkZx_FALSE_xZkqqHx_iBeC_xHqqkZx_
//	if ((*stIds.begin()).first != -1) return FALSE;
//	// _xZkqqHx_iDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iCpAiOoGjDlOiBeC_xHqqkZx_
//	m_dwHitLinkID = DWORD((*stIds.begin()).second);
//	return TRUE;
////----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
////----- 02.07.21 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ (A3_xZkqqHx_iJkBjClH_xHqqkZx_,_xZkqqHx_jHfNjEjC_xHqqkZx_0_xZkqqHx_iCmJjAnNjCoIiClFiBeBjHhAiOiGiCkCiCmBiCmPiCkCiCmJjBoFiCkLiCkCiOgMiKhAiCmFjFfMiOkGiCkKjHjAiCoKiCoJ_xHqqkZx_)-----
//} // FCToolLink::CheckHitLink.
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::CheckHitMolip
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhNiDeFiDfIiNmAjFfHiCkKiDiCiDiKiDhGiPoDiCmFiDhBiDgCiDgHiClFiCmEiCkCiCoJiCkJjClCiCnHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDhBiDgCiDgHiClFiCmEiCkCiCoJiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_iPoDiImKiDeOiDiJiDfIiCmMjFmPjAjEiBeB_xHqqkZx_m_pHitMolipObj _xZkqqHx_iCmG_xHqqkZx_ m_lHitMolip_xZkqqHx_iCpAiPjBiCkLiKlHiCkGiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCToolLink::CheckHitMolip ()
{
	m_pHitMolipObj = NULL;
	m_lHitMolip = -1;
	// _xZkqqHx_iMlLiNnNiCmMiDhNiDeFiDfIiNmAjFfHiCmJiDhBiDgCiDgHiClHiCoJjFnCiPfHiDgOiDjDiDgIiDiLiCpAjClCiCnHiCoJiBeC_xHqqkZx_
	set<FCHandleId> stIds;
	CheckHitHandle(stIds, m_mmptMsc);
	// _xZkqqHx_jFjEjFgJiCmMiCkEiClPiBeBiLhEiCkJiCoHjClCiCnHiCoJiBeC_xHqqkZx_
	ObjDynabaseVector::const_reverse_iterator rObj;
	for (rObj = g_pView->SelectObjVector().rbegin();
		 rObj != g_pView->SelectObjVector().rend(); rObj++)
	{
		set<FCHandleId>::const_iterator iId = stIds.lower_bound(FCHandleId(long((*rObj)->GetObjID()), -1, 0, 0));
		if (iId != stIds.end() && (*iId).first == long((*rObj)->GetObjID()))
		{
			m_pHitMolipObj = g_pDoc->ObjID2Object((*iId).first);
			m_lHitMolip = (*iId).second;
			return TRUE;
		}
	}
	return FALSE;
} // FCToolLink::CheckHitMolip.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::GetMyMolipPos
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiCmMjFjEjFgJiCmMiOhHjCoIiCmMiDiCiDiKiDhG_xHqqkZx_ID_xZkqqHx_iCmMiDiCiDiKiDhGiImKjChFiCpAiOoGjDlOiClHiCoJiKnGjAjEiBeC_xHqqkZx_
 *			_xZkqqHx_iDiCiDiKiDhGiInKjDkOiDgFiBfLiDhFiDiL_xHqqkZx_ m_mpObjIdToMolipInfo _xZkqqHx_iCpAiNgMjHlGiClFiCmEiDiCiDiKiDhGiImKjChFiCpA_xHqqkZx_
 *			_xZkqqHx_iMhGiOfKiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	mmpt		:_xZkqqHx_iDiCiDiKiDhGiImKjChFiCpAjFnEiClHiBeC_xHqqkZx_
 *			pObj		:_xZkqqHx_iDfOiBfLiDfBiDgCiDgHiCmMjFjEjFgJiCpAiOhHjCoIiBeC_xHqqkZx_
 *			lMolipId	:_xZkqqHx_iDiCiDiKiDhG_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			lTerminalIdx:_xZkqqHx_iDiCiDiKiDhGiCmMiDfOiBfLiDhOiDgJiDiLiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iOoGjDlOiCmFiCkLiClNiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.07 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::GetMyMolipPos (DBLPoint& mmpt, const FCObjDynabase* pObj, long lMolipId) const
{
	// _xZkqqHx_iDiCiDiKiDhG_xHqqkZx_ID_xZkqqHx_iCmFiOhHjCoIiClDiCoKiClNiDiCiDiKiDhGiCmMiNmAjFfHiCpAiOoGjDlOiBeC_xHqqkZx_
	mmpt = pObj->GetMolipPos(lMolipId, 0);
	map< pair<DWORD, long>, DBLPoint >::const_iterator iOmi;
	iOmi = m_mpMolipIdToOffset.find(pair<DWORD, long>(pObj->GetObjID(), lMolipId));
	if (iOmi != m_mpMolipIdToOffset.end())
		mmpt += (*iOmi).second;
} // FCToolLink::GetMyMolipPos.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::GetDefaultIdleCursor
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	StateIdle_xZkqqHx_iCmFiDgGiDhEiDeIiDiLiDgHiCmJiOgHiCoNiCoKiCoJiDeKiBfLiDfMiDiLiDgOiDjDiDgIiDiLiCpAjFnEiClHiBeC_xHqqkZx_
 *			_xZkqqHx_jFfHiPiAiCmMiDeKiBfLiDfMiDiLiCmMiPoKiNiHiCmN_xHqqkZx_ NULL_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.07.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
HCURSOR FCToolLink::GetDefaultIdleCursor () const
{
	return FFGetApp()->LoadCursor(IDC_CURSOR_TOOL_LINK);
} // FCToolLink::GetDefaultIdleCursor.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::GetSubMenuIndex
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	FCToolBaseFDA::StateContextMenu _xZkqqHx_iCmFjFfMiOkGiClHiCoJiDfEiDhFiDiBiDgKiDiFiBfLiCmM_xHqqkZx_
 *			_xZkqqHx_iDeDiDjDiDgGiDgCiDeOiDfIiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
int FCToolLink::GetSubMenuIndex () const
{
	if (GetSelectedXXX(XXX_LINK) != 0)
		return FD_MENU_TOOL_LINK_ON_LINK;
	else
		return FD_MENU_TOOL_LINK_ON_BACKGROUND;
} // FCToolLink::GetSubMenuIndex.

//----- 06.12.09 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::OnDrawState
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	View_xZkqqHx_iCmM_xHqqkZx_OnDraw_xZkqqHx_iCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC		:_xZkqqHx_jFfMiOkGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *			pmmrtRgn:_xZkqqHx_iDiKiBfLiDfHiDiHiDjDjEhKjHpBiCpAiOhHjCoIiBeCiOgHiCoNiCmIiCkCiPoKiNiHiCmN_xHqqkZx_NULL_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			lRgnSize:pmmrtRgn_xZkqqHx_iCmMjEhKjHpBiDfEiDeDiDfJiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.03.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::OnDrawState (CDC* pDC, int iState)
{
	// FDA_xZkqqHx_iCmMiMlLiNnNiCmMiPpDjBnEiBeC_xHqqkZx_
	switch (iState)
	{
	case STATE_LINKING:				// _xZkqqHx_iDiKiDjDiDeOjCiGiBeC_xHqqkZx_
	  {
		// _xZkqqHx_iPeDjAlDjApMjFgAiJoGjHhAiDeOiDiJiDfIiCpAiNoMjAkMiBeC_xHqqkZx_
		FCEditDraw eDraw(pDC, 0);
		//----- _xZkqqHx_iDiKiDjDiDeOjApMiCpAjFgAiJoG_xHqqkZx_ -----
		eDraw.Line(&mm2lg(m_mmptFromMolip), &mm2lg(m_mmptLast));
		break;
	  }
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	case STATE_ENCLOSING_LINK:		// _xZkqqHx_iDiKiDjDiDeOjFoPiImNjCiGiBeC_xHqqkZx_
//		DrawCurFocusFrame(pDC);
//		break;
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	case STATE_MOVING_MOLIP_MARK:	// _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOjCiGiBeC_xHqqkZx_
	  {
		// _xZkqqHx_iPeDjAlDjApMjFgAiJoGjHhAiDeOiDiJiDfIiCpAiNoMjAkMiBeC_xHqqkZx_
		FCEditDraw eDraw(pDC, 0);
		// _xZkqqHx_iInKjDkOjCiGiDiCiDiKiDhGiNmAjFfHiCmJiLoJiMgAiCpAjFgAiJoGiBeC_xHqqkZx_
		eDraw.UnselMark(mm2lg(m_mmptLast));
		break;
	  }
	}
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnDrawState(pDC, iState);
} // FCToolLink::OnDrawState.
//----- 06.12.09 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::TransFDA
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iMiIjCoIjAkLjHeMiMmAiDeJiBfLiDgHiDhNiDgHiDjDiCmMjBeKiInKiCpAjFnEiClHiBeC_xHqqkZx_ToolLink.mdrw_xZkqqHx_iCpAiOfBiPmGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	iState	:_xZkqqHx_iMlLiNnNiCmMiPpDjBnEiCpAiOhHjCoIiBeC_xHqqkZx_
 *			iEvent	:_xZkqqHx_iDeDiDhIiDjDiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jBeKiInKiMoDiCmMiPpDjBnEiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
int FCToolLink::TransFDA (int iState, int iEvent)
{
	// _xZkqqHx_iInKiNhDjAoGiPpDjBnEiBeC_xHqqkZx_
	int iNextState = STATE_NONE;	// _xZkqqHx_iPpDjBnEjGlDiClFiBeC_xHqqkZx_

	// FDA_xZkqqHx_iCmMiMlLiNnNiCmMiPpDjBnEiBeC_xHqqkZx_
	switch (iState)
	{
	case STATE_IDLE:				// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
		switch (iEvent)
		{
		case WM_LBUTTONDOWN:	// _xZkqqHx_iNlGiDhLiDfOiDjDiDfPiDeFiDjDiBeC_xHqqkZx_
		case WM_RBUTTONDOWN:	// _xZkqqHx_iJeFiDhLiDfOiDjDiDfPiDeFiDjDiBeC_xHqqkZx_
			if (FFCanEditObject() && m_pHitMolipObj != NULL)
			//----- _xZkqqHx_iDiCiDiKiDhGiPoDiDhBiDgCiDgHiCmMiPoKiNiH_xHqqkZx_ -----
			{
				// _xZkqqHx_iDiKiDjDiDeOiDeBiDeFiDgHiJmCjEfMiCmIiDiCiDiKiDhGiCmMiPoKiNiHiBeC_xHqqkZx_
				if (m_iCursorNew != FDPA_HIT_NOT_MOLIP &&
					m_iCursorNew != FDPA_HIT_NONE)
					iNextState = STATE_START_LINK;			// _xZkqqHx_iDiKiDjDiDeOiKeKiOgOiBeC_xHqqkZx_
				else
					iNextState = STATE_START_MOVE_MOLIP_MARK;	// _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOiKeKiOgOiBeC_xHqqkZx_
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//				} else
//				if (CheckHitLink())
//				{
//					iNextState = STATE_ENTER_OPE_LINK;		// _xZkqqHx_iDiKiDjDiDeOjBiAiNoMjDpMiMpLiBeC_xHqqkZx_
//				} else
//				if (IsControl())
//				{
//					iNextState = STATE_START_ENCLOSE_LINK;	// _xZkqqHx_iDiKiDjDiDeOjFoPiImNiKeKiOgOiBeC_xHqqkZx_
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
			}
			break;
		}
		break;
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	case STATE_ENTER_OPE_LINK:		// _xZkqqHx_iDiKiDjDiDeOjBiAiNoMjDpMiMpLiBeC_xHqqkZx_
//		if (IsSelectedXXX(XXX_LINK, m_dwHitLinkID))
//			iNextState = STATE_PRE_UNSEL_LINK;	// _xZkqqHx_iDiKiDjDiDeOjBeJjBpAiJpAiPjMjBePiBeC_xHqqkZx_
//		else
//			iNextState = STATE_CLRSEL_SEL_LINK;	// _xZkqqHx_iDiKiDjDiDeOjBeJjBpAiPmBiLiOjCmHiJmBiBeC_xHqqkZx_
//		break;
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	case STATE_START_LINK:			// _xZkqqHx_iDiKiDjDiDeOiKeKiOgOiBeC_xHqqkZx_
		iNextState = STATE_LINKING;				// _xZkqqHx_iDiKiDjDiDeOjCiGiBeC_xHqqkZx_
		break;
	case STATE_LINKING:				// _xZkqqHx_iDiKiDjDiDeOjCiGiBeC_xHqqkZx_
		switch (iEvent)
		{
		case WM_MOUSEMOVE:		// _xZkqqHx_iDhNiDeFiDfIiInKjDkOiBeC_xHqqkZx_
			iNextState = STATE_LINKING;				// _xZkqqHx_iDiKiDjDiDeOjCiGiBeC_xHqqkZx_
			break;
		case WM_LBUTTONUP:		// _xZkqqHx_iNlGiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
			iNextState = STATE_STOP_LINK;			// _xZkqqHx_iDiKiDjDiDeOiPeJjHlJiBeC_xHqqkZx_
			break;
		case WM_CONTEXTMENU:	// _xZkqqHx_iDfCiDjDiDgFiDeMiDfIiDgHiDiBiDgKiDiFiBfLiBeC_xHqqkZx_
			// _xZkqqHx_iDiKiDjDiDeOiDeBiDeFiDgHiJmCjEfMiCmIiDiCiDiKiDhGiPoDiDhBiDgCiDgHiCmMiPoKiNiHiBeC_xHqqkZx_
			if (m_iCursorNew != FDPA_HIT_NOT_MOLIP &&
				m_iCursorNew != FDPA_HIT_NONE &&
				(m_pFromObj->GetObjID() != m_pHitMolipObj->GetObjID() ||
				 m_lFromMolipId != m_lHitMolip))
				iNextState = STATE_CONTEXT_MENU_MKL;	// _xZkqqHx_iDiBiDgKiDiFiBfLjFfMiOkG_xHqqkZx___xZkqqHx_iDiKiDjDiDeOiNoMjAkMiBeC_xHqqkZx_
			else
				iNextState = STATE_STOP_LINK;			// _xZkqqHx_iDiKiDjDiDeOiPeJjHlJiBeC_xHqqkZx_
			break;
		}
		break;
	case STATE_CONTEXT_MENU_MKL:	// _xZkqqHx_iDiBiDgKiDiFiBfLjFfMiOkG_xHqqkZx___xZkqqHx_iDiKiDjDiDeOiNoMjAkMiBeC_xHqqkZx_
		switch (iEvent)
		{
		case WM_COMMAND:		// _xZkqqHx_iDfCiDhNiDjDiDgIiBeC_xHqqkZx_
			iNextState = STATE_MKL_COMMAND;		// _xZkqqHx_iDiKiDjDiDeOiNoMjAkM_xHqqkZx___xZkqqHx_iDfCiDhNiDjDiDgIiBeC_xHqqkZx_
			break;
		}
		break;
	case STATE_MKL_COMMAND:			// _xZkqqHx_iDiKiDjDiDeOiNoMjAkM_xHqqkZx___xZkqqHx_iDfCiDhNiDjDiDgIiBeC_xHqqkZx_
		iNextState = STATE_STOP_LINK;	// _xZkqqHx_iDiKiDjDiDeOiPeJjHlJiBeC_xHqqkZx_
		break;
	case STATE_STOP_LINK:			// _xZkqqHx_iDiKiDjDiDeOiPeJjHlJiBeC_xHqqkZx_
		iNextState = STATE_IDLE;			// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
		break;
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	case STATE_PRE_UNSEL_LINK:		// _xZkqqHx_iDiKiDjDiDeOjBeJjBpAiJpAiPjMjBePiBeC_xHqqkZx_
//		switch (iEvent)
//		{
//		case WM_LBUTTONUP:	// _xZkqqHx_iNlGiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
//		case WM_RBUTTONUP:	// _xZkqqHx_iJeFiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
//			if (IsShift())
//				iNextState = STATE_UNSEL_LINK;		// _xZkqqHx_iDiKiDjDiDeOjBeJjBpAiJpAiPjMiBeC_xHqqkZx_
//			else
//				iNextState = STATE_EXIT_OPE_LINK;	// _xZkqqHx_iDiKiDjDiDeOjBiAiNoMiPgPiMpLiBeC_xHqqkZx_
//			break;
//		}
//		break;
//	case STATE_UNSEL_LINK:			// _xZkqqHx_iDiKiDjDiDeOjBeJjBpAiJpAiPjMiBeC_xHqqkZx_
//		iNextState = STATE_EXIT_OPE_LINK;	// _xZkqqHx_iDiKiDjDiDeOjBiAiNoMiPgPiMpLiBeC_xHqqkZx_
//		break;
//	case STATE_CLRSEL_SEL_LINK:		// _xZkqqHx_iDiKiDjDiDeOjBeJjBpAiPmBiLiOjCmHiJmBiBeC_xHqqkZx_
//		switch (iEvent)
//		{
//		case WM_LBUTTONUP:	// _xZkqqHx_iNlGiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
//		case WM_RBUTTONUP:	// _xZkqqHx_iJeFiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
//			iNextState = STATE_EXIT_OPE_LINK;	// _xZkqqHx_iDiKiDjDiDeOjBiAiNoMiPgPiMpLiBeC_xHqqkZx_
//			break;
//		}
//		break;
//	case STATE_START_ENCLOSE_LINK:	// _xZkqqHx_iDiKiDjDiDeOjFoPiImNiKeKiOgOiBeC_xHqqkZx_
//		iNextState = STATE_ENCLOSING_LINK;		// _xZkqqHx_iDiKiDjDiDeOjFoPiImNjCiGiBeC_xHqqkZx_
//		break;
//	case STATE_ENCLOSING_LINK:		// _xZkqqHx_iDiKiDjDiDeOjFoPiImNjCiGiBeC_xHqqkZx_
//		switch (iEvent)
//		{
//		case WM_MOUSEMOVE:	// _xZkqqHx_iDhNiDeFiDfIiInKjDkOiBeC_xHqqkZx_
//			iNextState = STATE_ENCLOSING_LINK;		// _xZkqqHx_iDiKiDjDiDeOjFoPiImNjCiGiBeC_xHqqkZx_
//			break;
//		case WM_LBUTTONUP:	// _xZkqqHx_iNlGiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
//		case WM_RBUTTONUP:	// _xZkqqHx_iJeFiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
//			iNextState = STATE_STOP_ENCLOSE_LINK;	// _xZkqqHx_iDiKiDjDiDeOjFoPiImNiPeJjHlJiBeC_xHqqkZx_
//			break;
//		}
//		break;
//	case STATE_STOP_ENCLOSE_LINK:	// _xZkqqHx_iDiKiDjDiDeOjFoPiImNiPeJjHlJiBeC_xHqqkZx_
//		iNextState = STATE_IDLE;			// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
//		break;
//	case STATE_EXIT_OPE_LINK:		// _xZkqqHx_iDiKiDjDiDeOjBiAiNoMiPgPiMpLiBeC_xHqqkZx_
//		iNextState = STATE_IDLE;			// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
//		break;
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

	case STATE_START_MOVE_MOLIP_MARK:	// _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOiKeKiOgOiBeC_xHqqkZx_
		iNextState = STATE_MOVING_MOLIP_MARK;	// _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOjCiGiBeC_xHqqkZx_
		break;

	case STATE_MOVING_MOLIP_MARK:		// _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOjCiGiBeC_xHqqkZx_
		switch (iEvent)
		{
		case WM_MOUSEMOVE:	// _xZkqqHx_iDhNiDeFiDfIiInKjDkOiBeC_xHqqkZx_
			iNextState = STATE_MOVING_MOLIP_MARK;	// _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOjCiGiBeC_xHqqkZx_
			break;
		case WM_LBUTTONUP:	// _xZkqqHx_iNlGiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
		case WM_RBUTTONUP:	// _xZkqqHx_iJeFiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
			iNextState = STATE_STOP_MOVE_MOLIP_MARK;	// _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOiPeJjHlJiBeC_xHqqkZx_
			break;
		}
		break;

	case STATE_STOP_MOVE_MOLIP_MARK:	// _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOiPeJjHlJiBeC_xHqqkZx_
		iNextState = STATE_IDLE;			// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
		break;

	case BASE_CLASS::STATE_CANCEL_ENCLOSE_XXX:		// XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHjFoPiImNiDeMiDiDiDjDiDfKiDiLiBeC_xHqqkZx_
		iNextState = STATE_CHECK_EXIT_TOOL_BY_BUTTON;		// _xZkqqHx_iDhNiDeFiDfIiDhLiDfOiDjDiCmJiCoGiCoJiDgDiBfLiDiLiPeJjHlJiDgAiDeGiDgCiDeOiBeC_xHqqkZx_
		break;
	}
	// _xZkqqHx_iPpDjBnEjBeKiInKjGlDiClFiCmMiPoKiNiHiCmNiDfIiBfLiDhAiBfLiDeOiDiJiDfIiCmMiPpDjBnEjBeKiInKiCpAiMmEiCnBiPgPiClHiBeC_xHqqkZx_
	if (iNextState == STATE_NONE)
		iNextState = BASE_CLASS::TransFDA(iState, iEvent);
	return iNextState;
} // FCToolLink::TransFDA.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateFDA
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iPpDjBnEiCmJiJjOiClGiClNiPiIjHjNiCpAiOmAiNhDiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	iState	:_xZkqqHx_iMlLiNnNiCmMiPpDjBnEiCpAiOhHjCoIiBeC_xHqqkZx_
 *			pDC		:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::StateFDA (int iState, CDC* pDC)
{
	// FDA_xZkqqHx_iCmMiOjPiCmMiPpDjBnEiBeC_xHqqkZx_
	switch (iState)
	{
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	case STATE_ENTER_OPE_LINK:		// _xZkqqHx_iDiKiDjDiDeOjBiAiNoMjDpMiMpLiBeC_xHqqkZx_
//		StateEnterOpeLink(pDC);
//		break;
//	case STATE_PRE_UNSEL_LINK:		// _xZkqqHx_iDiKiDjDiDeOjBeJjBpAiJpAiPjMjBePiBeC_xHqqkZx_
//		StatePreUnselLink(pDC);
//		break;
//	case STATE_UNSEL_LINK:			// _xZkqqHx_iDiKiDjDiDeOjBeJjBpAiJpAiPjMiBeC_xHqqkZx_
//		StateUnselLink(pDC);
//		break;
//	case STATE_CLRSEL_SEL_LINK:		// _xZkqqHx_iDiKiDjDiDeOjBeJjBpAiPmBiLiOjCmHiJmBiBeC_xHqqkZx_
//		StateClrselSelLink(pDC);
//		break;
//	case STATE_START_ENCLOSE_LINK:	// _xZkqqHx_iDiKiDjDiDeOjFoPiImNiKeKiOgOiBeC_xHqqkZx_
//		StateStartEncloseLink(pDC);
//		break;
//	case STATE_ENCLOSING_LINK:		// _xZkqqHx_iDiKiDjDiDeOjFoPiImNjCiGiBeC_xHqqkZx_
//		StateEnclosingLink(pDC);
//		break;
//	case STATE_STOP_ENCLOSE_LINK:	// _xZkqqHx_iDiKiDjDiDeOjFoPiImNiPeJjHlJiBeC_xHqqkZx_
//		StateStopEncloseLink(pDC);
//		break;
//	case STATE_EXIT_OPE_LINK:		// _xZkqqHx_iDiKiDjDiDeOjBiAiNoMiPgPiMpLiBeC_xHqqkZx_
//		StateExitOpeLink(pDC);
//		break;
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	case STATE_START_LINK:			// _xZkqqHx_iDiKiDjDiDeOiKeKiOgOiBeC_xHqqkZx_
		StateStartLink(pDC);
		break;
	case STATE_LINKING:				// _xZkqqHx_iDiKiDjDiDeOjCiGiBeC_xHqqkZx_
		StateLinking(pDC);
		break;
	case STATE_CONTEXT_MENU_MKL:	// _xZkqqHx_iDiBiDgKiDiFiBfLjFfMiOkG_xHqqkZx___xZkqqHx_iDiKiDjDiDeOiNoMjAkMiBeC_xHqqkZx_
		StateContextMenuMkl(pDC);
		break;
	case STATE_MKL_COMMAND:			// _xZkqqHx_iDiKiDjDiDeOiNoMjAkM_xHqqkZx___xZkqqHx_iDfCiDhNiDjDiDgIiBeC_xHqqkZx_
		StateMklCommand(pDC);
		break;
	case STATE_STOP_LINK:			// _xZkqqHx_iDiKiDjDiDeOiPeJjHlJiBeC_xHqqkZx_
		StateStopLink(pDC);
		break;
	case STATE_START_MOVE_MOLIP_MARK:	// _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOiKeKiOgOiBeC_xHqqkZx_
		StateStartMoveMolipMark(pDC);
		break;
	case STATE_MOVING_MOLIP_MARK:		// _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOjCiGiBeC_xHqqkZx_
		StateMovingMolipMark(pDC);
		break;
	case STATE_STOP_MOVE_MOLIP_MARK:	// _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOiPeJjHlJiBeC_xHqqkZx_
		StateStopMoveMolipMark(pDC);
		break;
	default:
		BASE_CLASS::StateFDA(iState, pDC);
	}
} // FCToolLink::StateFDA.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateIdle
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jBnCiClPiPiIjHjNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::StateIdle (CDC* pDC)
{
	TRACE(_T("FCToolLink::StateIdle\r\n"));
	// _xZkqqHx_iDhBiDgCiDgHiDeKiBfLiDfMiDiLiCpAjGlDiMpIiCmJiClHiCoJiBeC_xHqqkZx_
	m_iCursorNew = FDPA_HIT_NONE;
	if (FFCanEditObject())
	{
//----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//		// _xZkqqHx_jBeJjBpAjCiGiCmMjFjEjFgJiCmMiChJiDeJiBfLiDfPiBfLiBeC_xHqqkZx_
//		FCZOrder zOrder;
//		zOrder.PushBack(&g_pView->SelectObjVector());
//		// _xZkqqHx_iDiCiDiKiDhGiMjPiNpFiBeCiDhBiDgCiDgHiDeKiBfLiDfMiDiLiCpAjAnNjCoIiBeC_xHqqkZx_
//		DBLPoint mmptHitPos;
//		FTMolipKind iCursorNew = FCLinkManager::GetHitOnMolip(m_pHitMolipObj, m_lHitMolip,
//															mmptHitPos, m_mmptMsc,
//															NULL, TRUE, TRUE, 3, 10,
//															&zOrder,
//															myGetMolipPos, DWORD(this));
//----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
		// _xZkqqHx_iDhNiDeFiDfIiNmAjFfHiCkKiDiCiDiKiDhGiCmJiDhBiDgCiDgHiClFiCmEiCkCiCoJiCkJjClCiCnHiCoJiBeC_xHqqkZx_
		FTMolipKind iCursorNew = CheckHitMolip() ? FDPA_HIT_POINT_MOLIP : FDPA_HIT_NOT_MOLIP;
//----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
		if (IsControl())
		{
			m_iCursorNew = iCursorNew;
			// _xZkqqHx_iDiCiDiKiDhGiPoDiDhBiDgCiDgHiCmMiPoKiNiHiCmNiBeBiDhNiDeFiDfIiNmAjFfHiCpAiDiCiDiKiDhGiNmAjFfHiCmJjFoCjAlDiBeC_xHqqkZx_
			if (m_iCursorNew != FDPA_HIT_NOT_MOLIP &&
				m_pHitMolipObj->IsLinkable(m_lHitMolip, TRUE))
			{
				// _xZkqqHx_iDiCiDiKiDhGiCmMiNmAjFfHiCmNiBeB_xHqqkZx_ObjDynabase::GetMolipPos _xZkqqHx_iCmFiCmNiCmIiCkN_xHqqkZx_
				// GetMyMolipPos _xZkqqHx_iCpAiOgHiCoNiCmIiCkNiCmEiCmNiCmIiCoHiCmIiCkCiBeC_xHqqkZx_
				// _xZkqqHx_iDiCiDiKiDhGiCpAiIoKiOjOjDeJiCmJiInKjDkOiClFiCmEiCkCiCoJiPoKiNiHiCkKiCkAiCoJiClNiCnPiBeC_xHqqkZx_
// 05.10.26 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//				m_mmptCnv = m_pHitMolipObj->GetMolipPos(m_lHitMolip);
				GetMyMolipPos(m_mmptCnv, m_pHitMolipObj, m_lHitMolip);
			} else
			{
				m_iCursorNew = FDPA_HIT_NONE;
			}
		} else
		{
			if (m_pHitMolipObj != NULL)
				SetIdleCursor(FFGetApp()->LoadStandardCursor(IDC_SIZEALL));
		}
		if (m_pHitMolipObj != NULL)
		//----- _xZkqqHx_iDiCiDiKiDhGiCmJiDhBiDgCiDgHiClFiCmEiCkCiCoJiPoKiNiH_xHqqkZx_ -----
		{
			
			// _xZkqqHx_iDfIiDgFiBfLiDfOiDfIiDgPiBfLiCmJjFfMiOkGiClHiCoJjFlGiOjKjHpBiCpAjAnNjCoIiBeC_xHqqkZx_
			m_strIdleStatus.Format(L"%s MolipID:%d",
									FFObjTypeToStr(m_pHitMolipObj->Type()),
									m_lHitMolip);
		}
	}
	// _xZkqqHx_iDiLiBfLiDiJiBfLiDhNiDeFiDfIiDhNiBfLiDeKiBfLiBjFiDfIiDgFiBfLiDfOiDfIjFfMiOkGiBeC_xHqqkZx_
	BASE_CLASS::StateIdle(pDC);
} // FCToolLink::StateIdle.

//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateEnterOpeLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOjBiAiNoMjDpMiMpLiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLink::StateEnterOpeLink (CDC* pDC)
//{
//	TRACE(_T("StateEnterOpeLink\r\n"));
//	// OnLButtonUp_xZkqqHx_iCnMiCmFiClBiCmM_xHqqkZx_Window_xZkqqHx_iCmJiDeDiDhIiDjDiDgHiBeC_xHqqkZx_
//	::FFSetCapture(g_pView->m_hWnd);
//} // FCToolLink::StateEnterOpeLink.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StatePreUnselLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOjBeJjBpAiJpAiPjMjBePiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLink::StatePreUnselLink (CDC* pDC)
//{
//	TRACE(_T("StatePreUnselLink\r\n"));
//} // FCToolLink::StatePreUnselLink.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateUnselLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOjBeJjBpAiJpAiPjMiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLink::StateUnselLink (CDC* pDC)
//{
//	TRACE(_T("StateUnselLink\r\n"));
//	RemoveSelectLink(m_dwHitLinkID, pDC);
//} // FCToolLink::StateUnselLink.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateClrselSelLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOjBeJjBpAiPmBiLiOjCmHiJmBiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLink::StateClrselSelLink (CDC* pDC)
//{
//	TRACE(_T("StateClrselSelLink\r\n"));
//	// Shift_xZkqqHx_iCkKiJjPiClDiCoKiCmEiCkCiCmIiCkCiPoKiNiHiBeC_xHqqkZx_
//	if (!IsShift()) ClearSelectLink(pDC);
//	// _xZkqqHx_jBeJjBpAiCmJjCmHiJmBiBeC_xHqqkZx_
//	AppendSelectLink(m_dwHitLinkID, pDC);
//} // FCToolLink::StateClrselSelLink.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateStartEncloseLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOjFoPiImNiKeKiOgOiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLink::StateStartEncloseLink (CDC* pDC)
//{
//	TRACE(_T("StateStartEncloseLink\r\n"));
//	// OnLButtonUp_xZkqqHx_iCnMiCmFiClBiCmM_xHqqkZx_Window_xZkqqHx_iCmJiDeDiDhIiDjDiDgHiBeC_xHqqkZx_
//	::FFSetCapture(g_pView->m_hWnd);
//	// _xZkqqHx_iOkJjDkOiDfIiDeOiDiNiBfLiDiLiBgJiJoGjGmKiCpAiCmNiCnNiPgPiClFiClNiOjOiBgKiCpAiCgOiCgNiBeC_xHqqkZx_
//	g_pView->SetAutoScroll(TRUE);
//	FocusFrameDrawBegin(pDC, m_mmptMsc);
//} // FCToolLink::StateStartEncloseLink.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateEnclosingLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOjFoPiImNjCiGiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLink::StateEnclosingLink (CDC* pDC)
//{
//	TRACE(_T("StateEnclosingLink\r\n"));
//	FocusFrameDrawing(pDC, m_mmptMsc);
//} // FCToolLink::StateEnclosingLink.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateStopEncloseLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOjFoPiImNiPeJjHlJiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLink::StateStopEncloseLink (CDC* pDC)
//{
//	TRACE(_T("StateStopEncloseLink\r\n"));
//	// _xZkqqHx_iDhNiDeFiDfIiCmMjFnPiKgMiCpAiJpAiPjMiBeC_xHqqkZx_
//	::FFReleaseCapture();
//	// _xZkqqHx_iOkJjDkOiDfIiDeOiDiNiBfLiDiLiBgJiJoGjGmKiCpAiCmNiCnNiPgPiClFiClNiOjOiBgKiCpAiDeJiDhEiBeC_xHqqkZx_
//	g_pView->SetAutoScroll(FALSE);
//	FocusFrameDrawEnd(pDC);
//	CRect lgrtFocus = mm2lg(GetFocusFrame());
//
//	// _xZkqqHx_jBeJjBpAjCiGjFjEjFgJiCkJiCoHiJiEiCnBiCoJiDiKiDjDiDeOiCmMiIoKjHjHiCpAiOoGjDlOiBeC_xHqqkZx_
//	DWORDSet setLink;
//	GetSelObjLink(setLink);
//	if (IsShift())
//	//----- _xZkqqHx_iDfGiDhEiDgHiDeMiBfLiCpAiJjPiClFiCmEiCkCiCoJiPoKiNiH_xHqqkZx_ -----
//	{
//		// _xZkqqHx_iDiKiDjDiDeOjApMiCmMiCfAiCmCiClIiCmCiCpAiDiLiBfLiDhGiBeC_xHqqkZx_
//		DWORDSet::const_iterator iLs;
//		for (iLs = setLink.begin(); iLs != setLink.end(); iLs++)
//		{
//			if (IsLinkInRect(*iLs, lgrtFocus))
//			{
//				if (IsSelectedXXX(XXX_LINK, *iLs))
//					RemoveSelectLink(*iLs, pDC);
//				else
//					AppendSelectLink(*iLs, pDC);
//			}
//		}
//	} else
//	//----- _xZkqqHx_iDfGiDhEiDgHiDeMiBfLiCpAiJjPiClFiCmEiCkCiCmIiCkCiPoKiNiH_xHqqkZx_ -----
//	{
//		// _xZkqqHx_iDfGiDhEiDgHiDeMiBfLiCkKiJjPiClDiCoKiCmEiCkCiCmIiCkPiCoKiCmOiBeBiNkBiCmMjBeJjBpAiDiKiDjDiDeOiCpAiJpAiPjMiBeC_xHqqkZx_
//		ClearSelectLink(pDC);
//		// _xZkqqHx_jBfDiCmEiCmMiDiKiDjDiDeOiCmJjBmOiClFiCmEiBeBiLoJiMgAjDoAiCmJiCkAiCoJiPoKiNiHiCmNjBeJjBpAiClHiCoJiBeC_xHqqkZx_
//		DWORDSet::const_iterator iLs;
//		for (iLs = setLink.begin(); iLs != setLink.end(); iLs++)
//		{
//			if (IsLinkInRect(*iLs, lgrtFocus)) AppendSelectLink(*iLs, pDC);
//		}
//	}
//} // FCToolLink::StateStopEncloseLink.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateExitOpeLink
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOjBiAiNoMiPgPiMpLiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolLink::StateExitOpeLink (CDC* pDC)
//{
//	TRACE(_T("StateExitOpeLink\r\n"));
//	// _xZkqqHx_iDhNiDeFiDfIiCmMjFnPiKgMiCpAiJpAiPjMiBeC_xHqqkZx_
//	::FFReleaseCapture();
//} // FCToolLink::StateExitOpeLink.
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateStartLink
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOiKeKiOgOiPiIjHjNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::StateStartLink (CDC* pDC)
{
	TRACE(_T("StateStartLink\r\n"));
	// OnLButtonUp_xZkqqHx_iCnMiCmFiClBiCmM_xHqqkZx_Window_xZkqqHx_iCmJiDeDiDhIiDjDiDgHiBeC_xHqqkZx_
	::FFSetCapture(g_pView->m_hWnd);
	// _xZkqqHx_iOkJjDkOiDfIiDeOiDiNiBfLiDiLiBgJiJoGjGmKiCpAiCmNiCnNiPgPiClFiClNiOjOiBgKiCpAiCgOiCgNiBeC_xHqqkZx_
	g_pView->SetAutoScroll(TRUE);
	//----- _xZkqqHx_iDiKiDjDiDeOjApMjFgAiJoGjHhAjFmPjAjEiCpAjAnNjCoI_xHqqkZx_ -----
	m_pFromObj = m_pHitMolipObj;		// _xZkqqHx_iDiKiDjDiDeOiMlDiDiCiDiKiDhGjFjEjFgJiBeC_xHqqkZx_
	m_lFromMolipId = m_lHitMolip;		// _xZkqqHx_iDiKiDjDiDeOiMlDiDiCiDiKiDhG_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
// 05.06.07 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	myGetMolipPos(m_mmptFromMolip, DWORD(this), m_pFromObj, m_lFromMolipId);
	GetMyMolipPos(m_mmptFromMolip, m_pFromObj, m_lFromMolipId);

	if (m_lFromMolipId == -1)
		// mmptOffset_xZkqqHx_iCmNiBeBiDiCiDiKiDhGiCkJiCoHiCmMiDfEiDeDiDfJjEoEjHkGjCgMiBeC_xHqqkZx_
		m_dwLinkKind = FDLM_LINK_ON_RATIO;
	else
		// mmptOffset_xZkqqHx_iCmNiBeBiDiCiDiKiDhGiCkJiCoHiCmMjBiKjBmOiNmAjFfHjCgMiBeC_xHqqkZx_
		m_dwLinkKind = FDLM_LINK_ON_COORD;
	// _xZkqqHx_jBePiJpBiDhNiDeFiDfIiNmAjFfHiCpAiLeMjIfOiBeC_xHqqkZx_
	m_mmptLast = m_mmptFromMolip;
	// _xZkqqHx_iPeDjAlDjApMjFgAiJoGjHhAiDeOiDiJiDfIiCpAiNoMjAkMiBeC_xHqqkZx_
	FCEditDraw eDraw(pDC, 0);
	//----- _xZkqqHx_iDiKiDjDiDeOjApMiCpAjFgAiJoG_xHqqkZx_ -----
	eDraw.Line(&mm2lg(m_mmptFromMolip), &mm2lg(m_mmptLast));
} // FCToolLink::StateStartLink.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateLinking
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOjCiGiPiIjHjNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::StateLinking (CDC* pDC)
{
	TRACE(_T("StateLinking\r\n"));
	// _xZkqqHx_iPeDjAlDjApMjFgAiJoGjHhAiDeOiDiJiDfIiCpAiNoMjAkMiBeC_xHqqkZx_
	FCEditDraw eDraw(pDC, 0);
	//----- _xZkqqHx_iDiKiDjDiDeOjApMiCpAiPmBiLiO_xHqqkZx_ -----
	eDraw.Line(&mm2lg(m_mmptFromMolip), &mm2lg(m_mmptLast));
	// _xZkqqHx_iDhBiDgCiDgHiDeKiBfLiDfMiDiLiCpAjGlDiMpIiCmJiClHiCoJiBeC_xHqqkZx_
	m_iCursorNew = FDPA_HIT_NONE;
//----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	// _xZkqqHx_jBeJjBpAjCiGiCmMjFjEjFgJiCmMiChJiDeJiBfLiDfPiBfLiBeC_xHqqkZx_
//	FCZOrder zOrder;
//	zOrder.PushBack(&g_pView->SelectObjVector());
//	// _xZkqqHx_iDiCiDiKiDhGiMjPiNpFiBeCiDhBiDgCiDgHiDeKiBfLiDfMiDiLiCpAjAnNjCoIiBeC_xHqqkZx_
//	DBLPoint mmptHitPos;
//	m_iCursorNew = FCLinkManager::GetHitOnMolip(m_pHitMolipObj, m_lHitMolip,
//												mmptHitPos, m_mmptMsc,
//												NULL, TRUE, TRUE, 3, 10, &zOrder,
//												myGetMolipPos, DWORD(this),
//												TRUE, FALSE);
//----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// _xZkqqHx_iDhNiDeFiDfIiNmAjFfHiCkKiDiCiDiKiDhGiCmJiDhBiDgCiDgHiClFiCmEiCkCiCoJiCkJjClCiCnHiCoJiBeC_xHqqkZx_
	m_iCursorNew = CheckHitMolip() ? FDPA_HIT_POINT_MOLIP : FDPA_HIT_NOT_MOLIP;
//----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	// _xZkqqHx_iDiCiDiKiDhGiPoDiDhBiDgCiDgHiCmMiPoKiNiHiCmNiBeBiDhNiDeFiDfIiNmAjFfHiCpAiDiCiDiKiDhGiNmAjFfHiCmJjFoCjAlDiBeC_xHqqkZx_
	if (m_iCursorNew != FDPA_HIT_NOT_MOLIP)
	//----- _xZkqqHx_iDiCiDiKiDhGiCmFiDhBiDgCiDgHiClFiClNiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_iDiCiDiKiDhGiCmMiNmAjFfHiCmNiBeB_xHqqkZx_ObjDynabase::GetMolipPos _xZkqqHx_iCmFiCmNiCmIiCkN_xHqqkZx_
		// GetMyMolipPos _xZkqqHx_iCpAiOgHiCoNiCmIiCkNiCmEiCmNiCmIiCoHiCmIiCkCiBeC_xHqqkZx_
		// _xZkqqHx_iDiCiDiKiDhGiCpAiIoKiOjOjDeJiCmJiInKjDkOiClFiCmEiCkCiCoJiPoKiNiHiCkKiCkAiCoJiClNiCnPiBeC_xHqqkZx_
// 05.10.26 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//		m_mmptCnv = m_pHitMolipObj->GetMolipPos(m_lHitMolip);
		GetMyMolipPos(m_mmptCnv, m_pHitMolipObj, m_lHitMolip);
		// _xZkqqHx_jBePiJpBiDhNiDeFiDfIiNmAjFfHiCpAiLeMjIfOiBeC_xHqqkZx_
		m_mmptLast = m_mmptCnv;
	} else
	//----- _xZkqqHx_iDiCiDiKiDhGiCmFiDhBiDgCiDgHiClFiCmIiCkJiCmBiClNiPoKiNiH_xHqqkZx_ -----
	{
		m_iCursorNew = FDPA_HIT_NONE;
		// _xZkqqHx_jBePiJpBiDhNiDeFiDfIiNmAjFfHiCpAiLeMjIfOiBeC_xHqqkZx_
		m_mmptLast = m_mmptMsc;
	}
	//----- _xZkqqHx_iDiKiDjDiDeOjApMiCpAjFgAiJoG_xHqqkZx_ -----
	eDraw.Line(&mm2lg(m_mmptFromMolip), &mm2lg(m_mmptLast));
	// _xZkqqHx_iDiLiBfLiDiJiBfLiDhNiDeFiDfIiDhNiBfLiDeKiBfLiBjFiDfIiDgFiBfLiDfOiDfIjFfMiOkGiBeC_xHqqkZx_
	BASE_CLASS::StateIdle(pDC);
} // FCToolLink::StateLinking.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateContextMenuMkl
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiBiDgKiDiFiBfLjFfMiOkG_xHqqkZx___xZkqqHx_iDiKiDjDiDeOiNoMjAkMiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.29 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::StateContextMenuMkl (CDC* pDC)
{
	TRACE(_T("FCToolLink::StateContextMenuMkl\r\n"));
	// _xZkqqHx_iDfEiDhFiDiBiDgKiDiFiBfLiCpAiDhMiDgCiDhGiDeBiDgCiDhGiBeCiDiBiDgKiDiFiBfLiPeJjHlJiOjOiCmJiDhMiDgCiDhGiDeBiDgCiDhGiPeJjHlJiDfCiDhNiDjDiDgIiCpAjBjHjAeNiBeC_xHqqkZx_
	PopupLinkMenu();
} // FCToolLink::StateContextMenuMkl.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateMklCommand
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOiNoMjAkM_xHqqkZx___xZkqqHx_iDfCiDhNiDjDiDgIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.29 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::StateMklCommand (CDC* pDC)
{
	TRACE(_T("FCToolLink::StateMklCommand\r\n"));
	// _xZkqqHx_iDiKiDjDiDeOiOoNiCpAjAnNjCoIiBeC_xHqqkZx_
	m_dwLinkKind = CommandToLinkKindBoth(m_dwCommand, m_lFromMolipId == -1, m_lHitMolip == -1);
} // FCToolLink::StateMklCommand.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateStopLink
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiKiDjDiDeOiPeJjHlJiPiIjHjNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.16 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::StateStopLink (CDC* pDC)
{
	TRACE(_T("StateStopLink\r\n"));
	// _xZkqqHx_iOkJjDkOiDfIiDeOiDiNiBfLiDiLiBgJiJoGjGmKiCpAiCmNiCnNiPgPiClFiClNiOjOiBgKiCpAiDeJiDhEiBeC_xHqqkZx_
	g_pView->SetAutoScroll(FALSE);
	// _xZkqqHx_iDhNiDeFiDfIiCmMjFnPiKgMiCpAiJpAiPjMiBeC_xHqqkZx_
	::FFReleaseCapture();
	// _xZkqqHx_iPeDjAlDjApMjFgAiJoGjHhAiDeOiDiJiDfIiCpAiNoMjAkMiBeC_xHqqkZx_
	FCEditDraw eDraw(pDC, 0);
	//----- _xZkqqHx_iDiKiDjDiDeOjApMiCpAiPmBiLiO_xHqqkZx_ -----
	eDraw.Line(&mm2lg(m_mmptFromMolip), &mm2lg(m_mmptLast));

	// _xZkqqHx_iDiKiDjDiDeOiDeBiDeFiDgHiJmCjEfMiCmIiDiCiDiKiDhGiPoDiDhBiDgCiDgHiCmMiPoKiNiHiBeC_xHqqkZx_
	if (m_iCursorNew != FDPA_HIT_NOT_MOLIP &&
		m_iCursorNew != FDPA_HIT_NONE &&
		(m_pFromObj->GetObjID() != m_pHitMolipObj->GetObjID() ||
		 m_lFromMolipId != m_lHitMolip))
	{
		// _xZkqqHx_iNmEjFgAiJoGiCkKjFeLjHhGiCmIjFjEjFgJiBeC_xHqqkZx_
		ObjDynabaseSet stRedrawObj;

		//----- _xZkqqHx_iDiKiDjDiDeOiNoMjAkM_xHqqkZx_ -----
		FCMolipRec linkFrom(m_pFromObj->GetObjID(), m_lFromMolipId);
		FCMolipRec linkTo(m_pHitMolipObj->GetObjID(), m_lHitMolip);
		WORD wLinkKindA = m_dwLinkKind & 0xffff;
		WORD wLinkKindB = m_dwLinkKind >> 16;
		// _xZkqqHx_iDfCiDhNiDjDiDgIiDfKiDgCiDfGiDiHiDjDiKeKiOgOiBeC_xHqqkZx_
		g_pDoc->SessionBegin();
		if (wLinkKindA != 0)
		{
			DWORD dwLinkId = g_pDoc->CmdAppend1Link(stRedrawObj, linkFrom, linkTo, wLinkKindA);
			// _xZkqqHx_iDiKiDjDiDeOjGoOiIpDjApMiCpAjFgAiJoGiBeC_xHqqkZx_
			if (dwLinkId != DWORD(-1)) DrawLinkLine(pDC, FALSE, NULL, dwLinkId);
		}
		if (wLinkKindB != 0)
		{
			DWORD dwLinkId = g_pDoc->CmdAppend1Link(stRedrawObj, linkTo, linkFrom, wLinkKindB);
			// _xZkqqHx_iDiKiDjDiDeOjGoOiIpDjApMiCpAjFgAiJoGiBeC_xHqqkZx_
			if (dwLinkId != DWORD(-1)) DrawLinkLine(pDC, FALSE, NULL, dwLinkId);
		}
		// _xZkqqHx_iDfCiDhNiDjDiDgIiDfKiDgCiDfGiDiHiDjDiPeJjHlJiBeC_xHqqkZx_
		g_pDoc->SessionEnd();

//----- 05.06.07 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
		// _xZkqqHx_jFnCiPfHiDgOiDjDiDgIiDiLiDiKiDfIiDgHiCpAiNmEjAnNjCoIiBeC_xHqqkZx_OnSelectObjModified _xZkqqHx_iCpAiMmEiCnBiPgPiClHiCmG_xHqqkZx_
		// _xZkqqHx_iDiCiDiKiDhGiCmMiDeJiDhEiDfKiDgCiDgHiCkKjBfDiCmEiDiKiDfKiDgCiDgHiClDiCoKiCoJiClNiCnPiBeB_xHqqkZx_ResetEditHandleList _xZkqqHx_iCmMiCnNiCpAiOmAiNhDiBeC_xHqqkZx_
		ResetEditHandleList();
//----- 05.06.07 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

		if (!stRedrawObj.empty())
		//----- _xZkqqHx_iNmEjFgAiJoGjFjEjFgJiCkKiCkAiCoJiPoKiNiH_xHqqkZx_ -----
		{
			g_pView->AppendToLastRgn(stRedrawObj);
			g_pView->SendRgnRedraw();
		}
	}
} // FCToolLink::StateStopLink.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateStartMoveMolipMark
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOiKeKiOgOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::StateStartMoveMolipMark (CDC* pDC)
{
	TRACE(_T("FCToolLink::StateStartMoveMolipMark\r\n"));
	// OnLButtonUp_xZkqqHx_iCnMiCmFiClBiCmM_xHqqkZx_Window_xZkqqHx_iCmJiDeDiDhIiDjDiDgHiBeC_xHqqkZx_
	::FFSetCapture(g_pView->m_hWnd);
	// _xZkqqHx_iOkJjDkOiDfIiDeOiDiNiBfLiDiLiBgJiJoGjGmKiCpAiCmNiCnNiPgPiClFiClNiOjOiBgKiCpAiCgOiCgNiBeC_xHqqkZx_
	g_pView->SetAutoScroll(TRUE);
	// _xZkqqHx_iDhNiDeFiDfIiImKjChFiCpAiLeMjIfOiBeC_xHqqkZx_
	m_mmptLast = m_mmptMsc;
	// _xZkqqHx_iPeDjAlDjApMjFgAiJoGjHhAiDeOiDiJiDfIiCpAiNoMjAkMiBeC_xHqqkZx_
	FCEditDraw eDraw(pDC, 0);
	// _xZkqqHx_iDiCiDiKiDhGiNmAjFfHiCmJiLoJiMgAiCpAjFgAiJoGiBeC_xHqqkZx_
	eDraw.UnselMark(mm2lg(m_mmptLast));
} // FCToolLink::StateStartMoveMolipMark.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateMovingMolipMark
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOjCiGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::StateMovingMolipMark (CDC* pDC)
{
	TRACE(_T("FCToolLink::StateMovingMolipMark\r\n"));

	// _xZkqqHx_iLiMiDiCiDiKiDhGiImKjChFiCpAiOoGjDlOiBeC_xHqqkZx_
	DBLPoint mmptOldPos;
// 05.06.07 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	myGetMolipPos(mmptOldPos, DWORD(this), m_pHitMolipObj, m_lHitMolip);
	GetMyMolipPos(mmptOldPos, m_pHitMolipObj, m_lHitMolip);
	// _xZkqqHx_iDeJiDiKiDfHiDgJiDiLiCmMiDiCiDiKiDhGiImKjChFiCpAiOoGjDlOiBeC_xHqqkZx_
	DBLPoint mmptOrigPos;
	mmptOrigPos = m_pHitMolipObj->GetMolipPos(m_lHitMolip);

	//----- _xZkqqHx_iDiCiDiKiDhGiCmMiInKjDkOiJmCjEfMjEmNiImNiCpAiNoMjAkM_xHqqkZx_ -----
	// _xZkqqHx_jFjEjFgJiDiKiDfEiDeDiDfJiDhEiDiMiBfLiDiAiBjFiDiCiDiKiDhGiImKjChFiOpMiImN_xHqqkZx_(40pixel)_xZkqqHx_iCoGiCoI_xHqqkZx_
	// _xZkqqHx_iKePiCmJiDiCiDiKiDhGiCpAiInKjDkOiCmFiCkLiCmIiCkCiCoGiCkEiCmJjAkHiMmAiClHiCoJiBeC_xHqqkZx_
	// _xZkqqHx_iDiKiDfEiDeDiDfJiDhEiDiMiBfLiDiAiKePiCmJiDiCiDiKiDhGiCkKiInKjDkOiClHiCoJiCmGiBeBiDiCiDiKiDhGiMjPiNpFiKnGjAjEiCmJ_xHqqkZx_
	// _xZkqqHx_iDhBiDgCiDgHiClFiCmIiCkNiCmIiCoJiClNiCnPiBeC_xHqqkZx_
	//---------------------------------------
	// _xZkqqHx_jFjEjFgJiCmMiDiKiDfEiDeDiDfJiDhEiDiMiBfLiDiAiCpAiOoGjDlOiBeC_xHqqkZx_
	DBLRect mmrtResizeFrame = m_pHitMolipObj->GetResizeFrame();
	// _xZkqqHx_iDeJiDiKiDfHiDgJiDiLiDiCiDiKiDhGiImKjChFiCmMiOpMiImN_xHqqkZx_40pixel_xZkqqHx_iCmMiLoJiMgAiBeC_xHqqkZx_
	DBLRect mmrtOrigPosFrame(mmptOrigPos, mmptOrigPos);
	mmrtOrigPosFrame.Extend(lg2mm(40));
	DBLRect mmrtAllowed = mmrtResizeFrame & mmrtOrigPosFrame;

	DBLPoint mmptNewPos = m_mmptMsc;

	//----- _xZkqqHx_jAkHiMmAiLoJiMgAiKePiCmMiPoKiNiHiCmNiBeBiLoJiMgAjDoAiCmJiPeDjAlD_xHqqkZx_ -----
	if (mmptNewPos.x < mmrtAllowed.left)
		mmptNewPos.x = mmrtAllowed.left;
	else
	if (mmrtAllowed.right < mmptNewPos.x)
		mmptNewPos.x = mmrtAllowed.right;
	if (mmptNewPos.y < mmrtAllowed.top)
		mmptNewPos.y = mmrtAllowed.top;
	else
	if (mmrtAllowed.bottom < mmptNewPos.y)
		mmptNewPos.y = mmrtAllowed.bottom;

	// _xZkqqHx_iDeJiDiKiDfHiDgJiDiLiDiCiDiKiDhGiImKjChFiCmMiLnPiCkNiCmIiCoHiCmOiBeBiDeJiDiKiDfHiDgJiDiLiImKjChFiCmJiIpIiCkLiKpBiClJiCoHiCoKiCoJiCoGiCkEiCmJiBeC_xHqqkZx_
	if ((mmptNewPos - mmptOrigPos).PowLen() < lg2mm(6) * lg2mm(6))
		mmptNewPos = mmptOrigPos;

	// _xZkqqHx_iPeDjAlDjApMjFgAiJoGjHhAiDeOiDiJiDfIiCpAiNoMjAkMiBeC_xHqqkZx_
	FCEditDraw eDraw(pDC, 0);
	// _xZkqqHx_jBePiJpBiDiCiDiKiDhGiNmAjFfHiCmMiLoJiMgAiCpAiPmBiLiOiBeC_xHqqkZx_
	eDraw.UnselMark(mm2lg(m_mmptLast));
	// _xZkqqHx_iDhNiDeFiDfIiImKjChFiCpAiLeMjIfOiBeC_xHqqkZx_
	m_mmptLast = mmptNewPos;
	// _xZkqqHx_iNkBiJpBiDiCiDiKiDhGiNmAjFfHiCmJiLoJiMgAiCpAjFgAiJoGiBeC_xHqqkZx_
	eDraw.UnselMark(mm2lg(m_mmptLast));
} // FCToolLink::StateMovingMolipMark.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::StateStopMoveMolipMark
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiInKjDkOiPeJjHlJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::StateStopMoveMolipMark (CDC* pDC)
{
	TRACE(_T("FCToolLink::StateStopMoveMolipMark\r\n"));
	// _xZkqqHx_iDhNiDeFiDfIiCmMjFnPiKgMiCpAiJpAiPjMiBeC_xHqqkZx_
	::FFReleaseCapture();
	// _xZkqqHx_iOkJjDkOiDfIiDeOiDiNiBfLiDiLiBgJiJoGjGmKiCpAiCmNiCnNiPgPiClFiClNiOjOiBgKiCpAiDeJiDhEiBeC_xHqqkZx_
	g_pView->SetAutoScroll(FALSE);

	//----- _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiCmJiCmCiCmIiCkKiCoJiDiKiDjDiDeOjApMiCpAjBfDiCmEiOoGjDlO_xHqqkZx_ -----
	// _xZkqqHx_iDiKiDjDiDeOjApMiCmMiDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	DWORDSet stLinkAffected;
	// _xZkqqHx_jBeJjBpAjCiGjFjEjFgJiCkJiCoHiJiEiCnBiCoJiDiKiDjDiDeOiCmMiIoKjHjHiCpAiOoGjDlOiBeC_xHqqkZx_
	DWORDVector vLinkAll;

	GetSelectableXXX(XXX_LINK, &vLinkAll);
	// _xZkqqHx_iDiKiDjDiDeOjApMiCmMiCfAiCmCiClIiCmCiCpAiDiLiBfLiDhGiBeC_xHqqkZx_
	DWORDVector::const_iterator iLs;
	for (iLs = vLinkAll.begin(); iLs != vLinkAll.end(); iLs++)
	{
		const FCLinkRec* pLinkRec = g_pDoc->LinkManager()->LinkIDtoLinkRec(*iLs);
		if ((pLinkRec->m_mlpFrom.dwObjID == m_pHitMolipObj->GetObjID() &&
			 pLinkRec->m_mlpFrom.lMolipId == m_lHitMolip) ||
			(pLinkRec->m_mlpTo.dwObjID == m_pHitMolipObj->GetObjID() &&
			 pLinkRec->m_mlpTo.lMolipId == m_lHitMolip))
		{
			stLinkAffected.insert(*iLs);
		}
	}

	//----- _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiCmJiCmCiCmIiCkKiCoJiDiKiDjDiDeOjApMiCpAiPmBiLiO_xHqqkZx_ -----
	DBLRect mmrtClient;
	g_pView->GetClientRectMM(mmrtClient);
	DWORDSet::iterator iLt;
	for (iLt = stLinkAffected.begin(); iLt != stLinkAffected.end(); iLt++)
	{
		// _xZkqqHx_iDiKiDjDiDeOjGoOiIpDjApMiCpAiPmBiLiOiBeC_xHqqkZx_
		DrawLinkLine(pDC, FALSE, &mmrtClient, *iLt);
		// _xZkqqHx_jBeJjBpAiNmPiCnNiDiKiDjDiDeOjApMiCmIiCoHiCmOiBeBjBeJjBpAiDiKiDjDiDeOjApMiCpAiPmBiLiOiBeC_xHqqkZx_
		if (IsSelectedXXX(XXX_LINK, *iLt)) DrawSelectLink(*iLt, pDC);
	}

	//----- _xZkqqHx_iLiMiDiCiDiKiDhGiImKjChFiCpAiMhGiOfKiClFiCmEiBeBiMmFjHeMiDiKiBfLiDfHiDiHiDjDiCpAjAnNjCoI_xHqqkZx_ -----
	DBLPoint mmptOldPos;
// 05.06.07 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	myGetMolipPos(mmptOldPos, DWORD(this), m_pHitMolipObj, m_lHitMolip);
	GetMyMolipPos(mmptOldPos, m_pHitMolipObj, m_lHitMolip);
	CRect lgrtMark(mm2lg(mmptOldPos), mm2lg(mmptOldPos));
	lgrtMark.InflateRect(FCEditDraw::GetSelMarkSizeHalf() + 1, FCEditDraw::GetSelMarkSizeHalf() + 1);
	g_pView->AddRgn(lgrtMark);
	//----- _xZkqqHx_iDiCiDiKiDhGiImKjChFiInKjDkOiDeJiDhEiDfKiDgCiDgHiCpAjAnNjCoI_xHqqkZx_ -----
	DBLPoint mmptOrigPos = m_pHitMolipObj->GetMolipPos(m_lHitMolip);
	DBLPoint mmptOffset = m_mmptLast - mmptOrigPos;
	if (almost0(mmptOffset))
	{
// 05.06.06 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//		myPickOffInfo(m_mpObjIdToMolipInfo, m_pHitMolipObj, m_lHitMolip);
		m_mpMolipIdToOffset.erase(pair<DWORD, long>(m_pHitMolipObj->GetObjID(), m_lHitMolip));
	} else
	{
// 05.06.06 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//		myInsertInfo(m_mpObjIdToMolipInfo, m_pHitMolipObj, m_lHitMolip, mmptOffset);
		m_mpMolipIdToOffset[pair<DWORD, long>(m_pHitMolipObj->GetObjID(), m_lHitMolip)] = mmptOffset;
	}
	//----- _xZkqqHx_iDiCiDiKiDhGiDhNiBfLiDeOiCmJiCmCiCmIiCkKiCoJiDiKiDjDiDeOjApMiCpAjFgAiJoG_xHqqkZx_ -----
	for (iLt = stLinkAffected.begin(); iLt != stLinkAffected.end(); iLt++)
	{
		// _xZkqqHx_iDiKiDjDiDeOjGoOiIpDjApMiCpAjFgAiJoGiBeC_xHqqkZx_
		DrawLinkLine(pDC, FALSE, &mmrtClient, *iLt);
		// _xZkqqHx_jBeJjBpAiNmPiCnNiDiKiDjDiDeOjApMiCmIiCoHiCmOiBeBjBeJjBpAiDiKiDjDiDeOjApMiCpAjFgAiJoGiBeC_xHqqkZx_
		if (IsSelectedXXX(XXX_LINK, *iLt)) DrawSelectLink(*iLt, pDC);
	}

//----- 05.06.07 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_jFnCiPfHiDgOiDjDiDgIiDiLiDiKiDfIiDgHiCpAiNmEjAnNjCoIiBeC_xHqqkZx_
	ResetEditHandleList();
//----- 05.06.07 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

	// _xZkqqHx_iMmFjHeMiDiKiBfLiDfHiDiHiDjDiNmEjFgAiJoGiBeCiLiMiDiCiDiKiDhGiImKjChFiCmMiPeDjAlDjApMiCpAiPmBiClHiBeC_xHqqkZx_
	g_pView->SendRgnRedraw();
} // FCToolLink::StateStopMoveMolipMark.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::ResetEditHandleList
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFnCiPfHiDgOiDjDiDgIiDiLiDiKiDfIiDgHiCpAiNmEjAnNjCoIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::ResetEditHandleList ()
{
	// _xZkqqHx_jFnCiPfHiDgOiDjDiDgIiDiLiDiKiDfIiDgHiCpAiDeOiDiKiDeBiBeC_xHqqkZx_
	ClearEditHandleList();

	// _xZkqqHx_jBeJjBpAjCiGjFjEjFgJiCkJiCoHiJiEiCnBiCoJiDiKiDjDiDeOiCmMiIoKjHjHiCpAiOoGjDlOiBeC_xHqqkZx_
	DWORDVector vLink;
	GetSelectableXXX(XXX_LINK, &vLink);
	// _xZkqqHx_iDiKiDjDiDeOjApMiCmMiCfAiCmCiClIiCmCiCpAiDiLiBfLiDhGiBeC_xHqqkZx_
	DWORDVector::const_iterator iLs;
	for (iLs = vLink.begin(); iLs != vLink.end(); iLs++)
	{
		FCPolyJoint jnt[3];
		// _xZkqqHx_iKeKiOgOjDfPiBeFiPeJjHlJjDfPiNmAjFfHiCkJiCoHjGoOiIpDjApMiCmMiDhIiDfHiDeHiLmIjApMjHhAiCmMjIeBiMiLjDfPjEhKjHpBiCpAiOoGjDlOiBeC_xHqqkZx_
		Calc3Joint(jnt, *iLs);
		// _xZkqqHx_jGoOiIpDjFgAiJoGiCmNiBeBjAhNiMgAjFgAiJoGiCmGiIoBiCkCiMlFjGkHiCmFiCkAiCoJjFeLjHhGiCmNjGlDiCkCiBeC_xHqqkZx_
		// _xZkqqHx_iClBiCmMiClNiCnPiBeBiMhGiOfKjAlIjDhIiCmMjGnKiImA_xHqqkZx_ g_->lgdPrecision _xZkqqHx_iCpAiCfCjEhLiCmJiClFiCmEiBeB_xHqqkZx_
		// _xZkqqHx_jAlIjDhIiCpAjHiOiCmGiClFjBkMjDhIiCpAiPoDiClAiCoJiBeC_xHqqkZx_
		//----- _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiClFiBeBjApMiPoDiCmMiDhBiDgCiDgHiCpAjClCiCnHiCoJ_xHqqkZx_ -----
		DBLPointVector vmmptPoly;
		// _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiBeC_xHqqkZx_
		::CalcBezier2(vmmptPoly, jnt, 3, 1, 0, 2,
					lg2mm(3 * g_->lgdPrecision), 1.0, (DBLRect*)NULL, 0);
		// _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAjDgPjIfOiBeC_xHqqkZx_ID=(-1, _xZkqqHx_iDiKiDjDiDeO_xHqqkZx_ID, 0, 0)_xZkqqHx_iBeC_xHqqkZx_
		AddEditHandle(vmmptPoly, FCHandleId(-1, long(*iLs), 0, 0));
	}

	// _xZkqqHx_iDiCiDiKiDhGiCpAjDgPjIfOiBeC_xHqqkZx_
	ObjDynabaseVector::const_iterator iObj;
	for (iObj = g_pView->SelectObjVector().begin();
		 iObj != g_pView->SelectObjVector().end(); iObj++)
	{
		long lMolipId;
		for (lMolipId = -1; lMolipId != (*iObj)->GetMolipCount(); lMolipId++)
		{
			DBLPoint mmptMolipPos;
// 05.06.07 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//			myGetMolipPos(mmptMolipPos, DWORD(this), *iObj, lMolipId);
			GetMyMolipPos(mmptMolipPos, *iObj, lMolipId);
			// _xZkqqHx_iDiCiDiKiDhGiNmAjFfHiCpAjDgPjIfOiBeC_xHqqkZx_ID=(_xZkqqHx_jFjEjFgJ_xHqqkZx_ID, _xZkqqHx_iDiCiDiKiDhG_xHqqkZx_ID, 0, 0)_xZkqqHx_iBeC_xHqqkZx_
			AddEditHandle(mmptMolipPos, FCHandleId(long((*iObj)->GetObjID()), lMolipId, 0, 0));
		}
	}
} // FCToolLink::ResetEditHandleList.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::InvalidValueXXX
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jGlDiMpIiCmIjCgMiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jGlDiMpIiCmIjCgMiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
DWORD FCToolLink::InvalidValueXXX (XXX_Link) const
{
	return DWORD(-1);
} // FCToolLink::InvalidValueXXX.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::GetSelectedXXX
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jBeJjBpAiNmPiCnNiCmM_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmMiIoKjHjHiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	vXxx	:XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmMiIoKjHjHiCpAjFnEiClHiBeCjFhDjHhGiCmMiPoKiNiHiCmN_xHqqkZx_NULL_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *			stXxx	:XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmMiIoKjHjHiCpAjFnEiClHiBeCjFhDjHhGiCmMiPoKiNiHiCmN_xHqqkZx_NULL_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiIoKjHjHiCmMjAjEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	vector/set _xZkqqHx_iCmMiCkCiClIiCoKiCmMiMgAiOkOiCmFiCoAjCgMiCpAjFnEiClJiCoJiCoGiCkEiCmJiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
long FCToolLink::GetSelectedXXX (XXX_Link, vector<DWORD>* vXxx, set<DWORD>* stXxx) const
{
	if (vXxx != NULL)
	//----- vXxx _xZkqqHx_iCpAjFnEiClHiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_jBeJjBpAiNmPiCnNiCmM_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAiOoGjDlOiBeC_xHqqkZx_
		vXxx->clear();
		FFPushBack(*vXxx, m_setSelLinkID);
	}
	if (stXxx != NULL)
	//----- stXxx _xZkqqHx_iCpAjFnEiClHiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_jBeJjBpAiNmPiCnNiCmM_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAiOoGjDlOiBeC_xHqqkZx_
		*stXxx = m_setSelLinkID;
	}
	return m_setSelLinkID.size();
} // FCToolLink::GetSelectedXXX.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::GetSelectableXXX
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jBeJjBpAiJmCjEfMiCmI_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmMiIoKjHjHiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	vXxx	:XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmMiIoKjHjHiCpAjFnEiClHiBeCjFhDjHhGiCmMiPoKiNiHiCmN_xHqqkZx_NULL_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiIoKjHjHiCmMjAjEiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
long FCToolLink::GetSelectableXXX (XXX_Link, vector<DWORD>* vXxx) const
{
	// _xZkqqHx_jBeJjBpAjCiGiCmMjFjEjFgJiCkJiCoHiJiEiCnBiCoJjBfDiCmEiCmMiDiKiDjDiDeOiCmMiPfHiNiHiCpAjFnEiClHiBeC_xHqqkZx_
	DWORDSet stLink;
	ObjDynabaseVector::const_iterator iObj;
	for (iObj = g_pView->SelectObjVector().begin();
		 iObj != g_pView->SelectObjVector().end(); iObj++)
	{
		// _xZkqqHx_iOhHjCoIiClDiCoKiClNjFjEjFgJiCkJiCoHiJiEiCnBiCoJiDiKiDjDiDeOiCmMiPfHiNiHiCpAiOoGjDlOiBeC_xHqqkZx_
		g_pDoc->LinkManager()->GetAffectedByFrom(stLink,
									 FCMolipRec((*iObj)->GetObjID(), -1));
	}
	if (vXxx != NULL)
	//----- vXxx _xZkqqHx_iCpAjFnEiClHiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_jBeJjBpAiJmCjEfMiCmI_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAiOoGjDlOiBeC_xHqqkZx_
		vXxx->clear();
		FFPushBack(*vXxx, stLink);
	}
	return stLink.size();
} // FCToolLink::GetSelectableXXX.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::SelectXXX
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClN_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAjBeJjBpAiDiKiDfIiDgHiCmJjCmHiJmBiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pXxx:XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *			pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeCjFgAiJoGiClFiCmIiCkCiPoKiNiHiCmN_xHqqkZx_NULL_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::SelectXXX (XXX_Link, DWORD xxx, CDC* pDC)
{
	// _xZkqqHx_jBeJjBpAiNmPiCnNiDiKiDjDiDeOiCmIiCoHiCmOjFjMiLeBiBeC_xHqqkZx_
	if (IsSelectedXXX(XXX_LINK, xxx)) return;
	// _xZkqqHx_jBeJjBpAiPfHiNiHiCmJjCmHiJmBiBeC_xHqqkZx_
	m_setSelLinkID.insert(xxx);
	// _xZkqqHx_jBeJjBpAiDiKiDjDiDeOjApMiCpAjFgAiJoGiBeC_xHqqkZx_
	if (pDC != NULL) DrawSelectLink(xxx, pDC);
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::SelectXXX(XXX_LINK, xxx, pDC);
} // FCToolLink::SelectXXX.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::UnselectXXX
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiCmM_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAiBeBjBeJjBpAiPpDjBnEiCkJiCoHiKeKjFpKiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pXxx:XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *			pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeCjFgAiJoGiClFiCmIiCkCiPoKiNiHiCmN_xHqqkZx_NULL_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolLink::UnselectXXX (XXX_Link, DWORD xxx, CDC* pDC)
{
	if (xxx == InvalidValueXXX(XXX_LINK))
	//----- _xZkqqHx_jBfDiCmEiCmM_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAjBeJjBpAiJpAiPjMiClHiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_jBeJjBpAjCiGiCmMiDiKiDjDiDeOjApMiCpAjBfDiCmEiPmBiLiOiBeC_xHqqkZx_
		DWORDSet::const_iterator iLs;
		for (iLs = m_setSelLinkID.begin(); iLs != m_setSelLinkID.end(); iLs++)
		{
			// _xZkqqHx_jBeJjBpAiDiKiDjDiDeOjApMiCpAiPmBiLiOiBeC_xHqqkZx_
			if (pDC != NULL) DrawSelectLink(*iLs, pDC);
		}
		// _xZkqqHx_jBeJjBpAiPfHiNiHiCpAiPmBiLiOiBeC_xHqqkZx_
		m_setSelLinkID.clear();
	} else
	//----- _xZkqqHx_iOhHjCoIiClDiCoKiClN_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAjBeJjBpAiJpAiPjMiClHiCoJiPoKiNiH_xHqqkZx_ -----
	{
		// _xZkqqHx_jBeJjBpAiNmPiCnNiDiKiDjDiDeOiCmFiCmIiCkPiCoKiCmOjFjMiLeBiBeC_xHqqkZx_
		if (!IsSelectedXXX(XXX_LINK, xxx)) return;
		// _xZkqqHx_jBeJjBpAiPfHiNiHiCkJiCoHiNoNiPjMiBeC_xHqqkZx_
		m_setSelLinkID.erase(xxx);
		// _xZkqqHx_jBeJjBpAiDiKiDjDiDeOjApMiCpAiPmBiLiOiBeC_xHqqkZx_
		if (pDC != NULL) DrawSelectLink(xxx, pDC);
	}
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::UnselectXXX(XXX_LINK, xxx, pDC);
} // FCToolLink::UnselectXXX.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::GetFrameRectXXX
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClN_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCmMiDhEiDiMiBfLiDiAiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pXxx:XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDhEiDiMiBfLiDiAiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
DBLRect FCToolLink::GetFrameRectXXX (XXX_Link, DWORD xxx) const
{
	FCPolyJoint jnt[3];
	// _xZkqqHx_iKeKiOgOjDfPiBeFiPeJjHlJjDfPiNmAjFfHiCkJiCoHjGoOiIpDjApMiCmMiDhIiDfHiDeHiLmIjApMjHhAiCmMjIeBiMiLjDfPjEhKjHpBiCpAiOoGjDlOiBeC_xHqqkZx_
	Calc3Joint(jnt, xxx);
	// _xZkqqHx_jGoOiIpDjFgAiJoGiCmNiBeBjAhNiMgAjFgAiJoGiCmGiIoBiCkCiMlFjGkHiCmFiCkAiCoJjFeLjHhGiCmNjGlDiCkCiBeC_xHqqkZx_
	// _xZkqqHx_iClBiCmMiClNiCnPiBeBiMhGiOfKjAlIjDhIiCmMjGnKiImA_xHqqkZx_ g_->lgdPrecision _xZkqqHx_iCpAiCfCjEhLiCmJiClFiCmEiBeB_xHqqkZx_
	// _xZkqqHx_jAlIjDhIiCpAjHiOiCmGiClFjBkMjDhIiCpAiPoDiClAiCoJiBeC_xHqqkZx_
	//----- _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiClFiBeBjApMiPoDiCmMiDhBiDgCiDgHiCpAjClCiCnHiCoJ_xHqqkZx_ -----
	DBLPointVector vmmptPoly;
	// _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCpAiMhGiOfKiBeC_xHqqkZx_
	::CalcBezier2(vmmptPoly, jnt, 3, 1, 0, 2,
				lg2mm(3 * g_->lgdPrecision), 1.0, (DBLRect*)NULL, 0);
	// _xZkqqHx_iDhIiDfHiDeHiLmIjApMiCmJiKePjAnKiClHiCoJiDhEiDiMiBfLiDiAiCpAiMhGiOfKiBeC_xHqqkZx_
	DBLRect mmrtFrame;
	::FFCalcFrame(mmrtFrame, vmmptPoly.size(), vmmptPoly.begin());
	return mmrtFrame;
} // FCToolLink::GetFrameRectXXX.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolLink::CheckHitNextXXX
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMiDgDiBfLiDiLiCmFjBeJjBpAiJmCjEfMiCmI_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHjCiGiCmFiBeBiDhNiDeFiDfIiImKjChFiCmJiDhBiDgCiDgH_xHqqkZx_
 *			_xZkqqHx_iClFiCmEiCkCiCoJ_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	hitXxx	:_xZkqqHx_iDhBiDgCiDgHiClFiClNiPoKiNiHiCmN_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAjFnEiClHiBeC_xHqqkZx_
 *					 NULL_xZkqqHx_iCpAiOhHjCoIiClFiClNiPoKiNiHiCmN_xHqqkZx_m_hitXxx_xZkqqHx_iCmJjAnNjCoIiClDiCoKiCoJiBeC_xHqqkZx_
 *			lastXxx	:_xZkqqHx_jBePiJpBiDhBiDgCiDgHiClFiClN_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *					 _xZkqqHx_iOhHjCoIiClFiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ InvalidValueXXX_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDhBiDgCiDgHiClFiClNiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCToolLink::CheckHitNextXXX (XXX_Link, DWORD* hitXxx, DWORD lastXxx)
{
	//----- _xZkqqHx_iDiKiDjDiDeOiMjPiNpFiDhBiDgCiDgHiLeMjIfOjHhAjFmPjAjEiCpAiPiJiKpKiJlL_xHqqkZx_ -----
	if (hitXxx == NULL)
		SetHitXXX(XXX_LINK, InvalidValueXXX(XXX_LINK));
	// _xZkqqHx_iMlLiNnNiCmMiDhNiDeFiDfIiNmAjFfHiCmJiDhBiDgCiDgHiClHiCoJjFnCiPfHiDgOiDjDiDgIiDiLiCpAjClCiCnHiCoJiBeC_xHqqkZx_
	set<FCHandleId> stIds;
	CheckHitHandle(stIds, m_mmptMsc);

	set<FCHandleId>::iterator iIds = stIds.begin();
	if (lastXxx != InvalidValueXXX(XXX_LINK))
	//----- _xZkqqHx_jBePiJpBiCmMiDhBiDgCiDgHiDiKiDjDiDeOiCkKiOhHjCoIiClDiCoKiCmEiCkCiCoJiPoKiNiH_xHqqkZx_ -----
	{
		for (; iIds != stIds.end(); iIds++)
		{
			// _xZkqqHx_iDiKiDjDiDeOjGoOiIpDjApMiCmJiDhBiDgCiDgHiClFiCmEiCkCiCmIiCkCiPoKiNiHiCmNiPeJjHlJiBeC_xHqqkZx_
			if ((*iIds).first != -1) break;
			if ((*iIds).second == lastXxx)
			//----- _xZkqqHx_jBePiJpBiCmMiDhBiDgCiDgHiDiKiDjDiDeOiCmMiImKjChFiCmJjDjOjCeCiClFiClNiPoKiNiH_xHqqkZx_ -----
			{
				// _xZkqqHx_iClLiCmMiOjPiCnGjBjHiCoJiBeC_xHqqkZx_
				iIds++;
				break;
			}
		}
	}
	// _xZkqqHx_iIoKiCmCiCoAiDhBiDgCiDgHiClFiCmEiCkCiCmIiCkCiPoKiNiHiCmN_xHqqkZx_FALSE_xZkqqHx_iBeC_xHqqkZx_
	if (iIds == stIds.end()) return FALSE;
	// _xZkqqHx_iDiKiDjDiDeOjGoOiIpDjApMiCmJiDhBiDgCiDgHiClFiCmEiCkCiCmIiCkCiPoKiNiHiCmN_xHqqkZx_FALSE_xZkqqHx_iBeC_xHqqkZx_
	if ((*iIds).first != -1) return FALSE;
	// _xZkqqHx_iDiKiDjDiDeO_xHqqkZx_ID_xZkqqHx_iCpAiOoGjDlOiBeC_xHqqkZx_
	if (hitXxx == NULL)
		SetHitXXX(XXX_LINK, DWORD((*iIds).second));
	else
		*hitXxx = DWORD((*iIds).second);
	return TRUE;
} // FCToolLink::CheckHitNextXXX.
