]> granicus.if.org Git - graphviz/commitdiff
Wrap new level code with WITH_CGRAPH
authorEmden Gansner <erg@research.att.com>
Fri, 11 Nov 2011 19:48:54 +0000 (14:48 -0500)
committerEmden Gansner <erg@research.att.com>
Fri, 11 Nov 2011 19:48:54 +0000 (14:48 -0500)
lib/dotgen/dotinit.c
lib/dotgen/mincross.c
lib/dotgen/rank.c

index 85e845506f7263d789097ffd2c0cad4d358f6d6d..8bbb472167eb66b3673a5e22eb24908f286f0d1a 100644 (file)
@@ -280,6 +280,7 @@ setAspect (Agraph_t * g, aspect_t* adata)
     return adata;
 }
 
+#ifdef WITH_CGRAPH
 static void
 remove_from_rank (Agraph_t * g, Agnode_t* n)
 {
@@ -322,6 +323,7 @@ removeFill (Agraph_t * g)
     agdelsubg (g, sg);
 
 }
+#endif
 
 void dot_layout(Agraph_t * g)
 {
index 421c340af246cafca0618241db748e5a0abd0840..7315f402126d7c27603298045577d023a98a154a 100644 (file)
@@ -856,6 +856,7 @@ void rec_reset_vlists(graph_t * g)
        }
 }
 
+#ifdef WITH_CGRAPH
 /* realFillRanks:
  * The structures in crossing minimization and positioning require
  * that clusters have some node on each rank. This function recursively
@@ -916,6 +917,7 @@ fillRanks (Agraph_t* g)
     sg = realFillRanks (g, rnks, rnks_sz, NULL);
     free (rnks);
 }
+#endif
 
 static void init_mincross(graph_t * g)
 {
@@ -933,8 +935,10 @@ static void init_mincross(graph_t * g)
     TE_list = N_NEW(size, edge_t *);
     TI_list = N_NEW(size, int);
     mincross_options(g);
+#ifdef WITH_CGRAPH
     if (GD_flags(g) & NEW_RANK)
        fillRanks (g);
+#endif
     class2(g);
     decompose(g, 1);
     allocate_ranks(g);
index 796ae8f57b05dc1a43974a7e2cfaf83eeeaec2ff..636c4b6e89ad428a05cebf483cf3597c5e160685 100644 (file)
@@ -29,7 +29,9 @@
 #include       "dot.h"
 
 static void dot1_rank(graph_t * g, aspect_t* asp);
+#ifdef WITH_CGRAPH
 static void dot2_rank(graph_t * g, aspect_t* asp);
+#endif
 
 static void 
 renewlist(elist * L)
@@ -605,11 +607,13 @@ static void dot1_rank(graph_t * g, aspect_t* asp)
 
 void dot_rank(graph_t * g, aspect_t* asp)
 {
+#ifdef WITH_CGRAPH
     if (agget (g, "newrank")) {
        GD_flags(g) |= NEW_RANK;
        dot2_rank (g, asp);
     }
     else
+#endif
        dot1_rank (g, asp);
 }
 
@@ -683,6 +687,7 @@ collapse_leaves(graph_t * g)
 }
 #endif
 
+#ifdef WITH_CGRAPH
 /* new ranking code:
  * Allows more constraints
  * Copy of level.c in dotgen2
@@ -1178,7 +1183,6 @@ static void add_fast_edges (graph_t * g)
     }
 }
 
-#ifdef WITH_CGRAPH
 static void my_init_graph(Agraph_t *g, Agobj_t *graph, void *arg)
 { int *sz = arg; agbindrec(graph,"level graph rec",sz[0],TRUE); }
 static void my_init_node(Agraph_t *g, Agobj_t *node, void *arg)
@@ -1192,7 +1196,6 @@ int infosizes[] = {
     sizeof(Agnodeinfo_t),
     sizeof(Agedgeinfo_t)
 };
-#endif
 
 void dot2_rank(graph_t * g, aspect_t* asp)
 {
@@ -1204,10 +1207,8 @@ void dot2_rank(graph_t * g, aspect_t* asp)
 #endif
     Last_node = NULL;
     graph_t *Xg = agopen("level assignment constraints", Agstrictdirected, 0);
-#ifdef WITH_CGRAPH
     agbindrec(Xg,"level graph rec",sizeof(Agraphinfo_t),TRUE);
     agpushdisc(Xg,&mydisc,infosizes);
-#endif
 
     edgelabel_ranks(g);
 
@@ -1242,5 +1243,6 @@ void dot2_rank(graph_t * g, aspect_t* asp)
     agclose(Xg);
 }
 
+#endif /* WITH_CGRAPH */
 /* end of new ranking code
  */