Ejemplo n.º 1
0
        private static void DrawVertex(XGraphics g, Vertex v, PresentationSettings presentationSettings, ILayoutProvider layout)
        {
            Vector3 p = layout.GetPositionOfNode(v);

            if (!double.IsNaN(p.X) &&
               !double.IsNaN(p.Y) &&
               !double.IsNaN(p.Z))
                g.DrawEllipse(presentationSettings.CustomColors.HasCustomColor(v) ? presentationSettings.CustomColors.GetVertexBrush(v) : presentationSettings.DefaultVertexBrush,
                   presentationSettings.ScaleX(p.X) - presentationSettings.VertexSize / 2,
                   presentationSettings.ScaleY(p.Y) - presentationSettings.VertexSize / 2,
                   presentationSettings.VertexSize,
                   presentationSettings.VertexSize);
        }
Ejemplo n.º 2
0
        private static void DrawEdge(XGraphics g, Edge e, PresentationSettings presentationSettings, ILayoutProvider layout)
        {
            Vector3 p1 = layout.GetPositionOfNode(e.Source);
            Vector3 p2 = layout.GetPositionOfNode(e.Target);

            g.DrawLine(presentationSettings.CustomColors.HasCustomColor(e) ? presentationSettings.CustomColors.GetEdgePen(e) : presentationSettings.DefaultEdgePen,
                    presentationSettings.ScaleX(p1.X),
                    presentationSettings.ScaleY(p1.Y),
                    presentationSettings.ScaleX(p2.X),
                    presentationSettings.ScaleY(p2.Y));
        }