entity.cpp

来自「故障诊断工作涉及的领域相当广泛」· C++ 代码 · 共 59 行

CPP
59
字号
// Entity.cpp: implementation of the CEntity class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Cad.h"
#include "Entity.h"

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

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

_declspec(dllexport) CEntity::CEntity()
{
	m_nType=0;
	m_pNext=NULL;
	m_pPre=NULL;
}

_declspec(dllexport) CEntity::~CEntity()
{

}

//计算两点间距离的平方值
 _declspec(dllexport) double CEntity::GetTwoPntDis2(double x1, double y1, double x2, double y2)
{
	return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
 _declspec(dllexport) void operator <<(CArchive& ar,CEntity& it)
{	
	ar<<it.m_nColor;
	ar<<it.m_nLineType;
	ar<<it.m_nType;
//	ar<<it.m_pNext;
//	ar<<it.m_pPre;
	
}
  _declspec(dllexport) void operator >>(CArchive& ar,CEntity& it)
{	ar>>it.m_nColor;
	ar>>it.m_nLineType;
	ar>>it.m_nType;
	//ar>>it.m_pNext;
	//ar>>it.m_pPre;
}
_declspec(dllexport) void CEntity::Serialize(CArchive&  ar)
{AFX_MANAGE_STATE(AfxGetStaticModuleState());
	CObject::Serialize(ar);
if(ar.IsStoring())
 ar<<*this;
else
 ar>>*this;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?