#include "stdafx.h"
#include <float.h>			// For DBL_MAX.
#include "UtilCoord.h"		// For mm2lg.etc.
#include "DynamicDraw.h"	// For ID_TOOL_ANY_EDIT.
#include "DynamicDrawView.h"// For g_pView.
#include "FoundDoc.h"		// For g_pDoc.
#include "UtilMisc.h"		// For FFSetCapture.etc.
#include "ToolBaseEdit.h"	// This header.

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


/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::FCToolBaseEdit
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.12 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
FCToolBaseEdit::FCToolBaseEdit ()
				:BASE_CLASS(FDOZ_ON_EDIT)
{
} // FCToolBaseEdit::FCToolBaseEdit.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::OnSelectObjModified
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgDiBfLiDiLiCmFjBeJjBpAjCiGiCmMjFjEjFgJiCkKiBeBiDgDiBfLiDiLiImIiKePiCmMiPoKiPiKiCmFiPeDjAlDiClDiCoKiClNiPoKiNiHiCmJ_xHqqkZx_
 *			_xZkqqHx_iOmAiNhDiClDiCoKiCoJiBeCjFnCiPfHjHhAiDhNiBfLiDeOiCmMiNmEjFgAiJoGiCmMjFeLjHhGiCmNjGlDiCkCiBgJjFmKjDhCiMmEiCmOiCoKiCoJiInHiBgKiBeC_xHqqkZx_
 *			_xZkqqHx_iDgDiBfLiDiLjCiGiCmJjFjEjFgJiCmMjBkOjAkLiCpAiOmKiClFiOjNiCmBiCmEiCkCiCoJiPoKiNiHiCmNiBeBjFjEjFgJiCmJiNiHiCoNiClJiCmE_xHqqkZx_
 *			_xZkqqHx_iNfIjAfGiClHiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iDhGiDiNiDhAiDgFiDeCiCmFjFjEjFgJiCmMjBkOjAkLiCkKjFmPiNfIiClDiCoKiClNiOjOiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::OnSelectObjModified ()
{
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnSelectObjModified();
	// _xZkqqHx_jFnCiPfHiDgOiDjDiDgIiDiLiDiKiDfIiDgHiCpAiNmEjAnNjCoIiBeC_xHqqkZx_
	ResetEditHandleList();
} // FCToolBaseEdit::OnSelectObjModified.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::OnZoomChanged
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhCiDiFiBfLiCmMiDfJiBfLiDiAiCkKjFmPiNfIiClDiCoKiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.04 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::OnZoomChanged ()
{
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnZoomChanged();
	// _xZkqqHx_jFnCiPfHiDgOiDjDiDgIiDiLiDiKiDfIiDgHiCpAiNmEjAnNjCoIiBeC_xHqqkZx_
	ResetEditHandleList();
} // FCToolBaseEdit::OnZoomChanged.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::OnObjSelectChanged
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMjBeJjBpAiCkKjFmPiNfIiClDiCoKiClNiCmGiCkLiCmJiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::OnObjSelectChanged ()
{
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::OnObjSelectChanged();
	// _xZkqqHx_jFnCiPfHiDgOiDjDiDgIiDiLiDiKiDfIiDgHiCpAiNmEjAnNjCoIiBeC_xHqqkZx_
	ResetEditHandleList();
} // FCToolBaseEdit::OnObjSelectChanged.

//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::OnDraw
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	View_xZkqqHx_iCmM_xHqqkZx_OnDraw_xZkqqHx_iCkJiCoHiOmAiNhDiClDiCoKiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFfMiOkGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.07 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolBaseEdit::OnDraw (CDC* pDC)
//{
//	// FDA_xZkqqHx_iCmMiMlLiNnNiCmMiPpDjBnEiBeC_xHqqkZx_
//	switch (GetCurrentState())
//	{
//	case STATE_ENCLOSING_EDIT_OBJ:		// _xZkqqHx_jFjEjFgJjFoPiImNjCiGiBeC_xHqqkZx_
//		// _xZkqqHx_iDhEiDeIiBfLiDeKiDfIiDhEiDiMiBfLiDiAjFgAiJoGiBeC_xHqqkZx_
//		DrawCurFocusFrame(pDC);
//		break;
//	}
//	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
//	BASE_CLASS::OnDraw(pDC);
//} // FCToolBaseEdit::OnDraw.
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::Select
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMiDgDiBfLiDiLiCkKjBeJjBpAiClDiCoKiClNiCmGiCkLiBeBiDfCiBfLiDiLiClDiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	: CDC*
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::Select (CDC* pDC)
{
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::Select(pDC);
	// _xZkqqHx_iDfOiBfLiDfBiDgCiDgHjFjEjFgJiBeC_xHqqkZx_
	m_pObjTarget = NULL;
} // FCToolBaseEdit::Select.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::CanSelectTool
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMiDgDiBfLiDiLiCkKjBeJjBpAiJmCjEfMiCkJiCmHiCkEiCkJiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jBeJjBpAiJmCjEfMiCmMiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.12.22 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCToolBaseEdit::CanSelectTool () const
{
	if (!FFCanEditObject()) return FALSE;
	return TRUE;
} // FCToolBaseEdit::CanSelectTool.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::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_>	00.12.30 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCToolBaseEdit::CanHandle (const FCObjDynabase* pObj) const
{
	// pObj _xZkqqHx_iCkKiBeBjFnCiPfHiJmCjEfMiCmIiDiMiDeDiDiEiBfLiCmJjBkOiClDiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ FALSE_xZkqqHx_iBeC_xHqqkZx_
	if (!g_pDoc->CanDoOnObject(pObj, FDOZ_ON_EDIT)) return FALSE;
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	return BASE_CLASS::CanHandle(pObj);
} // FCToolBaseEdit::CanHandle.

