#include "stdafx.h"
#include "2PolyJoint.h"	// For MC2PolyJoint.
#include "2ObjPoly.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 MC2ObjFigure

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjPoly::MC2ObjPoly
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfO_xHqqkZx_
 *************************************************************************/
MC2ObjPoly::MC2ObjPoly ()
{
	// _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 = FFUtilMathI->mmroundoff(DBLRect(0,0,0,0));
	// _xZkqqHx_iKeKiLmIjApMiBeC_xHqqkZx_
	m_bIsOpenPolyJoint = TRUE;
	m_lJoint = 0;
	m_pJoint = NULL;
} // MC2ObjPoly::MC2ObjPoly.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	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 MC2ObjPoly::IsKindOf (FTObjectType nType) const
{
	if (nType == FDOJ_POLY) return TRUE;
	return SUPER_CLASS::IsKindOf(nType);
} // MC2ObjPoly::IsKindOf.

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

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjPoly::OutStream
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCmJiPjBiCkLiPgPiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_iPjBiCkLiPgPiClFjHhAiCmM_xHqqkZx_MC2ARCHIVE
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.03 Fukushiro M. MC2ARCHIVE_xZkqqHx_iCpA_xHqqkZx_MC2ARCHIVE_xZkqqHx_iCmJiPeDjAlDiBeC_xHqqkZx_
 *************************************************************************/
void MC2ObjPoly::OutStream (MC2ARCHIVE& 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++)
		m_pJoint[ll].OutStream(ar);		// _xZkqqHx_jIeBiMiLjDfPiBeC_xHqqkZx_
} // MC2ObjPoly::OutStream.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjPoly::InStream
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCkJiCoHjDmHiCnNiNjOiCnOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_jDmHiCnNiNjOiCnNjHhAiCmM_xHqqkZx_MC2ARCHIVE
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.03 Fukushiro M. MC2ARCHIVE_xZkqqHx_iCpA_xHqqkZx_MC2ARCHIVE_xZkqqHx_iCmJiPeDjAlDiBeC_xHqqkZx_
 *************************************************************************/
void MC2ObjPoly::InStream (MC2ARCHIVE& 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 MC2PolyJoint[m_lJoint];
	for (long ll = 0; ll < m_lJoint; ll++)
		m_pJoint[ll].InStream(ar);		// _xZkqqHx_jIeBiMiLjDfPiBeC_xHqqkZx_
} // MC2ObjPoly::InStream.

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

