/// <summary> /// 绘制初始画板 /// </summary> public void DrawSimuMap(List <NodeBean> lnb, List <LinkBean> lnr) { if (pl == null) { pl = (DrawConverter(lnb)); } // 将pl转化为实际值 List <PointDrawer> lpd = convertToTrueListPoints(pl); PointDrawer.Draw(PointType.NORMAL, lpd.ToArray(), this.graph); // List <TextDrawer> tl = new List <TextDrawer>(); foreach (PointDrawer p in lpd) { tl.Add(new TextDrawer(p.name, (int)(p.Longtitude + 10), (int)(p.Latitude - 5))); } TextDrawer.Draw(TextType.NORMAL, tl.ToArray(), this.graph); // 将lrd转化为实际值 if (lrd == null) { lrd = DrawConverter(lnr); } List <RouteDrawer> lld = convertToTrueListRoutes(lrd, lpd); RouteDrawer.Draw(RouteType.NORMAL, lld.ToArray(), this.graph); }
/// <summary> /// 通用绘图方式 /// </summary> /// <param name="item">绘制项目</param> /// <param name="name">绘图名称</param> /// <param name="type">绘制类型</param> private void Draw(DrawItem item, object type, object obj) { switch (item) { case DrawItem.POINT: PointDrawer.Draw(type, obj, graph); // 空缺处可以是PointDrawer 也可以是PointDrawer[] break; case DrawItem.ROUTE: RouteDrawer.Draw(type, obj, graph); // 空缺处可以是RouteDrawer 也可以是RouteDrawer[] break; case DrawItem.TEXT: break; } }