コード例 #1
0
        public static void Draw(this Graph <string, VertexData, string, EdgeData> graph, DrawGraph drawer)
        {
            if (graph.VerticesCount() > 1000)
            {
                drawer.DrawWarning(Resources.CannotDrawGraph);
                return;
            }

            Dictionary <string, VertexData> mappedVertices = InitDraw(graph, drawer);

            if (mappedVertices.Count <= 0)
            {
                return;
            }

            DrawEdges(drawer, mappedVertices, graph.Edges);
            DrawVertices(drawer, mappedVertices);
        }
コード例 #2
0
        public static void DrawWithPath(this Graph <string, VertexData, string, EdgeData> graph, DrawGraph drawer, List <string> path)
        {
            if (graph.VerticesCount() > 1000)
            {
                drawer.ClearCanvas();
                drawer.DrawWarning(Resources.CannotDrawGraph);
                return;
            }

            Dictionary <string, VertexData> mappedVertices = InitDraw(graph, drawer);

            if (mappedVertices.Count <= 0)
            {
                return;
            }

            DrawEdges(drawer, mappedVertices, graph.Edges);
            if (path != null)
            {
                DrawPath(drawer, mappedVertices, path);
            }
            DrawVertices(drawer, mappedVertices);
        }