]> granicus.if.org Git - graphviz/commitdiff
Forgot to add these last night.
authorerg <devnull@localhost>
Wed, 16 Feb 2005 14:09:04 +0000 (14:09 +0000)
committererg <devnull@localhost>
Wed, 16 Feb 2005 14:09:04 +0000 (14:09 +0000)
lib/neatogen/adjust.c
lib/neatogen/adjust.h

index 441a2016eb5c9304079a1e57a91e8dc95665b80e..b799586289683bcf388b09fc5db5147320dbee98 100644 (file)
@@ -649,7 +649,12 @@ static void updateGraph(Agraph_t * graph)
     }
 }
 
-static void normalize(graph_t * g)
+/* normalize:
+ * If normalize is set, move first node to origin, then
+ * rotate graph so that first edge is horizontal.
+ * FIX: Generalize to allow rotation determined by graph shape.
+ */
+void normalize(graph_t * g)
 {
     node_t *v;
     edge_t *e;
@@ -723,7 +728,7 @@ static adjust_data *getAdjustMode(char *s)
        return adjustMode + 1;
 }
 
-void adjustNodes(graph_t * G)
+void removeOverlap(graph_t * G)
 {
     /* int          userWindow = 0; */
     char *flag;
@@ -736,7 +741,6 @@ void adjustNodes(graph_t * G)
 
     if (agnnodes(G) < 2)
        return;
-    normalize(G);
     flag = agget(G, "overlap");
     if (flag == NULL)
        return;
@@ -800,3 +804,12 @@ void adjustNodes(graph_t * G)
 /* fprintf (stderr, "old scale %.4f sec\n", elapsed_sec()); */
 
 }
+
+void adjustNodes(graph_t * G)
+{
+    if (agnnodes(G) < 2)
+       return;
+    normalize(G);
+    removeOverlap (G);
+}
+
index 251202b2d6b8517f03df2a385c3d2b6d9d7bbcd9..4168e8c9b1c8ce260dc36d3c8f9e831e4702644e 100644 (file)
@@ -24,6 +24,8 @@ extern "C" {
 #endif
 
     extern void adjustNodes(graph_t * G);
+    extern void normalize(graph_t * g);
+    extern void removeOverlap(graph_t * G);
 
 #ifdef __cplusplus
 }