#include "stdafx.h"
#include "2RichText.h"		// For MC2RichText.
#include "2PolyJoint.h"		// For MFOutStream.
#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//SUPER_CLASS
#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;

	m_mmrtResize.SetRect(0,0,0,0);	// _xZkqqHx_iDiKiDfEiDeDiDfJiDhEiDiMiBfLiDiA_xHqqkZx_.
	// _xZkqqHx_iKeKiLmIjApMiBeC_xHqqkZx_
	m_bIsOpenPolyJoint = TRUE;
	m_lJoint = 0;
	m_pJoint = NULL;
} // MC2ObjPoly::MC2ObjPoly.

/*************************************************************************
 * <_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::OutStreamV3
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCmJiPjBiCkLiPgPiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_iPjBiCkLiPgPiClFjHhAiCmM_xHqqkZx_MCARCHIVE
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.03 Fukushiro M. MCARCHIVE_xZkqqHx_iCpA_xHqqkZx_MCARCHIVE_xZkqqHx_iCmJiPeDjAlDiBeC_xHqqkZx_
 *************************************************************************/
void MC2ObjPoly::OutStreamV3 (MCARCHIVE& ar)
{
	SUPER_CLASS::OutStreamV3(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_
} // MC2ObjPoly::OutStreamV3.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjPoly::InStreamV12
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCkJiCoHjDmHiCnNiNjOiCnOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_jDmHiCnNiNjOiCnNjHhAiCmM_xHqqkZx_MCARCHIVE
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.03 Fukushiro M. MCARCHIVE_xZkqqHx_iCpA_xHqqkZx_MCARCHIVE_xZkqqHx_iCmJiPeDjAlDiBeC_xHqqkZx_
 *************************************************************************/
void MC2ObjPoly::InStreamV12 (MCARCHIVE& ar)
{
	SUPER_CLASS::InStreamV12(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_
} // MC2ObjPoly::InStreamV12.

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

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjPoly::GetResizeFrame
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jAhNiMgAiCmMiDiKiDfEiDeDiDfJiDhEiDiMiBfLiDiAiCpAiLiBiCnPiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jCiNiInD_xHqqkZx_>	_xZkqqHx_jCgMiCmMjAlDiKgNiClDiCmGiOmAiNhDiCmMjBiBiClDiCkKiLiBiCnPiCoHiCoKiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDhEiDiMiBfLiDiAiDfEiDeDiDfJ_xHqqkZx_._xZkqqHx_iOmAiNmAjFfH_xHqqkZx_.
 *************************************************************************/
DBLRect MC2ObjPoly::GetResizeFrame () const
{
	return m_mmrtResize;
} // MC2ObjPoly::GetResizeFrame.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjPoly::IsClosePolygon
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	NewObjPolygon_xZkqqHx_iCkKjFnEiClHiDhMiDiKiDfDiDjDiCkKjFmCiClGiCmEiCkCiCoJiCkJiCmHiCkEiCkJiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.04.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
BOOL MC2ObjPoly::IsClosePolygon () const
{
	return !m_bIsOpenPolyJoint;
} // MC2ObjPoly::IsClosePolygon.

