#include "stdafx.h"
#include "DynamicDraw.h"			// For FFGetApp.
#include "CommonDrawFrame.h"	// For GetCurChip.
#include "ObjDynabase.h"			// For FCObjDynabase.
#include "ObjChipMaster.h"		// For FCObjChipMaster.
#include "ToolChip.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_ ()
//FCToolChip	g_toolChip;

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolChip::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 FCToolChip::GetDefaultIdleCursor () const
{
	return FFGetApp()->LoadCursor(IDC_CURSOR_TOOL_CHIP);
} // FCToolChip::GetDefaultIdleCursor.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolChip::CanToolselfProperty
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgDiBfLiDiLiOkJjAgHiCmMiDhGiDiNiDhAiDgFiDeCiDfPiDeDiDeBiDiNiDePiCkKjFfMiOkGiCmFiCkLiCoJiCkJiCmHiCkEiCkJiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iCmFiCkLiCoJiPoKiNiHiCmN_xHqqkZx_ TRUE_xZkqqHx_iBeBiCmFiCkLiCmIiCkCiPoKiNiHiCmN_xHqqkZx_ FALSE _xZkqqHx_iCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.03.24 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL FCToolChip::CanToolselfProperty () const
{
	return FALSE;
} // FCToolChip::CanToolselfProperty.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolChip::GetRegisteredObject
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMjEhKjChFiOjOiCmJiBeBjEhKjChFiClHiCoJjFjEjFgJiBgJ_xHqqkZx_ID_xZkqqHx_jDgPjIfOiNmPiCnNiBgKiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	vNewObj		:_xZkqqHx_jEhKjChFiClHiCoJjFjEjFgJiCpAjFnEiClHiBeC_xHqqkZx_
 *			vLinkRec	:vNewObj_xZkqqHx_iCmJjElKiCkEjAfGiClFiCkCiDiKiDjDiDeOiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	ToolChip_xZkqqHx_iCmMjDmGjHkHjFjEjFgJiDgAiDgCiDhGiCmJjBmOiJjOiClHiCoJiClNiCnPiBeBiClBiCmMiKnGjAjEiCpAjCmHiJmBiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.14 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void FCToolChip::GetRegisteredObject (ObjDynabaseVector& vNewObj,
										FCLinkRecVector& vLinkRec)
{
	ASSERT(m_objpNew->Type() == FDOJ_CHIP_MASTER);
	vNewObj.clear();
	vLinkRec.clear();
	// _xZkqqHx_jFjEjFgJ_xHqqkZx_ID_xZkqqHx_iCpAiOoGjDlOiClFiBeBjFjEjFgJiCmJjAnNjCoIiClHiCoJiBeC_xHqqkZx_
	m_objpNew->RegisterObjID();

	FCObjChipMaster* pNewObject = (FCObjChipMaster*)m_objpNew;
	if (pNewObject->GetChipKind() == FDCM_OBJECT_CHIP)
	//----- _xZkqqHx_jDmGjHkHjFjEjFgJiDgAiDgCiDhG_xHqqkZx_ -----
	{
		pNewObject->GetLink(vLinkRec);
		vNewObj.insert(	vNewObj.end(),
						pNewObject->GetMemberArray(),
						pNewObject->GetMemberArray() + pNewObject->GetMemberSize());

		// _xZkqqHx_iDePiDiLiBfLiDhGjFjEjFgJjCiGiCmMiDiBiDjDiDgPjFjEjFgJiDgFiBfLiDhFiDiLiCpAiDeOiDiKiDeBiBeCiDePiDiLiBfLiDhGjFjEjFgJiNoNiPjMiOjOiCmJ_xHqqkZx_
		// _xZkqqHx_iIoKiPiPiCmJiNoNiPjMiClDiCoKiCoJiClBiCmGiCkKiCmIiCkCiCoGiCkEiCmJiBeC_xHqqkZx_
		pNewObject->ClearGroup();
		// _xZkqqHx_jFjEjFgJiCpA_xHqqkZx_ID_xZkqqHx_iDgFiBfLiDhFiDiLiCkJiCoHjGjFiPmBiBeC_xHqqkZx_
		pNewObject->UnregisterObjID();
//----- 02.05.29 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ (Molip_xZkqqHx_iCpA_xHqqkZx_OLE_xZkqqHx_iCmGiClFiCmEiDhJiBfLiDfIiDgHiClFiClNjAoGiCmMiDeBiDhGiDiKiCkJiCoHiBeB_xHqqkZx_Molip_xZkqqHx_iNmEjFnCiPfHiCkKiCmFiCkLiCmIiCkNiCmIiCmBiCmEiClFiCnMiCkEiBeC_xHqqkZx_)-----
//		// _xZkqqHx_jFjEjFgJiCmMiPeJjHlJiPiIjHjNiBeC_xHqqkZx_
//		pNewObject->Terminate();
//----- 02.05.29 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ (Molip_xZkqqHx_iCpA_xHqqkZx_OLE_xZkqqHx_iCmGiClFiCmEiDhJiBfLiDfIiDgHiClFiClNjAoGiCmMiDeBiDhGiDiKiCkJiCoHiBeB_xHqqkZx_Molip_xZkqqHx_iNmEjFnCiPfHiCkKiCmFiCkLiCmIiCkNiCmIiCmBiCmEiClFiCnMiCkEiBeC_xHqqkZx_)-----
		// _xZkqqHx_jFjEjFgJiCpAiNoNiPjMiBeC_xHqqkZx_
		delete m_objpNew;
		m_objpNew = NULL;
	} else
	//----- _xZkqqHx_jFkBiNiHjFjEjFgJiDgAiDgCiDhG_xHqqkZx_ -----
	{
		vNewObj.push_back(m_objpNew);
	}
} // FCToolChip::GetRegisteredObject.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCToolChip::GetReferenceObject
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiNoMjAkMjHhAiCmMiDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCpAiOoGjDlOiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	ToolChip_xZkqqHx_iCmNiBeBiDgAiDgCiDhGiCmMjBeJjBpAiPpDjBnEiCmJiCoGiCmBiCmEiInJiCmIiCoJiDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJ_xHqqkZx_
 *			_xZkqqHx_iCpAiOjNiCmCiBeC_xHqqkZx_ToolChip_xZkqqHx_iOkJjAgHiCmNjDoAjFjEiCmJiDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCpAiOjNiClNiCmIiCkCiBeC_xHqqkZx_
 *			_xZkqqHx_iClBiCmMiClNiCnPiBeBiDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCmMiDfIiDgHiDiKiBfLiDiAjDpMiPgPjHmNiPiIjHjNiCmJjBmOiJjOiClFiCmIiCkCiCkK_xHqqkZx_
 *			ToolBaseCreate_xZkqqHx_iCmMiClNiCnPiCmJiDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCpAjCpBiLjPiClFiCmIiCkPiCoKiCmOiCmIiCoHiCmIiCkCiBeC_xHqqkZx_
 *			_xZkqqHx_iClBiCmMjGlFiPiCiCpAiJpAiPmBiClHiCoJiClNiCnPiCmJiClBiCmMiKnGjAjEiCpAiNoMiCmBiClNiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.10.22 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
const FCObjDynabase* FCToolChip::GetReferenceObject ()
{
	if (FFCommonDrawFrame() != NULL && FFCommonDrawFrame()->GetCurChipId() != FD_CHIP_UNSPECIFY)
		return g_pEnv->GetChipRec(FFCommonDrawFrame()->GetCurChipId())->m_objpChipMaster;
	return NULL;
} // FCToolChip::GetReferenceObject.

