#include "stdafx.h"
#include "4UtilMath.h"		// For mmroundoff.
#include "4ObjWidePoly.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 MC4ObjPoly

////////////////////////////////////////////////////////////////////////////
// MC4ObjWidePoly_xZkqqHx_iDiBiDjDiDgPiKnGjAjEiBeC_xHqqkZx_

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC4ObjWidePoly::MC4ObjWidePoly
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfO_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.06.08 Fukushiro M. _xZkqqHx_iNoMjAkMiBeC_xHqqkZx_
 *************************************************************************/
MC4ObjWidePoly::MC4ObjWidePoly ()
{
	// memcmp_xZkqqHx_iCmFiDeJiDhFiDfHiDeGiDeOiDgHjEoEiKhCiCpAiClHiCoJiClNiCnPiBeBiNfMjBkCjBmMiDeNiDiDiDgCiDhGiCoAjBfDiCmEiCePiCmFjGiEiCnPiCoJiBeC_xHqqkZx_
	ASSERT(ALIGNMENT8(sizeof(SUPER_CLASS)) == offsetof(MC4ObjWidePoly, m_mmWidthF));
	memset(&m_mmWidthF, 0, sizeof(MC4ObjWidePoly) - offsetof(MC4ObjWidePoly, m_mmWidthF));

	m_mmWidthF = mmroundoff(4.0);	// _xZkqqHx_iKeKiOgOjDfPiCmMjBnBiCmMjFjNiBeC_xHqqkZx_
	m_mmWidthB = mmroundoff(4.0);	// _xZkqqHx_iPeJjHlJjDfPiCmMjBnBiCmMjFjNiBeC_xHqqkZx_
	m_nWidthSlopeF = 0;		// _xZkqqHx_iKeKiOgOjDfPiCmMiMfIiOmOiBeC_xHqqkZx_[0, 10000]_xZkqqHx_iBeC_xHqqkZx_
	m_nWidthSlopeB = 0;		// _xZkqqHx_iPeJjHlJjDfPiCmMiMfIiOmOiBeC_xHqqkZx_[0, 10000]_xZkqqHx_iBeC_xHqqkZx_
//----- 06.04.01 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	m_mmArrowF_P = -1.0;
	m_mmArrowF_Q = -1.0;
	m_dArrowF_Angle = -1.0;
	m_mmArrowB_P = -1.0;
	m_mmArrowB_Q = -1.0;
	m_dArrowB_Angle = -1.0;
//----- 06.04.01 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
} // MC4ObjWidePoly::MC4ObjWidePoly.

//----- 05.06.17 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC4ObjWidePoly::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_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.06.08 Fukushiro M. _xZkqqHx_iNoMjAkMiBeC_xHqqkZx_
// *************************************************************************/
//BOOL MC4ObjWidePoly::IsKindOf (FTObjectType nType) const
//{
//	if (nType == FDOJ_WIDE_POLY) return TRUE;
//	return SUPER_CLASS::IsKindOf(nType);
//} // MC4ObjWidePoly::IsKindOf.
//----- 05.06.17 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC4ObjWidePoly::Type
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMjFjEjFgJiCmMiMfOiCpAjFnEiClH_xHqqkZx_.
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiMfO_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.06.08 Fukushiro M. _xZkqqHx_iNoMjAkMiBeC_xHqqkZx_
 *************************************************************************/
FTObjectType MC4ObjWidePoly::Type () const
{
	return FDOJ_WIDE_POLY;
} // MC4ObjWidePoly::Type.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC4ObjWidePoly::OutStream
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCmJiPjBiCkLiPgPiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_iPjBiCkLiPgPiClFjHhAiCmM_xHqqkZx_CArchive
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.06.08 Fukushiro M. _xZkqqHx_iNoMjAkMiBeC_xHqqkZx_
 *************************************************************************/
