]> granicus.if.org Git - graphviz/commitdiff
Implement esep attribute to allow graph to specify room around
authorerg <devnull@localhost>
Fri, 17 Feb 2006 20:35:34 +0000 (20:35 +0000)
committererg <devnull@localhost>
Fri, 17 Feb 2006 20:35:34 +0000 (20:35 +0000)
nodes for spline routing.

lib/common/const.h
lib/neatogen/adjust.c
lib/neatogen/neatosplines.c

index c99c07bede84d6689f357cde7ab699b90cd991fb..a43d503a786a527d72a96d8d4e90dae9e8eb5b51 100644 (file)
 #define Spring_coeff    1.0
 #define MYHUGE          (1.0e+37)
 #define MAXDIM                 10
+#define SEPFACT         0.8  /* default esep/sep */
 
 /* drawing phases */
 #define GVBEGIN         0
index 2f2a8c65e8ff142efb6a2cacacf7ad901802dfd3..66adba52ec34e933e077ea4529e186dbdda1f786 100644 (file)
@@ -834,9 +834,11 @@ expFactor(graph_t* g)
     double pmargin;
     char*  marg;
 
-    if ((marg = agget(g, "sep"))) {
+    if ((marg = agget(g, "sep")))
        pmargin = 1.0 + atof(marg);
-    } else
+    else if ((marg = agget(g, "esep")))
+       pmargin = 1.0 + atof(marg)/SEPFACT;
+    else
        pmargin = 1.1;
     return pmargin;
 }
index b5a8b77d52a76a05d6479f20854605efddbbe015..8e37ce32cdc5e8c52249db086d3c3249192fdce6 100644 (file)
@@ -692,13 +692,18 @@ splineEdges(graph_t * g, int (*edgefn) (graph_t *, double, int),
     edge_t *e;
     double SEP;
     Dt_t *map;
+    char* marg;
 
     /* This value should be independent of the sep value used to expand
      * nodes during adjustment. If not, when the adjustment pass produces
      * a fairly tight layout, the spline code will find that some nodes
      * still overlap.
      */
-    SEP = 1.01;
+    if ((marg = agget(g, "esep")))
+       SEP = 1.0 + atof(marg);
+    else 
+          /* expFactor = 1 + "sep" value */
+       SEP = 1.0 + SEPFACT*(expFactor(g) - 1.0); 
 
     /* find equivalent edges */
     map = dtopen(&edgeItemDisc, Dtoset);