geopoint.cpp

来自「VC++开发广州市交通运输干线」· C++ 代码 · 共 59 行

CPP
59
字号
// GeoPoint.cpp: implementation of the CGeoPoint class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "DigitalMap.h"
#include "GeoPoint.h"

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

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

CGeoPoint::CGeoPoint()
{

}

CGeoPoint::CGeoPoint(CGeoPointXY cGeoPtXY,int attriCode)
{
	m_ptXY.X = cGeoPtXY.X;
	m_ptXY.Y = cGeoPtXY.Y;
	m_attriCode = attriCode;
}

CGeoPoint::~CGeoPoint()
{

}

void CGeoPoint::SetPointXY(CGeoPointXY ptXY)	//设置点位置
{
	m_ptXY.X = ptXY.X;
	m_ptXY.Y = ptXY.Y;
}

void CGeoPoint::GetPointXY(CGeoPointXY &ptXY)	//取出点位置
{
	ptXY.X = m_ptXY.X;
	ptXY.Y = m_ptXY.Y;
}

void CGeoPoint::Draw(CDC *pDC,BOOL bDisplay,int nCircle)					//画点
{
	CGeoPointXY cGeoPtXY;
	GetPointXY(cGeoPtXY);
	float x = cGeoPtXY.X;
	float y = cGeoPtXY.Y;
	if(bDisplay==0)//就是擦除图像
		return;//pDC->SetROP2(R2_NOTXORPEN);
	pDC->Ellipse(x-nCircle,y-nCircle,x+nCircle,y+nCircle);
}

⌨️ 快捷键说明

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