#include "stdafx.h"
#include "3UtilMath.h"		// For mmroundoff.
#include "3PolyJoint.h"	// For MFOutStream.
#include "3ObjPoly.h"		// This header.

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

#ifdef SUPER_CLASS
#undef SUPER_CLASS
#endif

#define SUPER_CLASS MC3ObjFigure

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC3ObjPoly::MC3ObjPoly
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfO_xHqqkZx_
 *************************************************************************/
MC3ObjPoly::MC3ObjPoly ()
{
	// m_mmrtResize_xZkqqHx_iCmN_xHqqkZx_double_xZkqqHx_iMfOiCpAiOgHiCkEiCmMiCmFiBeB_xHqqkZx_8_xZkqqHx_iCmMjEhLjAjEiCmFiDeBiDiJiDeDiDjDiDiBiDjDiDgHiCkKjDpMiCoJiBeC_xHqqkZx_
	// sizeof(SUPER_CLASS)_xZkqqHx_iCmNiBeB_xHqqkZx_44_xZkqqHx_iClOiCmBiClNiCmMiCmFiBeBjFoCjAlDiCmJ_xHqqkZx_4_xZkqqHx_iCpAjBkLiClHiBeC_xHqqkZx_
	ASSERT(sizeof(SUPER_CLASS) == offsetof(MC3ObjPoly, m_mmrtResize));
	// memcmp_xZkqqHx_iCmFiDeJiDhFiDfHiDeGiDeOiDgHjEoEiKhCiCpAiClHiCoJiClNiCnPiBeBiNfMjBkCjBmMiDeNiDiDiDgCiDhGiCoAjBfDiCmEiCePiCmFjGiEiCnPiCoJiBeC_xHqqkZx_
	memset(&m_mmrtResize, 0, sizeof(MC3ObjPoly) - offsetof(MC3ObjPoly, m_mmrtResize));

	// _xZkqqHx_iDiKiDjDiDeOiInKjDkOiOjOiCmMjIeBiMiLjDfPiNmEjEhKjChFjFpLjGeAiBeCjIeBiMiLjDfPiInKjDkOiCmNjGlDiCkCiBeC_xHqqkZx_
	m_byLinkMoveType = FDOP_LMTYPE_NONE;
	// _xZkqqHx_iKeKiOgOjDfPiInKjDkOiOjOiCmMjHnHjAnKjDfPiCmMiInKjDkOiMgAiOkOiBeC_xHqqkZx_
	m_byBgnMoveStyle = FDOP_LMSTYL_NONE;
	// _xZkqqHx_iPeJjHlJjDfPiInKjDkOiOjOiCmMjHnHjAnKjDfPiCmMiInKjDkOiMgAiOkOiBeC_xHqqkZx_
	m_byEndMoveStyle = FDOP_LMSTYL_NONE;
	// _xZkqqHx_iDiKiDfEiDeDiDfJiDhEiDiMiBfLiDiA_xHqqkZx_.
	m_mmrtResize = mmroundoff(DBLRect(0,0,0,0));
	// _xZkqqHx_iKeKiLmIjApMiBeC_xHqqkZx_
	m_bIsOpenPolyJoint = TRUE;
	m_lJoint = 0;
	m_pJoint = NULL;
} // MC3ObjPoly::MC3ObjPoly.

//----- 05.06.17 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC3ObjPoly::IsKindOf
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCkKiClBiCmMiMfOiBeBiIlNiCkCiCmNiClBiCmMiMfOiCmMiDfEiDhFiDeOiDiJiDfIiCmMiMfOiCkJiCmHiCkEiCkJiCpAjClCiCnHiCoJiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	nType	: _xZkqqHx_jClCiCnHiCoJiMfOiCpAiOhHjCoIiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	TRUE	: nType_xZkqqHx_iMfOiBeBiIlNiCkCiCmNiClLiCmMiDfEiDhFiDeOiDiJiDfIiCmMiPoKiNiH_xHqqkZx_
// *			FALSE	: _xZkqqHx_iClLiCkEiCmFiCmIiCkCiPoKiNiH_xHqqkZx_
// *************************************************************************/
//BOOL MC3ObjPoly::IsKindOf (FTObjectType nType) const
//{
//	if (nType == FDOJ_POLY) return TRUE;
//	return SUPER_CLASS::IsKindOf(nType);
//} // MC3ObjPoly::IsKindOf.
//----- 05.06.17 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC3ObjPoly::Type
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMjFjEjFgJiCmMiMfOiCpAjFnEiClH_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiMfO_xHqqkZx_
 *************************************************************************/
