#include "stdafx.h"
#include "DynamicDraw.h"		// For FFGetApp.
#include "FoundDoc.h"			// For g_pDoc.
#include "DynamicDrawView.h"	// For g_pView.
// 05.08.25 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//#include "UtilGraph.h"			// For FCEditDraw.
// 05.08.25 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//#include "UtilMisc.h"			// For FFSetCapture.etc.
#include "ObjPoint.h"			// For FCObjPoint.
// 05.08.25 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//#include "LinkManager.h"		// For FDPA_HIT_NOT_MOLIP.
#include "ToolPoint.h"			// This header.

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

//----- 05.08.25 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolPoint::FCToolPoint
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfO_xHqqkZx_.
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	98.11.16 Fukushiro M. _xZkqqHx_iDfCiDiBiDjDiDgHiNoMjAkM_xHqqkZx_
// *************************************************************************/
//FCToolPoint::FCToolPoint ()
//{
//} // FCToolPoint::FCToolPoint.
//----- 05.08.25 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 05.08.25 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolPoint::CreateInsideObject
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jDoAjFjEjFjEjFgJiCpAiNoMjAkMiClHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jDoAjFjEjFjEjFgJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.07.15 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//FCObjDynabase* FCToolPoint::CreateInsideObject ()
//{
//	return new FCObjPoint();
//} // FCToolPoint::CreateInsideObject.
//----- 05.08.25 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 05.08.25 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolPoint::Select
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMiDgDiBfLiDiLiCkKjBeJjBpAiClDiCoKiClNiCmGiCkLiBeBiDfCiBfLiDiLiClDiCoKiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolPoint::Select (CDC* pDC)
//{
//	// Superclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
//	BASE_CLASS::Select(pDC);
//	// _xZkqqHx_iMlLiNnNiCmMiDeKiBfLiDfMiDiLiPoOjFpBiBeCiClBiCoKiCmFiDhNiDeFiDfIiInKjDkOiOjOiCmJiDhNiBfLiDeOjFfMiOkGiClDiCoKiCoJiBeC_xHqqkZx_
//	m_iCursorNew = FDPA_HIT_NOT_MOLIP;
//} // FCToolPoint::Select.
//----- 05.08.25 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 05.08.25 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolPoint::CanSelectTool
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMiDgDiBfLiDiLiCkKjBeJjBpAiJmCjEfMiCkJiCmHiCkEiCkJiCpAjFnEiClHiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jBeJjBpAiJmCjEfMiCmMiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	02.06.06 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//BOOL FCToolPoint::CanSelectTool () const
//{
//	// _xZkqqHx_jFjEjFgJiCkKjFnCiPfHiJmCjEfMiCmFiCmNjGlDiCkCiPoKiNiHiCmNjFhDiJmCiBeC_xHqqkZx_
//	if (!FFCanEditObject()) return FALSE;
//	return TRUE;
//} // FCToolPoint::CanSelectTool.
//----- 05.08.25 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

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

