From 39fe410a2fc2c431cef91c922cb8937c45cb59be Mon Sep 17 00:00:00 2001 From: ellson Date: Mon, 6 Oct 2008 14:17:18 +0000 Subject: [PATCH] Put the aspect-ratio code in #ifdef ASPECT sections because it was a) noisy, b) interactive, c)crashed --- lib/dotgen/dotinit.c | 12 ++++++++++-- lib/dotgen/position.c | 2 ++ lib/dotgen/rank.c | 8 ++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/dotgen/dotinit.c b/lib/dotgen/dotinit.c index 5a5e0c824..fca40d194 100644 --- a/lib/dotgen/dotinit.c +++ b/lib/dotgen/dotinit.c @@ -245,13 +245,16 @@ double start, finish, totalCLK; void dot_layout(Agraph_t * g) { - start = clock(); - setEdgeType (g, ET_SPLINE); +#ifdef ASPECT + start = clock(); nextiter = -1; +#endif + dot_init_node_edge(g); +#ifdef ASPECT printf("Target AR = "); scanf("%lf", &targetAR); @@ -260,6 +263,7 @@ void dot_layout(Agraph_t * g) nPasses++; +#endif dot_rank(g); packiter += curIterations; @@ -268,6 +272,7 @@ void dot_layout(Agraph_t * g) dot_position(g); +#ifdef ASPECT char response[100]; finish = clock(); totalCLK += finish - start; @@ -285,6 +290,7 @@ void dot_layout(Agraph_t * g) start = clock(); } while (nextiter); +#endif /* dumpRanks (g); */ @@ -294,6 +300,8 @@ void dot_layout(Agraph_t * g) dot_compoundEdges(g); dotneato_postprocess(g); +#ifdef ASPECT printf("Packing iterations=%d\n# of Passes=%d\n", packiter, nPasses); printf("Total time = %0.3lf sec\n\n", totalCLK/CLOCKS_PER_SEC); +#endif } diff --git a/lib/dotgen/position.c b/lib/dotgen/position.c index f00462f1d..f41059672 100644 --- a/lib/dotgen/position.c +++ b/lib/dotgen/position.c @@ -1037,6 +1037,7 @@ static void set_aspect(graph_t * g) } } +#ifdef ASPECT double AR = (GD_bb(g).UR.x - GD_bb(g).LL.x)/(GD_bb(g).UR.y - GD_bb(g).LL.y); printf("AR=%0.4lf\t Area= %0.4lf\t", AR, (double)(GD_bb(g).UR.x - GD_bb(g).LL.x)*(GD_bb(g).UR.y - GD_bb(g).LL.y)/10000.0); printf("Dummy=%d\n", countDummyNodes(g)); @@ -1051,6 +1052,7 @@ static void set_aspect(graph_t * g) } else nextiter = 0; printf("next#iter=%d\n", nextiter); +#endif } static point resize_leaf(node_t * leaf, point lbound) diff --git a/lib/dotgen/rank.c b/lib/dotgen/rank.c index 95edfb4a3..695cfc442 100644 --- a/lib/dotgen/rank.c +++ b/lib/dotgen/rank.c @@ -419,7 +419,9 @@ void expand_ranksets(graph_t * g) * cluster, and ND_rank(n) = the local rank offset if n is in * a cluster. */ if (leader != n) +#ifdef ASPECT if (ND_rank(n) == 0) +#endif ND_rank(n) += ND_rank(leader); if (GD_maxrank(g) < ND_rank(n)) @@ -544,8 +546,10 @@ void dot_rank(graph_t * g) attrsym_t* N_level; #endif edgelabel_ranks(g); +#ifdef ASPECT init_UF_size(g); initEdgeTypes(g); +#endif collapse_sets(g,g); /*collapse_leaves(g); */ class1(g); @@ -558,6 +562,10 @@ void dot_rank(graph_t * g) if ((N_level = agfindattr(g->proto->n, "level"))) setRanks(g, N_level); else +#endif +#ifdef ASPECT +#else + rank1(g); #endif expand_ranksets(g); cleanup1(g); -- 2.40.0