【实习要点与代码】自己总结[推荐]_实习工作自我鉴定总结

实习报告 时间:2020-02-27 21:47:38 收藏本文下载本文
【www.daodoc.com - 实习报告】

【实习要点与代码】自己总结[推荐]由刀豆文库小编整理,希望给你工作、学习、生活带来方便,猜你可能喜欢“实习工作自我鉴定总结”。

层放在可变槽中处理

层管理点线面注记

ID 属性码 坐标(空间)组成层

// Map.cpp: implementation of the CMap cla.//

//////////////////////////////////////////////////////////////////////

#include “stdafx.h”

#include “mapread.h”

#include “Map.h”

#include “fstream.h”

#ifdef _DEBUG

#undef THIS_FILE

static char THIS_FILE[]=__FILE__;

#define new DEBUG_NEW

#endif

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

//////////////////////////////////////////////////////////////////////

CGeoMap::CGeoMap()

{

m_nRatio = 10;

m_bisLoaded = FALSE;

}

CGeoMap::~CGeoMap()

{

for(int i=0;i

{

CLayer* pLayer=m_LayerArray.ElementAt(i);

if(pLayer!=NULL)

delete pLayer;

}

}

//读取数据

BOOL CGeoMap::ReadData(CString szFileName)

{

ifstream is(szFileName);//文件流

if(!is.is_open())

{} AfxMeageBox(“error”);//没有打开就返回 return FALSE;

AfxMeageBox(“开始读取数据!”);

char value[256];

//范围

is.getline(value,sizeof(value)-1,'n');//获取一行

double xl,yb,xr,yt;//最左最右最下最上

canf(value,“%lf,%lf,%lf,%lfn”,&xl, &yb, &xr, &yt);//字符按自身设计来写double等,前四个是双精度,写到地址里面去,后面是取地址操作符

m_rcBound.left =(int)(xl*m_nRatio);//写出范围,坐标都乘以10

m_rcBound.bottom =(int)(yb*m_nRatio);

m_rcBound.right =(int)(xr*m_nRatio);

m_rcBound.top =(int)(yt*m_nRatio);

CString str;//定义

str.Format(“左下: %d,%d,右上: %d,%dn”, m_rcBound.left, m_rcBound.bottom, m_rcBound.right, m_rcBound.top);//弹出对话框

AfxMeageBox(str);

//层

int layernum=0;

is.getline(value,sizeof(value)-1,'n');

canf(value,“%dn”,&layernum);//转换目标类型 if(layernumcType = curlayer;int num=0;//层目标数 char szObject[10];is.getline(value,sizeof(value)-1,'n');//Point 108,放到value解意 canf(value,“%s %dn”,szObject/*几何类型*/, &num);//用此函数解意 // if(strcmp(szObject, “Point”)==0){for(int i=0;i

CGeoPoint* pPoint=new CGeoPoint;//定义点对象,填属性//属性码is.getline(value,sizeof(value)-1,'n');//转换canf(value,“%sn”, pPoint->codestring);//坐标is.getline(value,sizeof(value)-1,'n');double x,y;canf(value,“%lf,%lfn”, &x, &y);//长整形pPoint->m_pt.x =(int)(x*m_nRatio);pPoint->m_pt.y =(int)(y*m_nRatio);

pLayer->m_PointArray.Add(pPoint);//加点}

}

if(strcmp(szObject, “Polyline”)==0)

{

for(int i=0;i

{

//line

//....//....}

}

if(strcmp(szObject, “Polygon”)==0)

{

for(int i=0;i

{

CGeoArea* pArea=new CGeoArea;//....//....}

}

m_LayerArray.Add(pLayer);//读完层在增加} //以上程序读数据流程(难度较大)

//目标

AfxMeageBox(“ok”);

is.close();

m_bisLoaded = TRUE;

return TRUE;

}

//绘制地图

void CGeoMap::Draw(CDC *pDC)

{

if(m_bisLoaded)

{

pDC->Rectangle(&m_rcBound);

for(int i=0;i

CLayer* pLayer=m_LayerArray.GetAt(i);if(pLayer==NULL)continue;//pLayer->Draw(pDC);

//pDC->Polyline(pts, num);//pDC->Polylgon(pts, num);}

}

}

BOOL CGeoMap::GetMapSize(SIZE &sz)

{

if(!m_bisLoaded)

return FALSE;

sz.cx = m_rcBound.right-m_rcBound.left;sz.cy = m_rcBound.top-m_rcBound.bottom;return TRUE;

}

BOOL CGeoMap::GetWindowOrg(int &x, int &y){

if(!m_bisLoaded)

return FALSE;

x =(m_rcBound.right+m_rcBound.left)/2;y =(m_rcBound.top+m_rcBound.bottom)/2;return TRUE;

}

下载【实习要点与代码】自己总结[推荐]word格式文档
下载【实习要点与代码】自己总结[推荐].doc
将本文档下载到自己电脑,方便修改和收藏。
点此处下载文档

文档为doc格式

    热门文章
      整站推荐
        点击下载本文