//----- 05.08.25 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolPoint::TransFDA
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iMiIjCoIjAkLjHeMiMmAiDeJiBfLiDgHiDhNiDgHiDjDiCmMjBeKiInKiCpAjFnEiClHiBeC_xHqqkZx_ToolPoint.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.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//int FCToolPoint::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_
//		// FFCanCreateObject()_xZkqqHx_iCpAjClCiCnHiCmIiCkCiCmGiBeBiDiMiDeDiDiEiBfLiCmMjFnCiPfHiMkAiCpAjBfDjFjEjGjFiPmB_xHqqkZx_->Undo->_xZkqqHx_jBlNiKhAjApMiDgDiBfLiDiLiCpAjBeJjBpA_xHqqkZx_->Redo->_xZkqqHx_jBlNiKhAjApMiCpAiNoMjAkMiClHiCoJiCmGjHiOiClPiCoJiBeC_xHqqkZx_
//		if (FFCanCreateObject())
//		//----- _xZkqqHx_jFjEjFgJiNoMjAkMiJmCjEfMiCmMiPoKiNiH_xHqqkZx_ -----
//		{
//			switch (iEvent)
//			{
//			case WM_LBUTTONDOWN:	// _xZkqqHx_iNlGiDhLiDfOiDjDiDfPiDeFiDjDiBeC_xHqqkZx_
//				iNextState = STATE_START_PUT_POINT;	// _xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIiKeKiOgOiBeC_xHqqkZx_
//				break;
//			}
//		}
//		break;
//	case STATE_START_PUT_POINT:	// _xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIiKeKiOgOiBeC_xHqqkZx_
//		iNextState = STATE_PRE_PUT_POINT;	// _xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIjBePiBeC_xHqqkZx_
//		break;
//	case STATE_PRE_PUT_POINT:	// _xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIjBePiBeC_xHqqkZx_
//		switch (iEvent)
//		{
//		case WM_MOUSEMOVE:	// _xZkqqHx_iDhNiDeFiDfIiInKjDkOiBeC_xHqqkZx_
//			iNextState = STATE_PRE_PUT_POINT;	// _xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIjBePiBeC_xHqqkZx_
//			break;
//		case WM_LBUTTONUP:	// _xZkqqHx_iNlGiDhLiDfOiDjDiDeBiDgCiDhGiBeC_xHqqkZx_
//			iNextState = STATE_PUT_POINT;		// _xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIiBeC_xHqqkZx_
//			break;
//		}
//		break;
//	case STATE_PUT_POINT:		// _xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIiBeC_xHqqkZx_
//		iNextState = STATE_IDLE;	// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
//		break;
//	}
//	// _xZkqqHx_iPpDjBnEjBeKiInKjGlDiClFiCmMiPoKiNiHiCmNiDfIiBfLiDhAiBfLiDeOiDiJiDfIiCmMiPpDjBnEjBeKiInKiCpAiMmEiCnBiPgPiClHiBeC_xHqqkZx_
//	if (iNextState == STATE_NONE)
//		iNextState = BASE_CLASS::TransFDA(iState, iEvent);
//	return iNextState;
//} // FCToolPoint::TransFDA.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolPoint::StateFDA
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iPpDjBnEiCmJiJjOiClGiClNiPiIjHjNiCpAiOmAiNhDiClHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	iState	:_xZkqqHx_iMlLiNnNiCmMiPpDjBnEiCpAiOhHjCoIiBeC_xHqqkZx_
// *			pDC		:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolPoint::StateFDA (int iState, CDC* pDC)
//{
//	// FDA_xZkqqHx_iCmMiOjPiCmMiPpDjBnEiBeC_xHqqkZx_
//	switch (iState)
//	{
//	case STATE_START_PUT_POINT:	// _xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIiKeKiOgOiBeC_xHqqkZx_
//		StateStartPutPoint(pDC);
//		break;
//	case STATE_PRE_PUT_POINT:	// _xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIjBePiBeC_xHqqkZx_
//		StatePrePutPoint(pDC);
//		break;
//	case STATE_PUT_POINT:		// _xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIiBeC_xHqqkZx_
//		StatePutPoint(pDC);
//		break;
//	default:
//		BASE_CLASS::StateFDA(iState, pDC);
//	}
//} // FCToolPoint::StateFDA.
//
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolPoint::StateStartPutPoint
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIiKeKiOgOiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolPoint::StateStartPutPoint (CDC* pDC)
//{
//	TRACE(_T("StateStartPutPoint\r\n"));
//	// OnLButtonUp_xZkqqHx_iCnMiCmFiClBiCmM_xHqqkZx_Window_xZkqqHx_iCmJiDeDiDhIiDjDiDgHiBeC_xHqqkZx_
//	::FFSetCapture(g_pView->m_hWnd);
//} // FCToolPoint::StateStartPutPoint.
//----- 05.08.25 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 05.08.25 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolPoint::StatePrePutObject
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIjBePiPiIjHjNiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//void FCToolPoint::StatePrePutObject (CDC* pDC)
//{
//	TRACE(_T("StatePrePutObject\r\n"));
//	StateIdle(pDC);
//} // FCToolPoint::StatePrePutObject.
//----- 05.08.25 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolPoint::StatePutObject
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDhMiDeDiDjDiDgHjAnNjCoIiPiIjHjNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	pDC	:_xZkqqHx_jFgAiJoGjHhAiDgGiDgPiDeDiDfIiDfCiDjDiDgFiDeMiDfIiDgHiCpAiOhHjCoIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.20 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolPoint::StatePutObject (CDC* pDC)
{
	TRACE(_T("StatePutObject\r\n"));
	// _xZkqqHx_jFjEjFgJiCpAiNoMjAkMiBeC_xHqqkZx_
// 05.08.25 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	FCObjPoint* pObj = reinterpret_cast<FCObjPoint*>(GetInsideObject()->Duplicate());
	FCObjPoint* pObj = new FCObjPoint();
	// _xZkqqHx_iDhMiDeDiDjDiDgHjFjEjFgJiCmJiNmAjFfHiCpAjAnNjCoIiBeC_xHqqkZx_
	pObj->SetPoint(m_mmptCnv);
	pObj->CalcResizeFrame();
	// _xZkqqHx_iLeMjIfOiDfKiDgCiDfGiDiHiDjDiKeKiOgOiBeC_xHqqkZx_
	g_pDoc->SessionBegin();
	// _xZkqqHx_jFjEjFgJ_xHqqkZx_ID_xZkqqHx_iCpAiOoGjDlOiClFiBeBjFjEjFgJiCmJjAnNjCoIiClHiCoJiBeC_xHqqkZx_
	pObj->RegisterObjID();
	// _xZkqqHx_jFjEjFgJjAlGjAkMiCmMiLeMjIfOiBeC_xHqqkZx_
	g_pDoc->MulticmdCreate1Obj(pObj, g_pDoc->GetCurrentSheetId(), LAST_LAYER_ORDER);
	// _xZkqqHx_iLeMjIfOiDfKiDgCiDfGiDiHiDjDiCmMiPeJjHlJiBeC_xHqqkZx_
	g_pDoc->SessionEnd();
	// _xZkqqHx_jBeJjBpAjCiGiCmMjFjEjFgJiCpAiJpAiPjMiBeC_xHqqkZx_
	g_pView->ClearSelectObj(pDC);
	// _xZkqqHx_jAfGiClFiCkCjFjEjFgJiCpAjBeJjBpAiPpDjBnEiCmJiBeC_xHqqkZx_
	g_pView->AppendSelectObj(pObj);
	// _xZkqqHx_jFjEjFgJiCpAjFgAiJoGiClHiCoJiBeC_xHqqkZx_
	g_pView->AddRgn(pObj);
	g_pView->SendRgnRedraw();

//----- 05.08.25 Fukushiro M. _xZkqqHx_jFmPiNfIjBeP_xHqqkZx_ ()-----
//	// _xZkqqHx_iDgDiBfLiDiLiDfKiDgCiDfGiDiHiDjDiPeJjHlJiBeC_xHqqkZx_
//	EndOfSession();
//	::FFReleaseCapture();	// _xZkqqHx_iDhNiDeFiDfIiCmMiDgIiDiJiDgCiDePiCmMiKeKiOgOiCmJiCoGiCmBiCmEiOgOiCnMiCmBiClNiDhNiDeFiDfIiCmM_xHqqkZx_
//							// _xZkqqHx_jFnPiKgMiCpAiJpAiPjMiClFiCnMiClHiBeC_xHqqkZx_
//----- 05.08.25 Fukushiro M. _xZkqqHx_jFmPiNfIiMoD_xHqqkZx_ ()-----
	// Baseclass_xZkqqHx_iKnGjAjEiOmAiNhDiBeC_xHqqkZx_
	BASE_CLASS::StatePutObject(pDC);
//----- 05.08.25 Fukushiro M. _xZkqqHx_jFmPiNfIiPeJ_xHqqkZx_ ()-----
} // FCToolPoint::StatePutObject.

