Скачиваний:
16
Добавлен:
01.05.2014
Размер:
1.14 Кб
Скачать
// 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