//----- 05.06.05 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::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_>	05.06.03 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolBaseEdit::OnAppendSelectObj (CDC* pDC, FCObjDynabase* pObj)
//{
//	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
//	BASE_CLASS::OnAppendSelectObj(pDC, pObj);
//	// _xZkqqHx_jFnCiPfHiDgOiDjDiDgIiDiLiDiKiDfIiDgHiCpAiNmEjAnNjCoIiBeC_xHqqkZx_
//	ResetEditHandleList();
//} // FCToolBaseEdit::OnAppendSelectObj.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::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_>	05.06.03 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolBaseEdit::OnRemoveSelectObj (CDC* pDC, FCObjDynabase* pObj)
//{
//	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
//	BASE_CLASS::OnRemoveSelectObj(pDC, pObj);
//	// _xZkqqHx_jFnCiPfHiDgOiDjDiDgIiDiLiDiKiDfIiDgHiCpAiNmEjAnNjCoIiBeC_xHqqkZx_
//	ResetEditHandleList();
//} // FCToolBaseEdit::OnRemoveSelectObj.
//----- 05.06.05 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

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

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::TransFDA
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iMiIjCoIjAkLjHeMiMmAiDeJiBfLiDgHiDhNiDgHiDjDiCmMjBeKiInKiCpAjFnEiClHiBeC_xHqqkZx_ToolBaseEdit.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.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
int FCToolBaseEdit::TransFDA (int iState, int iEvent)
{
	// _xZkqqHx_iInKiNhDjAoGiPpDjBnEiBeC_xHqqkZx_
	int iNextState = STATE_NONE;	// _xZkqqHx_iPpDjBnEjGlDiClFiBeC_xHqqkZx_
	// FDA_xZkqqHx_iCmMiMlLiNnNiCmMiPpDjBnEiBeC_xHqqkZx_
	switch (iState)
	{
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	case STATE_IDLE:				// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
////----- 02.06.05 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ (_xZkqqHx_iDiMiDeDiDiEiBfLiCmMjFnCiPfHiMkAiCpAjBfDjFjEjGjFiPmB_xHqqkZx_->Undo->_xZkqqHx_jBlNiKhAjApMiDgDiBfLiDiLiCpAjBeJjBpA_xHqqkZx_->Redo->_xZkqqHx_jBlNiKhAjApMiCpAiNoMjAkMiClHiCoJiCmGjHiOiClPiCoJ_xHqqkZx_)-----
//		if (FFCanEditObject())
//		//----- _xZkqqHx_jFjEjFgJjFnCiPfHiJmCjEfMiCmMiPoKiNiH_xHqqkZx_ -----
//		{
////----- 02.06.05 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ (_xZkqqHx_iDiMiDeDiDiEiBfLiCmMjFnCiPfHiMkAiCpAjBfDjFjEjGjFiPmB_xHqqkZx_->Undo->_xZkqqHx_jBlNiKhAjApMiDgDiBfLiDiLiCpAjBeJjBpA_xHqqkZx_->Redo->_xZkqqHx_jBlNiKhAjApMiCpAiNoMjAkMiClHiCoJiCmGjHiOiClPiCoJ_xHqqkZx_)-----
//			switch (iEvent)
//			{
//			case WM_LBUTTONDOWN:	// _xZkqqHx_iNlGiDhLiDfOiDjDiDfPiDeFiDjDiBeC_xHqqkZx_
//				if (g_pView->SelectObjVector().empty())
//				//----- _xZkqqHx_jFjEjFgJjBeJjBpAjCiGiCmFiCmNjGlDiCkC_xHqqkZx_ -----
//				{
//					// _xZkqqHx_iDhNiDeFiDfIiPoDiCmMjFjEjFgJiCpAjClCiCnHiCoJ_xHqqkZx_.
//					m_pObjTarget = g_pDoc->GetIntersectObject(m_mmptMsc, NULL, FDOZ_ON_EDIT);
//					if (m_pObjTarget != NULL)
//						iNextState = STATE_SEL_OBJECT;	// _xZkqqHx_jFjEjFgJjBeJjBpAjCmHiJmBiBeC_xHqqkZx_
//					else
//						iNextState = STATE_START_ENCLOSE_EDIT_OBJ;	// _xZkqqHx_jFjEjFgJjFoPiImNiKeKiOgOiBeC_xHqqkZx_
//				}
////----- 05.06.06 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
//				else
//				{
//					iNextState = STATE_BEFORE_EXIT_TOOL;	// _xZkqqHx_iDgDiBfLiDiLiPeJjHlJiPiAjEpFiBeC_xHqqkZx_
//				}
////----- 05.06.06 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
//				break;
//			case WM_LBUTTONDBLCLK:	// _xZkqqHx_iNlGiDhLiDfOiDjDiDfPiDhFiDiLiDeOiDiKiDgCiDeOiBeC_xHqqkZx_
//				if (IsShift())
//				//----- _xZkqqHx_iDfGiDhEiDgHiDeMiBfLiCpAiJjPiClFiCmEiCkCiCoJ_xHqqkZx_ -----
//				{
//					// _xZkqqHx_iDhNiDeFiDfIiPoDiCmMjFjEjFgJiCpAjClCiCnHiCoJ_xHqqkZx_.
//					m_pObjTarget = g_pDoc->GetIntersectObject(m_mmptMsc, NULL, FDOZ_ON_EDIT);
//					if (m_pObjTarget != NULL)
//						iNextState = STATE_SEL_OBJECT;	// _xZkqqHx_jFjEjFgJjBeJjBpAjCmHiJmBiBeC_xHqqkZx_
//				}
//				break;
//			}
//// 02.06.05 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ (_xZkqqHx_iDiMiDeDiDiEiBfLiCmMjFnCiPfHiMkAiCpAjBfDjFjEjGjFiPmB_xHqqkZx_->Undo->_xZkqqHx_jBlNiKhAjApMiDgDiBfLiDiLiCpAjBeJjBpA_xHqqkZx_->Redo->_xZkqqHx_jBlNiKhAjApMiCpAiNoMjAkMiClHiCoJiCmGjHiOiClPiCoJ_xHqqkZx_)
//		}
//		break;
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

	case STATE_IDLE:				// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
		switch (iEvent)
		{
		case WM_LBUTTONDOWN:	// _xZkqqHx_iNlGiDhLiDfOiDjDiDfPiDeFiDjDiBeC_xHqqkZx_
		case WM_RBUTTONDOWN:	// _xZkqqHx_iJeFiDhLiDfOiDjDiDfPiDeFiDjDiBeC_xHqqkZx_
			// GetSelectedXXX_xZkqqHx_iKnGjAjEiCmNiBeBiPoKiNiHiCmJiCoGiCmBiCmEiCmNiOjOiKnEiCkKiCkJiCkJiCoJiCmMiCmF_xHqqkZx_
			// _xZkqqHx_iMmCiBfIiCmM_xHqqkZx_case_xZkqqHx_jFlGiCmMjDoAjBkEiCmJiOjNiCmBiCmEiCkNiCoJiClBiCmGiBeC_xHqqkZx_
			// _xZkqqHx_iKePjBkEiCmJiPgPiClHiCmGiBeB_xHqqkZx_WM_MOUSEMOVE_xZkqqHx_iCmJiCoAiDhBiDgCiDgHiClFiCmEiClFiCnMiCkEiBeC_xHqqkZx_
			// GetSelectedXXX_xZkqqHx_iKnGjAjEiCmFjAkHiMmAiClFiCmIiCkCiCmGiBeBjFnCiPfHiDgDiBfLiDiLiCpAjAoGiCmJjAnNjCoIiClFiCmE_xHqqkZx_
			// _xZkqqHx_iMoDiCkJiCoHjFjEjFgJiCpA_xHqqkZx_"_xZkqqHx_jEmNiImNjBeJjBpA_xHqqkZx_"_xZkqqHx_iClHiCoJiBeBiCmGiCkCiCkEjFpLjGeAiCkKiOgHiCkGiCmIiCkNiCmIiCoJiBeC_xHqqkZx_
			// _xZkqqHx_iCnMiClNiBeB_xHqqkZx_GetSelectableXXX_xZkqqHx_iKnGjAjEiCmFjAkHiMmAiClFiCmIiCkCiCmGiBeBjFjEjFgJiCkKjBlGiNnNiClFiCmIiCkCiPoKiNiHiCmJ_xHqqkZx_
			// _xZkqqHx_iDhNiDeFiDfIiDeOiDiKiDgCiDeOiCmFjFnCiPfHiDgDiBfLiDiLiCpAiJpAiPjMiClHiCoJiClBiCmGiCkKiCmFiCkLiCmIiCkCiBeC_xHqqkZx_
			if (GetSelectedXXX(XXX_EDIT_OBJ_BASE) != 0 ||
				GetSelectableXXX(XXX_EDIT_OBJ_BASE) == 0)
			//----- _xZkqqHx_jBeJjBpAiNmPiCnN_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCkKjBlGiNnNiClHiCoJiBeBiIlNiCkCiCmN_xHqqkZx_ _xZkqqHx_jBeJjBpAiJmCjEfMiCmI_xHqqkZx_XXX_xZkqqHx_iDeJiDhFiDfHiDeGiDeOiDgHiCkKjBlGiNnNiClFiCmIiCkCiPoKiNiH_xHqqkZx_ -----
			{
				// _xZkqqHx_iKpJiCmJjFnCiPfHiDgDiBfLiDiLiCmGiClFiCmEiLeAjEfMiClFiCmEiCkCiCoJiPpDjBnEiCmIiCmMiCmFiBeB_xHqqkZx_
				// _xZkqqHx_iDhNiDeFiDfIiDhLiDfOiDjDiCkKiJjPiClDiCoKiClNiCoHjFnCiPfHiPeJjHlJiCmMiPiAjEpFiCmJjDpMiCoJiBeC_xHqqkZx_
				iNextState = STATE_BEFORE_EXIT_TOOL;	// _xZkqqHx_iDgDiBfLiDiLiPeJjHlJiPiAjEpFiBeC_xHqqkZx_
			}
			break;
		}
		break;
//----- 05.06.06 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	case STATE_BEFORE_EXIT_TOOL:	// _xZkqqHx_iDgDiBfLiDiLiPeJjHlJiPiAjEpFiBeC_xHqqkZx_
		switch (iEvent)
		{
		case WM_LBUTTONUP:	// _xZkqqHx_iNlGiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
		case WM_RBUTTONUP:	// _xZkqqHx_iJeFiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
			iNextState = STATE_CHECK_EXIT_TOOL_BY_BUTTON;	// _xZkqqHx_iDhNiDeFiDfIiDhLiDfOiDjDiCmJiCoGiCoJiDgDiBfLiDiLiPeJjHlJiDgAiDeGiDgCiDeOiBeC_xHqqkZx_
			break;
		case WM_MOUSEMOVE:		// _xZkqqHx_iDhNiDeFiDfIiInKjDkOiBeC_xHqqkZx_
			iNextState = STATE_IDLE;			// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
			break;
		}
		break;
	case STATE_CHECK_EXIT_TOOL_BY_BUTTON:	// _xZkqqHx_iDhNiDeFiDfIiDhLiDfOiDjDiCmJiCoGiCoJiDgDiBfLiDiLiPeJjHlJiDgAiDeGiDgCiDeOiBeC_xHqqkZx_
	  {
		// _xZkqqHx_jCiNiInDiBeJiBeJ_xHqqkZx_ _xZkqqHx_iClBiClBiCmJjHiIiCoJiCmGiCkLiCmNiBeBjFeLiClIiDhNiDeFiDfIiDhLiDfOiDjD_xHqqkZx_Down/Up_xZkqqHx_iCmFiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiBeC_xHqqkZx_
		BOOL bIsHit = CheckHitXXX(XXX_EDIT_OBJ_BASE);
		if (IsShift() && bIsHit && CanHandle(GetHitXXX(XXX_EDIT_OBJ_BASE)))
		//----- _xZkqqHx_iDfGiDhEiDgHiDeMiBfLiCpAiJjPiClFiCmIiCkKiCoHjFjEjFgJiPoDiCmFiDhNiDeFiDfIiDeOiDiKiDgCiDeOiCmMiPoKiNiH_xHqqkZx_ -----
		{
			iNextState = STATE_SEL_UNSEL_EDIT_OBJECT;	// _xZkqqHx_jFnCiPfHjFjEjFgJiCmMjBeJjBpAjCmHiJmBiBeFiJpAiPjMiBeC_xHqqkZx_
		} else
		{
			// _xZkqqHx_jBlNiKhAjApMjFnCiPfHjCiGiCmJiBeBiJeFiDeOiDiKiDgCiDeOiCmFjIeBiMiLjDfPiCkKjCmHiJmBiCmFiCkLiCoJiCoGiCkEiCmJiBeBjFnCiPfHjCiGiCmMjFjEjFgJiPoDiCmF_xHqqkZx_
			// _xZkqqHx_iDeOiDiKiDgCiDeOiClFiCmEiCoAjFnCiPfHiCkKiJpAiPjMiClDiCoKiCmIiCkCiCoGiCkEiCmJiBeBjFjEjFgJiPoDiDeOiDiKiDgCiDeOiCmFiCkAiCoJiCkJiDgAiDeGiDgCiDeOiClHiCoJiBeC_xHqqkZx_
			BOOL bIsClickOnSelected = FALSE;
			if (bIsHit)
				bIsClickOnSelected = IsSelectedXXX(XXX_EDIT_OBJ_BASE, GetHitXXX(XXX_EDIT_OBJ_BASE));
			if (!IsShift() && !IsControl() && !bIsClickOnSelected && IsFarEnoughFromHandle(m_mmptMsc))
			//----- _xZkqqHx_iDfGiDhEiDgHiBeBiDfCiDjDiDgHiDiNiBfLiDiLiDeMiBfLiCpAiJjPiClDiClIiBeBjBeJjBpAjFjEjFgJiPoDiCmFiCmIiCkNiBeBjFnCiPfHiDgOiDjDiDgIiDiLiCkJiCoHiJjDiCkNiCmFiDhNiDeFiDfIiDeOiDiKiDgCiDeOiCmMiPoKiNiH_xHqqkZx_ -----
			{
				iNextState = STATE_EXIT_TOOL_BY_BUTTON;		// _xZkqqHx_iDhNiDeFiDfIiDhLiDfOiDjDiCmJiCoGiCoIiDgDiBfLiDiLiPeJjHlJiBeC_xHqqkZx_
			} else
			{
				iNextState = STATE_IDLE;			// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
			}
		}
		break;
	  }
	case STATE_SEL_UNSEL_EDIT_OBJECT:	// _xZkqqHx_jFnCiPfHjFjEjFgJiCmMjBeJjBpAjCmHiJmBiBeFiJpAiPjMiBeC_xHqqkZx_
		iNextState = STATE_IDLE;			// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
		break;

//----- 05.06.06 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	case STATE_SEL_OBJECT:			// _xZkqqHx_jFjEjFgJjBeJjBpAjCmHiJmBiBeC_xHqqkZx_
//		iNextState = STATE_IDLE;	// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
//		break;
//	case STATE_START_ENCLOSE_EDIT_OBJ:	// _xZkqqHx_jFjEjFgJjFoPiImNiKeKiOgOiBeC_xHqqkZx_
//		iNextState = STATE_ENCLOSING_EDIT_OBJ;		// _xZkqqHx_jFjEjFgJjFoPiImNjCiGiBeC_xHqqkZx_
//		break;
//	case STATE_ENCLOSING_EDIT_OBJ:		// _xZkqqHx_jFjEjFgJjFoPiImNjCiGiBeC_xHqqkZx_
//		switch (iEvent)
//		{
//		case WM_MOUSEMOVE:	// _xZkqqHx_iDhNiDeFiDfIiInKjDkOiBeC_xHqqkZx_
//			iNextState = STATE_ENCLOSING_EDIT_OBJ;		// _xZkqqHx_jFjEjFgJjFoPiImNjCiGiBeC_xHqqkZx_
//			break;
//		case WM_LBUTTONUP:	// _xZkqqHx_iNlGiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
//			iNextState = STATE_STOP_ENCLOSE_EDIT_OBJ;	// _xZkqqHx_jFjEjFgJjFoPiImNiPeJjHlJiBeC_xHqqkZx_
//			break;
//		}
//		break;
//	case STATE_STOP_ENCLOSE_EDIT_OBJ:	// _xZkqqHx_jFjEjFgJjFoPiImNiPeJjHlJiBeC_xHqqkZx_
//		iNextState = STATE_IDLE;	// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
//		break;
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	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;
} // FCToolBaseEdit::TransFDA.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::StateFDA
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iPpDjBnEiCmJiJjOiClGiClNiPiIjHjNiCpAiOmAiNhDiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	iState	:_xZkqqHx_iMlLiNnNiCmMiPpDjBnEiCpAiOhHjCoIiBeC_xHqqkZx_
 *			pDC		:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::StateFDA (int iState, CDC* pDC)
{
	// FDA_xZkqqHx_iCmMiOjPiCmMiPpDjBnEiBeC_xHqqkZx_
	switch (iState)
	{
//----- 05.06.06 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	case STATE_BEFORE_EXIT_TOOL:	// _xZkqqHx_iDgDiBfLiDiLiPeJjHlJiPiAjEpFiBeC_xHqqkZx_
// 05.06.10 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//		StateBeforeExitTool(pDC);
		TRACE(_T("FCToolBaseEdit::StateBeforeExitTool\r\n"));
		break;
	case STATE_CHECK_EXIT_TOOL_BY_BUTTON:		// _xZkqqHx_iDhNiDeFiDfIiDhLiDfOiDjDiCmJiCoGiCoJiDgDiBfLiDiLiPeJjHlJiDgAiDeGiDgCiDeOiBeC_xHqqkZx_
		StateCheckExitToolByButton(pDC);
		break;
	case STATE_SEL_UNSEL_EDIT_OBJECT:	// _xZkqqHx_jFnCiPfHjFjEjFgJiCmMjBeJjBpAjCmHiJmBiBeFiJpAiPjMiBeC_xHqqkZx_
		StateSelUnselEditObject(pDC);
		break;
//----- 05.06.06 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	case STATE_SEL_OBJECT:			// _xZkqqHx_jFjEjFgJjBeJjBpAjCmHiJmBiBeC_xHqqkZx_
//		StateSelObject(pDC);
//		break;
//	case STATE_START_ENCLOSE_EDIT_OBJ:	// _xZkqqHx_jFjEjFgJjFoPiImNiKeKiOgOiBeC_xHqqkZx_
//		StateStartEncloseEditObj(pDC);
//		break;
//	case STATE_ENCLOSING_EDIT_OBJ:		// _xZkqqHx_jFjEjFgJjFoPiImNjCiGiBeC_xHqqkZx_
//		StateEnclosingEditObj(pDC);
//		break;
//	case STATE_STOP_ENCLOSE_EDIT_OBJ:	// _xZkqqHx_jFjEjFgJjFoPiImNiPeJjHlJiBeC_xHqqkZx_
//		StateStopEncloseEditObj(pDC);
//		break;
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	default:
		BASE_CLASS::StateFDA(iState, pDC);
	}
} // FCToolBaseEdit::StateFDA.

//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::StateBeforeExitTool
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgDiBfLiDiLiPeJjHlJiPiIjHjNiPiAjEpFiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolBaseEdit::StateBeforeExitTool (CDC* pDC)
//{
//	TRACE(_T("FCToolBaseEdit::StateBeforeExitTool\r\n"));
//} // FCToolBaseEdit::StateBeforeExitTool.
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::StateCheckExitToolByButton
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgDiBfLiDiLiPeJjHlJiPiIjHjNiPiAjEpFiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::StateCheckExitToolByButton (CDC* pDC)
{
	TRACE(_T("FCToolBaseEdit::StateCheckExitToolByButton\r\n"));
} // FCToolBaseEdit::StateCheckExitToolByButton.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::StateSelUnselEditObject
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFnCiPfHjFjEjFgJiCmMjBeJjBpAjCmHiJmBiBeFiJpAiPjMiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.10 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::StateSelUnselEditObject (CDC* pDC)
{
	if (IsSelectedXXX(XXX_EDIT_OBJ_BASE, GetHitXXX(XXX_EDIT_OBJ_BASE)))
		UnselectXXX(XXX_EDIT_OBJ_BASE, GetHitXXX(XXX_EDIT_OBJ_BASE), pDC);
	else
		SelectXXX(XXX_EDIT_OBJ_BASE, GetHitXXX(XXX_EDIT_OBJ_BASE), pDC);
} // FCToolBaseEdit::StateSelUnselEditObject.

//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::StateSelObject
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJjBeJjBpAjCmHiJmBiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolBaseEdit::StateSelObject (CDC* pDC)
//{
//	TRACE(_T("StateSelObject\r\n"));
////----- 00.02.18 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
////	// _xZkqqHx_jBeJjBpAjFjEjFgJiPoDiCmFiCmM_xHqqkZx_Shift+D_xZkqqHx_iDeOiDiKiDgCiDeOiCmMiPoKiNiHiCmNiJlNiCoAiClFiCmIiCkCiBeC_xHqqkZx_
////	if (g_pView->IsSelectObj(m_pObjTarget)) return;
////----- 00.02.18 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
//	// _xZkqqHx_jBeJjBpAjFjEjFgJiPoDiCmFiCmM_xHqqkZx_Shift+D_xZkqqHx_iDeOiDiKiDgCiDeOiCmMiPoKiNiHiCmNjBeJjBpAiCpAiJpAiPjMiClHiCoJiBeC_xHqqkZx_
//	if (g_pView->IsSelectObj(m_pObjTarget))
//	{
//		g_pView->RemoveSelectObj(m_pObjTarget, pDC);
//		return;
//	}
////----- 00.02.18 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
//	//----- _xZkqqHx_jGkCjBeJjBpAjFjEjFgJiPoDiCmFiCmM_xHqqkZx_Shift+D_xZkqqHx_iDeOiDiKiDgCiDeOiCmMiPoKiNiH_xHqqkZx_ -----
//	g_pView->AppendSelectObj(m_pObjTarget, pDC);
//	// _xZkqqHx_jBmOiJjOiClHiCoJiDeHiDgGiDeCiDgCiDgHiDgDiBfLiDiLiCmJjFmPiNfIiClHiCoJiBeC_xHqqkZx_
//// 05.06.06 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
//	if (!CanHandle(m_pObjTarget))
//		g_pView->PostMessage(WM_COMMAND, ID_TOOL_ANY_EDIT, (LPARAM)0);
//} // FCToolBaseEdit::StateSelObject.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::StateStartEncloseEditObj
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJjFoPiImNiKeKiOgOiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.02.18 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolBaseEdit::StateStartEncloseEditObj (CDC* pDC)
//{
//	TRACE(_T("StateStartEncloseEditObj\r\n"));
//	// OnLButtonUp_xZkqqHx_iCnMiCmFiClBiCmM_xHqqkZx_Window_xZkqqHx_iCmJiDeDiDhIiDjDiDgHiBeC_xHqqkZx_
//	::FFSetCapture(g_pView->m_hWnd);
//	// _xZkqqHx_iDhEiDeIiBfLiDeKiDfIiDhEiDiMiBfLiDiAjFgAiJoGiKeKiOgOiBeC_xHqqkZx_
//	FocusFrameDrawBegin(pDC, m_mmptMsc);
//	// _xZkqqHx_iOkJjDkOiDfIiDeOiDiNiBfLiDiLiBgJiJoGjGmKiCpAiCmNiCnNiPgPiClFiClNiOjOiBgKiCpAiCgOiCgNiBeC_xHqqkZx_
//	g_pView->SetAutoScroll(TRUE);
//} // FCToolBaseEdit::StateStartEncloseEditObj.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::StateEnclosingEditObj
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJjFoPiImNjCiGiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.02.18 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolBaseEdit::StateEnclosingEditObj (CDC* pDC)
//{
//	TRACE(_T("StateEnclosingEditObj\r\n"));
//	// _xZkqqHx_iDhEiDeIiBfLiDeKiDfIiDhEiDiMiBfLiDiAjFgAiJoGiBeC_xHqqkZx_
//	FocusFrameDrawing(pDC, m_mmptMsc);
//} // FCToolBaseEdit::StateEnclosingEditObj.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::StateStopEncloseEditObj
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJjFoPiImNiPeJjHlJiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.02.18 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolBaseEdit::StateStopEncloseEditObj (CDC* pDC)
//{
//	TRACE(_T("StateStopEncloseEditObj\r\n"));
//	// _xZkqqHx_iOkJjDkOiDfIiDeOiDiNiBfLiDiLiBgJiJoGjGmKiCpAiCmNiCnNiPgPiClFiClNiOjOiBgKiCpAiDeJiDhEiBeC_xHqqkZx_
//	g_pView->SetAutoScroll(FALSE);
//	FocusFrameDrawEnd(pDC);
//	// _xZkqqHx_iDhEiDiMiBfLiDiAjCiGiCmJiKnMiCnMiCoKiCoJjFjEjFgJiCpAjCiKiPgPiBeC_xHqqkZx_
//	ObjDynabaseVector vObj;
//	g_pDoc->GetRectInObject(vObj, GetFocusFrame(), FDOZ_ON_EDIT);
//	// _xZkqqHx_jFjEjFgJiCpAjBeJjBpAiClHiCoJiBeC_xHqqkZx_
//	g_pView->AppendSelectObj(vObj, pDC);
//	::FFReleaseCapture();	// LButtonDown_xZkqqHx_iCmJiCoGiCmBiCmEiOgOiCnMiCmBiClNiDhNiDeFiDfIiCmM_xHqqkZx_
//							// _xZkqqHx_jFnPiKgMiCpAiJpAiPjMiClFiCnMiClHiBeC_xHqqkZx_
//	// _xZkqqHx_jBmOiJjOiClHiCoJiDeHiDgGiDeCiDgCiDgHiDgDiBfLiDiLiCmJjFmPiNfIiClHiCoJiBeC_xHqqkZx_
////----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
////	g_pView->PostMessage(WM_COMMAND, ID_TOOL_ANY_EDIT, (LPARAM)0);
////----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
//	ObjDynabaseVector::iterator iObj;
//	for (iObj = vObj.begin(); iObj != vObj.end(); iObj++)
//	{
//		// _xZkqqHx_iIoKiCmCiCmFiCoAiIlFiCkGiCmIiCkCjFjEjFgJiCkKiCkAiCoJiPoKiNiHiCmNiBeBiDiBiDgCiDfKiBfLiDfHiCpAiDhMiDfIiDgHiClHiCoJiBeC_xHqqkZx_
//		if (!CanHandle(*iObj))
//		{
//			g_pView->PostMessage(WM_COMMAND, ID_TOOL_ANY_EDIT, (LPARAM)0);
//			break;
//		}
//	}
////----- 05.06.06 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
//} // FCToolBaseEdit::StateStopEncloseEditObj.
//----- 05.06.10 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 05.06.06 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::ResetEditHandleList
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFnCiPfHiDgOiDjDiDgIiDiLiDiKiDfIiDgHiCpAiNmEjAnNjCoIiClHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.03 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolBaseEdit::ResetEditHandleList ()
//{
//	ClearEditHandleList();
//} // FCToolBaseEdit::ResetEditHandleList.
//----- 05.06.06 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::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.07 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::SelectXXX (XXX_EditObjDynabase, FCObjDynabase* pObj, CDC* pDC)
{
	// _xZkqqHx_jBmOiJjOiClHiCoJiDeHiDgGiDeCiDgCiDgHiDgDiBfLiDiLiCmJjFmPiNfIiClHiCoJiBeC_xHqqkZx_
//----- 06.04.08 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	if (!CanHandle(pObj))
//		g_pView->PostMessage(WM_COMMAND, ID_TOOL_ANY_EDIT, (LPARAM)0);
//----- 06.04.08 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	if (!CanHandle(pObj))
	{
		// _xZkqqHx_iOjPiCmMiDgDiBfLiDiLiCmJjFjEjFgJjFnCiPfHiDgDiBfLiDiLiCpAiOhHjCoIiBeC_xHqqkZx_
		SetNextTool(ID_TOOL_ANY_EDIT);
		// _xZkqqHx_iDiNiDgCiDeOiCpAiJpAiPjMiClFiCmEiCkIiCkNiBeC_xHqqkZx_
		SetLockStatus(FALSE);
		// _xZkqqHx_iDgDiBfLiDiLjFmPiNfIiBeC_xHqqkZx_
		EndOfSession();
	}
//----- 06.04.08 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::SelectXXX(XXX_EDIT_OBJ_BASE, pObj, pDC);
} // FCToolBaseEdit::SelectXXX.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::ClearEditHandleList
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFnCiPfHiDgOiDjDiDgIiDiLiDiKiDfIiDgHiCpAiDeOiDiKiDeBiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.07 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::ClearEditHandleList ()
{
	m_mmptLastCheckHitPoint.SetPoint(DBL_MAX, DBL_MAX);
	m_stLastHitIds.clear();
	m_vPointHandle.clear();
	m_vLineHandle.clear();
	m_vRectHandle.clear();
	m_vPolylineHandle.clear();
} // FCToolBaseEdit::ClearEditHandleList.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::AddEditHandle
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhMiDeDiDjDiDgHjFnCiPfHiDgOiDjDiDgIiDiLiCpAiKmEiOiLiDiKiDfIiDgHiCmJjCmHiJmBiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	mmpt	:_xZkqqHx_iDhMiDeDiDjDiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *			ids		:_xZkqqHx_iClBiCmMiDgOiDjDiDgIiDiLiCmM_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.03 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::AddEditHandle (const DBLPoint& mmpt, const FCHandleId& ids)
{
	m_vPointHandle.push_back(FCHandleRec<DBLPoint>(mmpt, ids));
} // FCToolBaseEdit::AddEditHandle.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::AddEditHandle
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jApMjFkKjFnCiPfHiDgOiDjDiDgIiDiLiCpAiKmEiOiLiDiKiDfIiDgHiCmJjCmHiJmBiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	mmsl	:_xZkqqHx_jApMjFkKiCpAiOhHjCoIiBeC_xHqqkZx_
 *			ids		:_xZkqqHx_iClBiCmMiDgOiDjDiDgIiDiLiCmM_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.03 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::AddEditHandle (const DBLShortLine& mmsl, const FCHandleId& ids)
{
	if (almosteq(mmsl.pt0, mmsl.pt1))
		AddEditHandle(mmsl.pt0, ids);
	else
		m_vLineHandle.push_back(FCHandleRec<DBLShortLine>(mmsl, ids));
} // FCToolBaseEdit::AddEditHandle.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::AddEditHandle
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iLoJiMgAjFnCiPfHiDgOiDjDiDgIiDiLiCpAiKmEiOiLiDiKiDfIiDgHiCmJjCmHiJmBiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	mmrt	:_xZkqqHx_iLoJiMgAiCpAiOhHjCoIiBeC_xHqqkZx_
 *			ids		:_xZkqqHx_iClBiCmMiDgOiDjDiDgIiDiLiCmM_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.03 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::AddEditHandle (const DBLRect& mmrt, const FCHandleId& ids)
{
	m_vRectHandle.push_back(FCHandleRec<DBLRect>(mmrt, ids));
} // FCToolBaseEdit::AddEditHandle.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::AddEditHandle
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhMiDiKiDiJiDeDiDjDjFnCiPfHiDgOiDjDiDgIiDiLiCpAiKmEiOiLiDiKiDfIiDgHiCmJjCmHiJmBiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	vmmptPoly	:_xZkqqHx_iDhMiDiKiDiJiDeDiDjDjEhKjHpBiCpAiOhHjCoIiBeC_xHqqkZx_
 *			ids		:_xZkqqHx_iClBiCmMiDgOiDjDiDgIiDiLiCmM_xHqqkZx_ID_xZkqqHx_iCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::AddEditHandle (const DBLPointVector& vmmptPoly, const FCHandleId& ids)
{
	m_vPolylineHandle.push_back(FCHandleRec<DBLPointVector>(vmmptPoly, ids));
} // FCToolBaseEdit::AddEditHandle.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::CheckHitHandle
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iKmEiOiLiDiKiDfIiDgHiCmJjDgPjIfOiClDiCoKiClNjFnCiPfHiDgOiDjDiDgIiDiLiCpAjClCiCnHiCmEiBeBiOhHjCoIiClDiCoKiClNiNmAjFfHiCmJ_xHqqkZx_
 *			_xZkqqHx_iDhBiDgCiDgHiClHiCoJjFnCiPfHiDgOiDjDiDgIiDiLiCpAjBfDiCmEiPfHiCnPiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	stIds	:_xZkqqHx_iDhBiDgCiDgHiClFiClNjFnCiPfHiDgOiDjDiDgIiDiLiCmM_xHqqkZx_ID_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *			mmptMsc	:_xZkqqHx_iDhBiDgCiDgHiCpAjClCiCnHiCoJiNmAjFfHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	_xZkqqHx_iKoOiPiAjCgM_xHqqkZx_ M = lg2mm(FD_HIT_TEST_MARGIN) _xZkqqHx_iCmGiClHiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iDhMiDeDiDjDiDgHiCmMiPoKiNiHiCmNiBeBiDhMiDeDiDjDiDgHiCkJiCoHiCmMiLjHjHkDiCkK_xHqqkZx_ M _xZkqqHx_jGkCjGjOiCmMiPoKiNiHiCkK_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.03 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolBaseEdit::CheckHitHandle (set<FCHandleId>& stIds, const DBLPoint& mmptMsc)
{
// 06.12.26 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	if (m_mmptLastCheckHitPoint != mmptMsc)
	if (!abouteq(m_mmptLastCheckHitPoint, mmptMsc))
	//----- _xZkqqHx_jBePiJpBiCmMjClCiNlIiCmGiDhNiDeFiDfIiNmAjFfHiCkKiInJiCmIiCoJiPoKiNiH_xHqqkZx_ -----
	{
		m_mmptLastCheckHitPoint = mmptMsc;
		m_stLastHitIds.clear();

		const mmetol mmMargin = lg2mm(FD_HIT_TEST_MARGIN);
		const double dMargin2 = POW2(mmMargin);

		vector< FCHandleRec<DBLPoint> >::const_iterator iPt;
		for (iPt = m_vPointHandle.begin(); iPt != m_vPointHandle.end(); iPt++)
		{
			if (::HitTest((*iPt).m_area, mmptMsc, mmMargin, mmMargin))
				m_stLastHitIds.insert((*iPt).m_ids);
		}

		vector< FCHandleRec<DBLShortLine> >::const_iterator iSl;
		for (iSl = m_vLineHandle.begin(); iSl != m_vLineHandle.end(); iSl++)
		{
			DBLRect mmrt((*iSl).m_area.pt0, (*iSl).m_area.pt1);
			mmrt.NormalizeRect();
			if ((*iSl).m_area.IsVertical())
			//----- _xZkqqHx_jAiCjClMjApMjFkKiCmMiPoKiNiH_xHqqkZx_ -----
			{
				mmrt.Extend(mmMargin, 0.0);
				if (mmrt.PtInRect(mmptMsc))
					m_stLastHitIds.insert((*iSl).m_ids);
			} else
			if ((*iSl).m_area.IsHorizontal())
			//----- _xZkqqHx_jAiFjFlNjApMjFkKiCmMiPoKiNiH_xHqqkZx_ -----
			{
				mmrt.Extend(0.0, mmMargin);
				if (mmrt.PtInRect(mmptMsc))
					m_stLastHitIds.insert((*iSl).m_ids);
			} else
			//----- _xZkqqHx_iOmOjApMiCmMiPoKiNiH_xHqqkZx_ -----
			{
				mmrt.Extend(mmMargin);
				if (mmrt.PtInRect(mmptMsc))
				//----- _xZkqqHx_jApMjFkKiCpAiImNiCkEiLoJiMgAiCmMjCiGiCmJiDhMiDeDiDjDiDgHiCkKiCkAiCoJiPoKiNiH_xHqqkZx_ -----
				{
					DBLPoint mmptS;
					if (CalcPowDistance(mmptS, (*iSl).m_area.pt0, (*iSl).m_area.pt1, mmptMsc) < dMargin2)
					//----- _xZkqqHx_jApMjFkKiCmGiDhMiDeDiDjDiDgHiCmMiLjHjHkDiCkKiLeLjCoIjCgMjGkCjGjOiCmMiPoKiNiH_xHqqkZx_ -----
					{
// 06.12.26 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//						if (mmptS != (*iSl).m_area.pt0 && mmptS != (*iSl).m_area.pt1)
						if (!abouteq(mmptS, (*iSl).m_area.pt0) && !abouteq(mmptS, (*iSl).m_area.pt1))
						//----- _xZkqqHx_iDhMiDeDiDjDiDgHiCkJiCoHjApMjFkKiCmJjAeMiCmOiClHjAiCjApMiCkKiPeJjCfLiImIiKePiCmJiCkAiCoJiPoKiNiH_xHqqkZx_ -----
						{
							m_stLastHitIds.insert((*iSl).m_ids);
						}
					}
				}
			}
		}

		vector< FCHandleRec<DBLRect> >::const_iterator iRt;
		for (iRt = m_vRectHandle.begin(); iRt != m_vRectHandle.end(); iRt++)
		{
			if ((*iRt).m_area.PtInRect(mmptMsc))
				m_stLastHitIds.insert((*iRt).m_ids);
		}

		vector< FCHandleRec<DBLPointVector> >::const_iterator iPv;
		for (iPv = m_vPolylineHandle.begin(); iPv != m_vPolylineHandle.end(); iPv++)
		{
			const DBLPointVector& vPoint = (*iPv).m_area;
			long lC;
			for (lC = 1; lC != vPoint.size(); lC++)
			{
				// _xZkqqHx_iNfMjAkMiClHiCoJjApMjFkKiCpAiIoKiCmCjAnIiCoIiPgPiClHiBeC_xHqqkZx_
				DBLRect mmrt(vPoint[lC - 1], vPoint[lC]);
				mmrt.NormalizeRect();
				mmrt.Extend(mmMargin);
				if (mmrt.PtInRect(mmptMsc))
				//----- _xZkqqHx_jApMjFkKiCpAiImNiCkEiLoJiMgAiCmMjCiGiCmJiDhMiDeDiDjDiDgHiCkKiCkAiCoJiPoKiNiH_xHqqkZx_ -----
				{
					if (CalcPowDistance(DBLPoint(), vPoint[lC - 1], vPoint[lC], mmptMsc) < dMargin2)
					//----- _xZkqqHx_jApMjFkKiCmGiDhMiDeDiDjDiDgHiCmMiLjHjHkDiCkKiLeLjCoIjCgMjGkCjGjOiCmMiPoKiNiH_xHqqkZx_ -----
					{
						m_stLastHitIds.insert((*iPv).m_ids);
						// _xZkqqHx_iClBiCmMiDhMiDiKiDiJiDeDiDjDiCmNiCoAiCkEjClCiCnHiCoJjFeLjHhGiCkKiCmIiCkCiBeC_xHqqkZx_
						break;
					}
				}
			}
		}
	}
	stIds = m_stLastHitIds;
} // FCToolBaseEdit::CheckHitHandle.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolBaseEdit::IsFarEnoughFromHandle
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiClDiCoKiClNiNmAjFfHiCkKiBeBiKmEiOiLiDiKiDfIiDgHiCmJjDgPjIfOiClDiCoKiClNjFnCiPfHiDgOiDjDiDgIiDiLiCmMjBfDiCmEiCkJiCoH_xHqqkZx_
 *			_xZkqqHx_iLjHjHkDiCkKiJjDiCkCiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	mmptMsc	:_xZkqqHx_jClCiCnHiCoJiNmAjFfHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iOhHjCoIiNmAjFfHiCmGjFnCiPfHiDgOiDjDiDgIiDiLiCmMiLjHjHkDiCkKiJjDiCkCiPoKiNiHiCmN_xHqqkZx_TRUE_xZkqqHx_iBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.06.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCToolBaseEdit::IsFarEnoughFromHandle (const DBLPoint& mmptMsc) const
{
	const mmetol mmFarEnough = lg2mm(FD_FAR_FROM_HANDLE);
	const double dFarEnough2 = POW2(mmFarEnough);
	vector< FCHandleRec<DBLPoint> >::const_iterator iPt;
	for (iPt = m_vPointHandle.begin(); iPt != m_vPointHandle.end(); iPt++)
	{
		if (::HitTest((*iPt).m_area, mmptMsc, mmFarEnough, mmFarEnough))
		//----- _xZkqqHx_iNmAjFfHiCkK_xHqqkZx_ mmFarEnough _xZkqqHx_iCmMiLjHjHkDiCmFiImNiCkEiLoJiMgAiCmMjDoAjBkEiCmJiCkAiCoJiPoKiNiH_xHqqkZx_ -----
		{
			// _xZkqqHx_iNfIiCmJjAlDiKgNiCmJiLjHjHkDiCpAjBkKiCoJiBeC_xHqqkZx_
			double dPowLen = ((*iPt).m_area - mmptMsc).PowLen();
			if (dPowLen < dFarEnough2) return FALSE;
		}
	}

	vector< FCHandleRec<DBLShortLine> >::const_iterator iSl;
	for (iSl = m_vLineHandle.begin(); iSl != m_vLineHandle.end(); iSl++)
	{
		DBLRect mmrt((*iSl).m_area.pt0, (*iSl).m_area.pt1);
		mmrt.NormalizeRect();
		mmrt.Extend(mmFarEnough);
		if (mmrt.PtInRect(mmptMsc))
		//----- _xZkqqHx_jApMjFkKiCpAiImNiCkEiLoJiMgAiCmMjCiGiCmJiDhMiDeDiDjDiDgHiCkKiCkAiCoJiPoKiNiH_xHqqkZx_ -----
		{
			double dPowLen = CalcPowDistance(DBLPoint(), (*iSl).m_area.pt0, (*iSl).m_area.pt1, mmptMsc);
			if (dPowLen < dFarEnough2) return FALSE;
		}
	}

	vector< FCHandleRec<DBLRect> >::const_iterator iRt;
	for (iRt = m_vRectHandle.begin(); iRt != m_vRectHandle.end(); iRt++)
	{
		if ((*iRt).m_area.PtInRect(mmptMsc))
		{
			return FALSE;
		} else
		{
			DBLRect mmrt((*iRt).m_area);
			mmrt.Extend(mmFarEnough);
			if (mmrt.PtInRect(mmptMsc))
			//----- mmFarEnough _xZkqqHx_iKgHjCkDiClFiClNiLoJiMgAiCmMjCiGiCmJiDhMiDeDiDjDiDgHiCkKiCkAiCoJiPoKiNiH_xHqqkZx_ -----
			{
				DBLPoint mmpta[5];
				(*iRt).m_area.Get5Polygon(mmpta);
				double dPowLen = CalcPowDistance(DBLPoint(), mmpta, 5, mmptMsc);
				if (dPowLen < dFarEnough2) return FALSE;
			}
		}
	}

	vector< FCHandleRec<DBLPointVector> >::const_iterator iPv;
	for (iPv = m_vPolylineHandle.begin(); iPv != m_vPolylineHandle.end(); iPv++)
	{
		const DBLPointVector& vPoint = (*iPv).m_area;
		long lC;
		for (lC = 1; lC != vPoint.size(); lC++)
		{
			// _xZkqqHx_iNfMjAkMiClHiCoJjApMjFkKiCpAiIoKiCmCjAnIiCoIiPgPiClHiBeC_xHqqkZx_
			DBLRect mmrt(vPoint[lC - 1], vPoint[lC]);
			mmrt.NormalizeRect();
			mmrt.Extend(mmFarEnough);
			if (mmrt.PtInRect(mmptMsc))
			//----- _xZkqqHx_jApMjFkKiCpAiImNiCkEiLoJiMgAiCmMjCiGiCmJiDhMiDeDiDjDiDgHiCkKiCkAiCoJiPoKiNiH_xHqqkZx_ -----
			{
				double dPowLen = CalcPowDistance(DBLPoint(), vPoint[lC - 1], vPoint[lC], mmptMsc);
				if (dPowLen < dFarEnough2) return FALSE;
			}
		}
	}
	return TRUE;
} // FCToolBaseEdit::IsFarEnoughFromHandle.

