[31]
层放在可变槽中处理
层管理点线面注记
ID 属性码 坐标(空间)组成层
// Map.cpp: implementation of the CMap class.
//
//////////////////////////////////////////////////////////////////////
#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<m_LayerArray.GetSize();i++)
{
CLayer* pLayer=m_LayerArray.ElementAt(i);
if(pLayer!=NULL)
delete pLayer;
}
}
//读取数据
BOOL CGeoMap::ReadData(CString szFileName)
{
ifstream is(szFileName);//文件流
if(!is.is_open())
{ } AfxMessageBox("error");//没有打开就返回 return FALSE;
AfxMessageBox("开始读取数据!");
char value[256];
//范围
is.getline(value,sizeof(value)-1,'\n');//获取一行
double xl,yb,xr,yt;//最左最右最下最上
sscanf(value,"%lf,%lf,%lf,%lf\n",&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,%d\n", m_rcBound.left, m_rcBound.bottom, m_rcBound.right, m_rcBound.top);//弹出对话框
AfxMessageBox(str);
//层
int layernum=0;
is.getline(value,sizeof(value)-1,'\n');
sscanf(value,"%d\n",&layernum);//转换目标类型 if(layernum<=0) return FALSE; for(int j=0;j<layernum;j++)//大于0逐层来读 {//层 char curlayer; CLayer* pLayer=new CLayer; is.getline(value,sizeof(value)-1,'\n'); sscanf(value,"%c\n", &curlayer);//P放入层类型 pLayer->cType = curlayer; int num=0;//层目标数 char szObject[10]; is.getline(value,sizeof(value)-1,'\n');//Point 108,放到value解意 sscanf(value,"%s %d\n",szObject/*几何类型*/, &num);//用此函数解意 // if(strcmp(szObject, "Point")==0) { for(int i=0;i<num;i++) {
CGeoPoint* pPoint=new CGeoPoint;//定义点对象,填属性 //属性码 is.getline(value,sizeof(value)-1,'\n');//转换 sscanf(value,"%s\n", pPoint->codestring); //坐标 is.getline(value,sizeof(value)-1,'\n'); double x,y; sscanf(value,"%lf,%lf\n", &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<num;i++)
{
//line
//....
//....
}
}
if(strcmp(szObject, "Polygon")==0)
{
for(int i=0;i<num;i++)
{
CGeoArea* pArea=new CGeoArea; //....
//....
}
}
m_LayerArray.Add(pLayer);//读完层在增加 } //以上程序读数据流程(难度较大)
//目标
AfxMessageBox("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<m_LayerArray.GetSize();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;
}
第二篇:采购实习评估与自我总结
我于?年?月?日开始到?公司工作。从来公司的第一天开始,我就把自己融入到我们物资采购的这个团队中,不知不觉已经四个多月了,现将这几个月的工作做如下总结:
一、在大家忙碌的工作氛围中,我很快熟悉了变压器的工艺流程与变压器的相关组件,很快的适应了询价的相关工作。我以较快的速度融入到工作当中,边学边做,边做边问。目前我负责了变压器中高压投标项目的全部询价工作以及其他的询价相关事宜。
二、当投标项目很急或是要立马出价格的,我会积极与报价方沟通,争取以最快的方式将报价反馈。同时在遇到某一特殊组件的询价时,我也会尽可能的多询几家供方,将价格有优势、质量有保证的报价反馈。
三、在这四个月试用期间,除了询价、比价等工作外,我也在力所能及之时帮助同事们做一些力所能及的事情,也不断地向同事们请教采购专业方面的知识,来丰富和充实自己。
关于目前我工作的状况,我想提出一点建议。虽然我可以按时完成自己的工作任务,但是总感觉自己在询价工作中,特别是对于进口组件的询价中处于一种被动的形势,也就是我被动的从代理商那里接受价格反馈。如果是特别急着寄标书的项目,这种反馈速度肯定会成为瓶颈制约着整个投标进程。因此有必要建立自己的对外询价机制,与国外供方的直接对话。所以,我希望在
我在职的期间,这种情况能有所改善,我也在积极的学习,希望能尽早为公司奉献更多的力量