📄 geopolygon.cpp
字号:
// GeoPolygon.cpp: implementation of the CGeoPolygon class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "DigitalMap.h"
#include "GeoPolygon.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CGeoPolygon::CGeoPolygon()
{
}
CGeoPolygon::CGeoPolygon(CGeoPointXY *ptXY,int pointNums,int attriCode)
{
for(int i=0;i<pointNums;i++)
{
m_vecPolyPoint.push_back(ptXY[i]);
}
m_attriCode = attriCode;
}
CGeoPolygon::~CGeoPolygon()
{
}
void CGeoPolygon::GetPolygonXY(CGeoPointXY *ptXY, int &pointNums)
{
//取出
for(int i=0;i<m_vecPolyPoint.size();i++)
{
m_vecPolyPoint.push_back(ptXY[i]);
}
pointNums = m_vecPolyPoint.size();
}
void CGeoPolygon::SetPolygonXY(CGeoPointXY *ptXY, int pointNums)
{
}
//DEL void CGeoPolygon::SetAttriCode(int attriCode)
//DEL {
//DEL m_attriCode = attriCode;
//DEL }
//DEL void CGeoPolygon::GetAttriCode(int &attriCode)
//DEL {
//DEL attriCode = m_attriCode;
//DEL }
void CGeoPolygon::Draw(CDC *pDC,BOOL bDisplay)
{
if(bDisplay==0)//就是擦除图像
return;// pDC->SetROP2(R2_NOTXORPEN);
POINT *Point = new POINT[m_vecPolyPoint.size()];
for(int i=0;i<m_vecPolyPoint.size();i++)
{
Point[i].x = m_vecPolyPoint.at(i).X;
Point[i].y = m_vecPolyPoint.at(i).Y;
}
pDC->Polygon(Point,m_vecPolyPoint.size());
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -