public void DrawEdge(EulerGraph.Vertex v1, EulerGraph.Edge e) { if ((v1 != null) && (e != null)) { Drawing.EdgeRender.Draw(v1, e, Canvas, new Pen(Edge, EdgePenSize), VertexRadius); } }
//euler graph public static void Draw(EulerGraph.Vertex v1, EulerGraph.Edge e, Graphics graphics, Pen pen, int R) { PointF point = new PointF((v1.X + e.Vertex.X) / 2, (v1.Y + e.Vertex.Y) / 2 + 3); graphics.DrawString(e.Weight.ToString(), new Font("Arial", 12), new SolidBrush(Color.Black), point); graphics.DrawLine(pen, v1.X, v1.Y, e.Vertex.X, e.Vertex.Y); }
public void DrawVertex(EulerGraph.Vertex v) { if (v != null) { Drawing.VertexRender.Draw(v, Canvas, new Pen(VertexBorder, VertexBorderPenSize), new SolidBrush(VertexFill), TextFont, new SolidBrush(Text), VertexRadius); } }
//рисование связки public void DrawLinks(EulerGraph.Vertex v) { if (v == null) { return; } foreach (var n in v.Links) { if (n.Vertex != v) { DrawEdge(v, n); DrawVertex(n.Vertex); } //DrawEdge(v, n); //Drawing.EdgeRender.Draw(v, n, Canvas, new Pen(Edge, EdgePenSize)); } DrawVertex(v); }
//for euler public static void Draw(EulerGraph.Vertex v, Graphics graphics, Pen borderPen, SolidBrush fillBrush, Font textFont, SolidBrush textBrush, int R) { graphics.DrawEllipse(borderPen, (v.X - R), (v.Y - R), 2 * R, 2 * R); graphics.FillEllipse(fillBrush, (v.X - R), (v.Y - R), 2 * R, 2 * R); graphics.DrawString(v.GlobalIndex.ToString(), textFont, textBrush, v.X - 9, v.Y - 9); }