FTObjectType MC3ObjPoly::Type () const
{
	return FDOJ_POLY;
} // MC3ObjPoly::Type.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC3ObjPoly::OutStream
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCmJiPjBiCkLiPgPiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_iPjBiCkLiPgPiClFjHhAiCmM_xHqqkZx_CArchive
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.03 Fukushiro M. CArchive_xZkqqHx_iCpA_xHqqkZx_CArchive_xZkqqHx_iCmJiPeDjAlDiBeC_xHqqkZx_
 *************************************************************************/
void MC3ObjPoly::OutStream (CArchive& ar)
{
	SUPER_CLASS::OutStream(ar);
	ar << m_mmrtResize;			// _xZkqqHx_iDiKiDfEiDeDiDfJiDhEiDiMiBfLiDiA_xHqqkZx_.
	ar << m_wLinkMoveStream;	// _xZkqqHx_iDiKiDjDiDeOiInKjDkOiOjOiCmMjIeBiMiLjDfPiNmEjEhKjChFjFpLjGeAiBeC_xHqqkZx_
	ar << m_bIsOpenPolyJoint;	// _xZkqqHx_iKeKiLmIjApMiCkJiBeI_xHqqkZx_
	ar << m_lJoint;				// _xZkqqHx_jIeBiMiLjDfPiCmMjAjEiBeC_xHqqkZx_
	for (long ll = 0; ll < m_lJoint; ll++)
		MFOutStream(ar, m_pJoint[ll]);		// _xZkqqHx_jIeBiMiLjDfPiBeC_xHqqkZx_
} // MC3ObjPoly::OutStream.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC3ObjPoly::InStream
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCkJiCoHjDmHiCnNiNjOiCnOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_jDmHiCnNiNjOiCnNjHhAiCmM_xHqqkZx_CArchive
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.03 Fukushiro M. CArchive_xZkqqHx_iCpA_xHqqkZx_CArchive_xZkqqHx_iCmJiPeDjAlDiBeC_xHqqkZx_
 *************************************************************************/
void MC3ObjPoly::InStream (CArchive& ar)
{
	SUPER_CLASS::InStream(ar);
	// _xZkqqHx_iKpJjBlGiCmMjIeBiMiLjDfPiCpAiNoNiPjMiBeC_xHqqkZx_
	if (m_pJoint != NULL) delete[] m_pJoint;
	ar >> m_mmrtResize;			// _xZkqqHx_iDiKiDfEiDeDiDfJiDhEiDiMiBfLiDiA_xHqqkZx_.
	ar >> m_wLinkMoveStream;	// _xZkqqHx_iDiKiDjDiDeOiInKjDkOiOjOiCmMjIeBiMiLjDfPiNmEjEhKjChFjFpLjGeAiBeC_xHqqkZx_
	ar >> m_bIsOpenPolyJoint;	// _xZkqqHx_iKeKiLmIjApMiCkJiBeI_xHqqkZx_
	ar >> m_lJoint;				// _xZkqqHx_jIeBiMiLjDfPiCmMjAjEiBeC_xHqqkZx_
	// _xZkqqHx_jIeBiMiLjDfPiCmMjHmMiIoGiCpAjAlGjAkMiBeC_xHqqkZx_
	m_pJoint = new FCPolyJoint[m_lJoint];
	for (long ll = 0; ll < m_lJoint; ll++)
		MFInStream(ar, m_pJoint[ll]);		// _xZkqqHx_jIeBiMiLjDfPiBeC_xHqqkZx_
} // MC3ObjPoly::InStream.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC3ObjPoly::~MC3ObjPoly
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDfIiDgHiDiJiDeOiDfO_xHqqkZx_
 *************************************************************************/
MC3ObjPoly::~MC3ObjPoly ()
{
	if (m_pJoint != NULL) delete[] m_pJoint;
} // MC3ObjPoly::~MC3ObjPoly.

