欢迎来到天天文库
浏览记录
ID:37570354
大小:139.00 KB
页数:7页
时间:2019-05-25
《线的缓冲区边界的生成》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、线的缓冲区边界的生成算法原理:角平分线算法一、功能实现流程:1.在编辑菜单栏下添加一个子菜单项为缓冲区,并且在工具栏上添加一个工具项。设置text为缓冲区生成,name为buffer等属性,添加单击事件,并为单击事件代码2.为事件函数添加如下代码Graphicsgra=panel1.CreateGraphics();BufferFormbform=newBufferForm();bform.ShowDialog();doubledistance=bform.value;Listring=newList();foreach(Geometry_Tgeoinch
2、oosegeos.Geofeatures){if(geo.GetType()==typeof(Path_T)){Path_Tpa=(Path_T)geo;ring=BufferofPath(path,distance);}}intn=ring.Count-1;for(inti=0;i3、((int)ring[n].X,(int)ring[n].Y),newPoint((int)ring[0].X,(int)ring[0].Y));3.添加一个新的窗体,其目的是为了输入缓冲距,窗体设计如下:设计可仿照前面几个实验的窗体设计4.添加一个矢量线的数据结构,为了处理上下两条平行线,左右两个点publicclassVectorLine{doubleparaA;publicdoubleParaA{get{returnparaA;}set{paraA=value;}}doubleparaB;publicdoubleParaB{get{returnparaB;}set{paraB=valu4、e;}}doubleparaC;publicdoubleParaC{get{returnparaC;}set{paraC=value;}}publicVectorLine(){}publicVectorLine(Point_Tfp,Point_Ttp){paraA=fp.Y-tp.Y;paraB=tp.X-fp.X;paraC=fp.X*tp.Y-fp.Y*tp.X;}publicVectorLine(doublepa,doublepb,doublepc){paraA=pa;paraB=pb;paraC=pc;}}5.实现线的缓冲区算法1)publicListBuffero5、fPath(Path_Tpa,doubledistance){Listring=newList();Listlpath=newList();Listrpath=newList();Point_Tlfpt=newPoint_T();Point_Trfpt=newPoint_T();TwoParallelPoint(pa.Path[0],pa.Fpoint,distance,lfpt,rfpt);lpath.Add(lfpt);rpath.Add(rfpt);intn=pa.Path.Co6、unt-1;for(inti=0;i7、lp,rp;lp=Intersect(lvl,cvl);lpath.Add(lp);rp=Intersect(rvl,cvl);rpath.Add(rp);}Point_Tltpt=newPoint_T();Point_Trtpt=newPoint_T();TwoParallelPoint(pa.Path[n],pa.Tpoint,distance,ltpt,rtpt);lpath.Add(ltpt);rpa
3、((int)ring[n].X,(int)ring[n].Y),newPoint((int)ring[0].X,(int)ring[0].Y));3.添加一个新的窗体,其目的是为了输入缓冲距,窗体设计如下:设计可仿照前面几个实验的窗体设计4.添加一个矢量线的数据结构,为了处理上下两条平行线,左右两个点publicclassVectorLine{doubleparaA;publicdoubleParaA{get{returnparaA;}set{paraA=value;}}doubleparaB;publicdoubleParaB{get{returnparaB;}set{paraB=valu
4、e;}}doubleparaC;publicdoubleParaC{get{returnparaC;}set{paraC=value;}}publicVectorLine(){}publicVectorLine(Point_Tfp,Point_Ttp){paraA=fp.Y-tp.Y;paraB=tp.X-fp.X;paraC=fp.X*tp.Y-fp.Y*tp.X;}publicVectorLine(doublepa,doublepb,doublepc){paraA=pa;paraB=pb;paraC=pc;}}5.实现线的缓冲区算法1)publicListBuffero
5、fPath(Path_Tpa,doubledistance){Listring=newList();Listlpath=newList();Listrpath=newList();Point_Tlfpt=newPoint_T();Point_Trfpt=newPoint_T();TwoParallelPoint(pa.Path[0],pa.Fpoint,distance,lfpt,rfpt);lpath.Add(lfpt);rpath.Add(rfpt);intn=pa.Path.Co
6、unt-1;for(inti=0;i7、lp,rp;lp=Intersect(lvl,cvl);lpath.Add(lp);rp=Intersect(rvl,cvl);rpath.Add(rp);}Point_Tltpt=newPoint_T();Point_Trtpt=newPoint_T();TwoParallelPoint(pa.Path[n],pa.Tpoint,distance,ltpt,rtpt);lpath.Add(ltpt);rpa
7、lp,rp;lp=Intersect(lvl,cvl);lpath.Add(lp);rp=Intersect(rvl,cvl);rpath.Add(rp);}Point_Tltpt=newPoint_T();Point_Trtpt=newPoint_T();TwoParallelPoint(pa.Path[n],pa.Tpoint,distance,ltpt,rtpt);lpath.Add(ltpt);rpa
此文档下载收益归作者所有