• 大小: 22.76M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-18
  • 语言: 其他
  • 标签: 其他  

资源简介

DrawMap_0725.rar

资源截图

代码片段和文件信息

#include “StdAfx.h“
#include “Datadeal.h“


CDatadeal::CDatadeal(void)
{
xianshu=0;                                  //将线的条数赋初始值 0
country_num=0;

mapRect.xmin = 100000000;
mapRect.ymin = 100000000;
mapRect.xmax = -100000000;
mapRect.ymax = -100000000;

wtRect.xmin = 100000000;
wtRect.ymin = 100000000;
wtRect.xmax = -100000000;
wtRect.ymax = -100000000;
}


CDatadeal::~CDatadeal(void)
{}

void CDatadeal::Read(char*filename)
{
string str;
fstream file;
char  wal_shuju[256]=““;

file.open(filename);

if (file.fail())
{
AfxMessageBox(_T(“文件未打开“));
return ;
}

file.getline(wal_shuju256);

str=(string)wal_shuju;

while(str!=“PolygonBegin“)                 
{
file.getline(wal_shuju256);
str=(string)wal_shuju;
}

file.getline(wal_shuju256);

vector sit_dian;

do 
{
for (int i=0;i<4;i++)                   //由5改为4
{
file.getline(wal_shuju256);
}

int xianshu_;                       //一条线里包含几条小线
file.getline(wal_shuju256);
xianshu_=atoi(wal_shuju);

int dianshu;
for (int i=0;i {
xianshu++;
file.getline(wal_shuju256);   // 11

file.getline(wal_shuju256);
dianshu=atoi(wal_shuju);

for (int i=0;i {
dian zuobiao;

file.getline(wal_shuju256);

char*wal_x=strtok(wal_shuju““);
zuobiao.x=atof(wal_x);

char*wal_y=strtok(NULL““);          
zuobiao.y=atof(wal_y);

sit_dian.push_back(zuobiao);

mapRect.xmin = min(mapRect.xminzuobiao.x);
mapRect.ymin = min(mapRect.yminzuobiao.y);
mapRect.xmax = max(mapRect.xmaxzuobiao.x);
mapRect.ymax = max(mapRect.ymaxzuobiao.y);

//file.getline(wal_shuju256);
}
dianList.push_back(sit_dian);
sit_dian.clear();

//file.getline(wal_shuju256);
}
file.getline(wal_shuju256);
file.getline(wal_shuju256);
file.getline(wal_shuju256);


str=(string)wal_shuju;
} while (str!=“PolygonEnd“);

for (int i=0;i<5;i++)
{
file.getline(wal_shuju256);
}

string str_;

str=(string)wal_shuju;

while (str==“TableEnd“)        //加载多幅图,需用“!=”将其标注屏蔽掉
{
dian zuobiao;

char *sit_x *sit_y *m_doub[5];

char* country;

m_doub[0]=strtok(wal_shuju““);
m_doub[1]=strtok(NULL““);

sit_x=strtok(NULL““);
sit_y=strtok(NULL““);

m_doub[2]=strtok(NULL““);
m_doub[3]=strtok(NULL““);

country=strtok(NULL““);
//m_doub[4]=strtok(NULL““);

zuobiao.x=atof(sit_x);
zuobiao.y=atof(sit_y);

wtRect.xmax=max(zuobiao.xwtRect.xmax);
wtRect.xmin=min(zuobiao.xwtRect.xmin);
wtRect.ymax=max(zuobiao.ywtRect.ymax);
wtRect.ymin=min(zuobiao.ywtRect.ymin);

dianmember.push_back(zuobiao);

str_=(string)country;

string_.push_back(str_);

/* country_num++;*/

file.getline(wal_shuju256);

str=(string)wal_shuju;


file.close();
}

void CDatadeal::Display(CDC *pCDC)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件    2790312  2013-07-26 16:10  DrawMap_0725\DrawMap_0725\CHINA.WP

     文件          1  2009-08-31 02:32  DrawMap_0725\DrawMap_0725\ClassDiagram1.cd

     文件    5216124  2013-07-26 19:49  DrawMap_0725\DrawMap_0725\COUNTRY_WP.txt

     文件       5116  2014-01-04 10:39  DrawMap_0725\DrawMap_0725\Datadeal.cpp

     文件        635  2013-07-27 00:16  DrawMap_0725\DrawMap_0725\Datadeal.h

     文件     128196  2013-07-26 19:30  DrawMap_0725\DrawMap_0725\DrawMap_0725.aps

     文件       5029  2013-07-26 16:54  DrawMap_0725\DrawMap_0725\DrawMap_0725.cpp

     文件        692  2013-07-26 16:54  DrawMap_0725\DrawMap_0725\DrawMap_0725.h

     文件      26488  2013-07-26 19:30  DrawMap_0725\DrawMap_0725\DrawMap_0725.rc

     文件       6439  2013-08-03 00:51  DrawMap_0725\DrawMap_0725\DrawMap_0725.vcxproj

     文件       2986  2013-08-03 00:51  DrawMap_0725\DrawMap_0725\DrawMap_0725.vcxproj.filters

     文件        143  2013-07-26 16:54  DrawMap_0725\DrawMap_0725\DrawMap_0725.vcxproj.user

     文件       2640  2013-07-26 16:54  DrawMap_0725\DrawMap_0725\DrawMap_0725Doc.cpp

     文件        883  2013-07-26 16:54  DrawMap_0725\DrawMap_0725\DrawMap_0725Doc.h

     文件       5756  2014-04-12 21:00  DrawMap_0725\DrawMap_0725\DrawMap_0725View.cpp

     文件       2151  2013-08-04 23:57  DrawMap_0725\DrawMap_0725\DrawMap_0725View.h

     文件       8694  2013-07-26 16:54  DrawMap_0725\DrawMap_0725\MainFrm.cpp

     文件       1095  2013-07-26 16:54  DrawMap_0725\DrawMap_0725\MainFrm.h

     文件       3602  2013-07-26 16:54  DrawMap_0725\DrawMap_0725\ReadMe.txt

     文件      67777  2009-08-31 02:31  DrawMap_0725\DrawMap_0725\res\DrawMap_0725.ico

     文件        680  2013-07-26 16:54  DrawMap_0725\DrawMap_0725\res\DrawMap_0725.rc2

     文件       4710  2009-08-31 02:31  DrawMap_0725\DrawMap_0725\res\DrawMap_0725Doc.ico

     文件       1078  2009-08-31 02:31  DrawMap_0725\DrawMap_0725\res\Toolbar.bmp

     文件       5816  2009-08-31 03:59  DrawMap_0725\DrawMap_0725\res\Toolbar256.bmp

     文件       3346  2013-07-26 18:18  DrawMap_0725\DrawMap_0725\resource.h

     文件        145  2013-07-26 16:54  DrawMap_0725\DrawMap_0725\stdafx.cpp

     文件       1632  2013-07-26 16:54  DrawMap_0725\DrawMap_0725\stdafx.h

     文件        234  2013-07-26 16:54  DrawMap_0725\DrawMap_0725\targetver.h

     文件       7976  2009-08-31 03:59  DrawMap_0725\DrawMap_0725\UserImages.bmp

     文件   97734656  2014-04-12 21:29  DrawMap_0725\DrawMap_0725.sdf

............此处省略10个文件信息

评论

共有 条评论