Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Быстрый алгоритм разделения и слияния при помощи мостиков / source / ConvexHull / PointData
.cpp// PointData.cpp: implementation of the CPointData class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "ConvexHull.h"
#include "PointData.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//IMPLEMENT_DYNAMIC(CPointData, CObject)
IMPLEMENT_SERIAL(CPointData, CObject, 0)
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CPointData::CPointData()
{
}
CPointData::~CPointData()
{
}
void CPointData::Serialize(CArchive& ar)
{
int size;
if (ar.IsStoring()) {
//ar << m_strName << m_nGrade;
size = UserPoints.size();
ar << size;
for (int i=0; i< size;i++){
TPoint * point = (TPoint*)UserPoints.at(i);
ar<< point->x;
ar<<point->y;
}
}
else {
int x,y;
ar >> size;
for (int i=0; i< size; i++){
ar >> x;
ar >> y;
TPoint* pnt = new TPoint(x,y);
UserPoints.push_back(pnt);
}
}
}
Соседние файлы в папке ConvexHull