| | |
| | | |
| | | partial class MapViewer |
| | | { |
| | | void Draw(Graphics bufferG, Template template) |
| | | void DrawBackGroud(Graphics bufferG,Template template) |
| | | { |
| | | if (template == null) return; |
| | | var _Nodes = template.network.Nodes.ViewNodes; |
| | |
| | | |
| | | float minElve = float.MinValue; |
| | | float maxElve = float.MaxValue; |
| | | //if (this.mapOption!=null && this.mapOption.ShowFloor!=int.MinValue ) |
| | | //{ |
| | | // var fl = template.Floors.Find(f => f.FloorIndex == this.mapOption.ShowFloor); |
| | | // var fl_1 = template.Floors.Find(f => f.FloorIndex == this.mapOption.ShowFloor+1); |
| | | // if (fl!=null) |
| | | // { |
| | | // minElve = fl.Elev; |
| | | |
| | | // maxElve = fl_1!=null ? fl_1.Elev : float.MaxValue; |
| | | // } |
| | | |
| | | //} |
| | | r = r * Link_multiply; |
| | | List<PointF> diametersZoom = new List<PointF>() { new PointF(0, 0.08f), new PointF(150, 0.03f), new PointF(300, 0.001f), new PointF(800, 0.0001f) }; |
| | | |
| | | Pen penN = new Pen(Color.FromArgb(0, 0, 255), 1 * r); |
| | | |
| | | Pen penChoosed = new Pen(Color.Purple, 5 * r); |
| | | Pen pen_valveChoosed = new Pen(Color.Red, 5 * r); |
| | | |
| | | Pen penClosed = new Pen(Color.OrangeRed, 2 * r); |
| | | Pen penHovered = new Pen(Color.DeepSkyBlue, 5 * r); |
| | | |
| | | //背景图绘制 |
| | | if (this.mapOption.isShowPic && template != null && File.Exists(template.BackGroundImg_FullPath)) |
| | | |
| | |
| | | |
| | | //bufferG.Restore(gs); |
| | | } |
| | | } |
| | | |
| | | void Draw(Graphics bufferG, Template template) |
| | | { |
| | | if (template == null) return; |
| | | var _Nodes = template.network.Nodes.ViewNodes; |
| | | var _Links = template.network.Links.ViewLinks; |
| | | |
| | | var Cpoints = getCurclePoints(64).ToList(); |
| | | |
| | | var r = 1.73f / zoom; |
| | | var rt = r; |
| | | |
| | | float minElve = float.MinValue; |
| | | float maxElve = float.MaxValue; |
| | | //if (this.mapOption!=null && this.mapOption.ShowFloor!=int.MinValue ) |
| | | //{ |
| | | // var fl = template.Floors.Find(f => f.FloorIndex == this.mapOption.ShowFloor); |
| | | // var fl_1 = template.Floors.Find(f => f.FloorIndex == this.mapOption.ShowFloor+1); |
| | | // if (fl!=null) |
| | | // { |
| | | // minElve = fl.Elev; |
| | | |
| | | // maxElve = fl_1!=null ? fl_1.Elev : float.MaxValue; |
| | | // } |
| | | |
| | | //} |
| | | r = r * Link_multiply; |
| | | List<PointF> diametersZoom = new List<PointF>() { new PointF(0, 0.08f), new PointF(150, 0.03f), new PointF(300, 0.001f), new PointF(800, 0.0001f) }; |
| | | |
| | | Pen penN = new Pen(Color.FromArgb(0, 0, 255), 1 * r); |
| | | |
| | | Pen penChoosed = new Pen(Color.Purple, 5 * r); |
| | | Pen pen_valveChoosed = new Pen(Color.Red, 5 * r); |
| | | |
| | | Pen penClosed = new Pen(Color.OrangeRed, 2 * r); |
| | | Pen penHovered = new Pen(Color.DeepSkyBlue, 5 * r); |
| | | |
| | | |
| | | |
| | | // 绘制线 |
| | |
| | | return new PointF(worldX, worldY); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 世界投影坐标转换为屏幕坐标 |
| | | /// </summary> |
| | | /// <param name="mapPos"></param> |
| | | /// <param name="z"></param> |
| | | /// <returns></returns> |
| | | private PointF MapToScreen(PointF mapPos, float z = 0) |
| | | { |
| | | |
| | |
| | | return new PointF(x, y); |
| | | } |
| | | /// <summary> |
| | | /// 获取地图投影坐标 |
| | | /// 获取世界投影坐标 |
| | | /// </summary> |
| | | /// <param name="point"></param> |
| | | /// <param name="z"></param> |