⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pointsex.cpp

📁 这是一个GPS相关的程序
💻 CPP
字号:
#include <memory.h>
#include "PointsEx.h"

CPointsEx::CPointsEx(void)
{
	m_nPoints	= 0;
	m_Points	= NULL;
	m_ClosestPts = NULL;
}

CPointsEx::~CPointsEx(void)
{
	Clear();
}

void CPointsEx::Clear(void)
{
	if( m_Points )
	{
		SG_Free(m_Points);
		SG_Free(m_ClosestPts);
	}

	m_nPoints	= 0;
	m_Points	= NULL;
	m_ClosestPts = NULL;
}

bool CPointsEx::Add(int x, int y, int iClosestPt)
{
	m_Points	= (TSG_Point_Int *)SG_Realloc(m_Points, (m_nPoints + 1) * sizeof(TSG_Point_Int));
	m_ClosestPts = (int*)SG_Realloc(m_ClosestPts, (m_nPoints + 1) * sizeof(int));
	
	m_Points[m_nPoints].x	= x;
	m_Points[m_nPoints].y	= y;
	m_ClosestPts[m_nPoints] = iClosestPt;
	m_nPoints++;

	return( true );
}

⌨️ 快捷键说明

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