void MC4ObjWidePoly::OutStream (CArchive& ar)
{
	SUPER_CLASS::OutStream(ar);
	ar << m_mmWidthF;		// _xZkqqHx_jGoOiIpDiCmMjFjNiBeC_xHqqkZx_
	ar << m_mmWidthB;		// _xZkqqHx_jGoOiIpDiCmMjFjNiBeC_xHqqkZx_
	ar << m_nWidthSlopeF;	// _xZkqqHx_iKeKiOgOjDfPiCmMiMfIiOmOiBeC_xHqqkZx_[0, 10000]_xZkqqHx_iBeC_xHqqkZx_
	ar << m_nWidthSlopeB;	// _xZkqqHx_iPeJjHlJjDfPiCmMiMfIiOmOiBeC_xHqqkZx_[0, 10000]_xZkqqHx_iBeC_xHqqkZx_
//----- 06.04.01 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	long lC;
	ar << long(m_vmmptLeftBezier.size());	// _xZkqqHx_iDhIiDfHiDeGiLnPiOjHiLmIjApMiBeC_xHqqkZx_
	for (lC = 0; lC != m_vmmptLeftBezier.size(); lC++)
		ar << m_vmmptLeftBezier[lC];
	ar << long(m_vmmptRightBezier.size());	// _xZkqqHx_iDhIiDfHiDeGiLnPiOjHiLmIjApMiBeC_xHqqkZx_
	for (lC = 0; lC != m_vmmptRightBezier.size(); lC++)
		ar << m_vmmptRightBezier[lC];
	ar << m_mmArrowF_P;			// _xZkqqHx_jBePjFpLjGoOiIpDiCmMiCgPiBeC_xHqqkZx_
	ar << m_mmArrowF_Q;			// _xZkqqHx_jBePjFpLjGoOiIpDiCmMiChAiBeC_xHqqkZx_
	ar << m_dArrowF_Angle;		// _xZkqqHx_jBePjFpLjGoOiIpDiCmMiMpMiCkLiBeC_xHqqkZx_
	ar << m_mmArrowB_P;			// _xZkqqHx_iMoDjFpLjGoOiIpDiCmMiCgPiBeC_xHqqkZx_
	ar << m_mmArrowB_Q;			// _xZkqqHx_iMoDjFpLjGoOiIpDiCmMiChAiBeC_xHqqkZx_
	ar << m_dArrowB_Angle;		// _xZkqqHx_iMoDjFpLjGoOiIpDiCmMiMpMiCkL_xHqqkZx_
//----- 06.04.01 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
} // MC4ObjWidePoly::OutStream.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC4ObjWidePoly::InStream
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCkJiCoHjDmHiCnNiNjOiCnOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_jDmHiCnNiNjOiCnNjHhAiCmM_xHqqkZx_CArchive
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.06.08 Fukushiro M. _xZkqqHx_iNoMjAkMiBeC_xHqqkZx_
 *************************************************************************/
void MC4ObjWidePoly::InStream (CArchive& ar)
{
	SUPER_CLASS::InStream(ar);
	ar >> m_mmWidthF;		// _xZkqqHx_jGoOiIpDiCmMjFjNiBeC_xHqqkZx_
	ar >> m_mmWidthB;		// _xZkqqHx_jGoOiIpDiCmMjFjNiBeC_xHqqkZx_
	ar >> m_nWidthSlopeF;	// _xZkqqHx_iKeKiOgOjDfPiCmMiMfIiOmOiBeC_xHqqkZx_[0, 10000]_xZkqqHx_iBeC_xHqqkZx_
	ar >> m_nWidthSlopeB;	// _xZkqqHx_iPeJjHlJjDfPiCmMiMfIiOmOiBeC_xHqqkZx_[0, 10000]_xZkqqHx_iBeC_xHqqkZx_
//----- 06.04.01 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	long lC;
	long lSize;
	ar >> lSize;	// _xZkqqHx_iDhIiDfHiDeGiLnPiOjHiLmIjApMiBeC_xHqqkZx_
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	m_vmmptLeftBezier.assign(lSize);
	m_vmmptLeftBezier.assign(lSize, DBLPoint(0,0));
	for (lC = 0; lC != lSize; lC++)
		ar >> m_vmmptLeftBezier[lC];
	ar >> lSize;	// _xZkqqHx_iDhIiDfHiDeGiLnPiOjHiLmIjApMiBeC_xHqqkZx_
// 06.05.11 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	m_vmmptRightBezier.assign(lSize);
	m_vmmptRightBezier.assign(lSize, DBLPoint(0,0));
	for (lC = 0; lC != lSize; lC++)
		ar >> m_vmmptRightBezier[lC];
	ar >> m_mmArrowF_P;		// _xZkqqHx_jBePjFpLjGoOiIpDiCmMiCgPiBeC_xHqqkZx_
	ar >> m_mmArrowF_Q;		// _xZkqqHx_jBePjFpLjGoOiIpDiCmMiChAiBeC_xHqqkZx_
	ar >> m_dArrowF_Angle;  // _xZkqqHx_jBePjFpLjGoOiIpDiCmMiMpMiCkLiBeC_xHqqkZx_
	ar >> m_mmArrowB_P;		// _xZkqqHx_iMoDjFpLjGoOiIpDiCmMiCgPiBeC_xHqqkZx_
	ar >> m_mmArrowB_Q;		// _xZkqqHx_iMoDjFpLjGoOiIpDiCmMiChAiBeC_xHqqkZx_
	ar >> m_dArrowB_Angle;  // _xZkqqHx_iMoDjFpLjGoOiIpDiCmMiMpMiCkL_xHqqkZx_
//----- 06.04.01 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
} // MC4ObjWidePoly::InStream.

