]> granicus.if.org Git - graphviz/commitdiff
Put the aspect-ratio code in #ifdef ASPECT sections because it was a) noisy, b)...
authorellson <devnull@localhost>
Mon, 6 Oct 2008 14:17:18 +0000 (14:17 +0000)
committerellson <devnull@localhost>
Mon, 6 Oct 2008 14:17:18 +0000 (14:17 +0000)
lib/dotgen/dotinit.c
lib/dotgen/position.c
lib/dotgen/rank.c

index 5a5e0c8240c9a04b3667ecf8cf768e7fa3b8bcaf..fca40d194131d14a7e24db496aaf2b706f7ad8a4 100644 (file)
@@ -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
 }
index f00462f1d267c8facd835142ce0d130cbb301821..f41059672f98d916aebd321b3a9017387e150db8 100644 (file)
@@ -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)
index 95edfb4a359845d3055f4402e7193d4180c48b12..695cfc44205e2fa9322cc3a9d6be0faa68085589 100644 (file)
@@ -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);