]> granicus.if.org Git - graphviz/commitdiff
Make prism the default overlap removal algorithm
authorerg <devnull@localhost>
Fri, 21 Jan 2011 19:44:33 +0000 (19:44 +0000)
committererg <devnull@localhost>
Fri, 21 Jan 2011 19:44:33 +0000 (19:44 +0000)
lib/fdpgen/xlayout.c
lib/neatogen/adjust.c

index 608c3387fefcc12d73046e2226915bd22fb003a3..ab3e6daa3996704abdce555ddd109abdb7a665a6 100644 (file)
@@ -43,7 +43,7 @@ Increase less between tries
 /* #define ORIG      */
 #define BOX    /* Use bbox to determine overlap, else use circles */
 
-#define DFLT_overlap   "9:portho"    /* default overlap value */
+#define DFLT_overlap   "9:prism"    /* default overlap value */
 
 #define WD2(n) (X_marg.doAdd ? (ND_width(n)/2.0 + X_marg.x): ND_width(n)*X_marg.x/2.0)
 #define HT2(n) (X_marg.doAdd ? (ND_height(n)/2.0 + X_marg.y): ND_height(n)*X_marg.y/2.0)
index e608f57a85617423ce15aab4ebeeca7695b7dbfb..a795d38193428361c7af77c8314d9af66f782533 100644 (file)
@@ -905,12 +905,22 @@ typedef struct {
 #define STRLEN(s) ((sizeof(s)-1)/sizeof(char))
 #define ITEM(i,s,v) {i, s, STRLEN(s), v}
 
+/* Translation table from overlap values to algorithms.
+ * adjustMode[0] corresponds to overlap=true
+ * adjustMode[1] corresponds to overlap=false
+ */
 static lookup_t adjustMode[] = {
     ITEM(AM_NONE, "", "none"),
-    ITEM(AM_VOR, "", "Voronoi"),
+#if ((defined(HAVE_GTS) || defined(HAVE_TRIANGLE)) && defined(SFDP))
+    ITEM(AM_PRISM, "prism", "prism"),
+#endif
+    ITEM(AM_NSCALE, "scale", "scaling"),
+    ITEM(AM_VOR, "voronoi", "Voronoi"),
+    ITEM(AM_COMPRESS, "compress", "compress"),
+    ITEM(AM_VPSC, "vpsc", "vpsc"),
+    ITEM(AM_IPSEP, "ipsep", "ipsep"),
     ITEM(AM_SCALE, "oscale", "old scaling"),
     ITEM(AM_SCALEXY, "scalexy", "x and y scaling"),
-    ITEM(AM_NSCALE, "scale", "scaling"),
     ITEM(AM_ORTHO, "ortho", "orthogonal constraints"),
     ITEM(AM_ORTHO_YX, "ortho_yx", "orthogonal constraints"),
     ITEM(AM_ORTHOXY, "orthoxy", "xy orthogonal constraints"),
@@ -919,12 +929,7 @@ static lookup_t adjustMode[] = {
     ITEM(AM_PORTHO_YX, "portho_yx", "pseudo-orthogonal constraints"),
     ITEM(AM_PORTHOXY, "porthoxy", "xy pseudo-orthogonal constraints"),
     ITEM(AM_PORTHOYX, "porthoyx", "yx pseudo-orthogonal constraints"),
-    ITEM(AM_COMPRESS, "compress", "compress"),
-    ITEM(AM_VPSC, "vpsc", "vpsc"),
-    ITEM(AM_IPSEP, "ipsep", "ipsep"),
-#if ((defined(HAVE_GTS) || defined(HAVE_TRIANGLE)) && defined(SFDP))
-    ITEM(AM_PRISM, "prism", "prism"),
-#else
+#if !((defined(HAVE_GTS) || defined(HAVE_TRIANGLE)) && defined(SFDP))
     ITEM(AM_PRISM, "prism", 0),
 #endif
     {AM_NONE, 0, 0, 0}
@@ -952,7 +957,7 @@ setPrismValues (Agraph_t* g, char* s, adjust_data* dp)
  */
 static adjust_data *getAdjustMode(Agraph_t* g, char *s, adjust_data* dp)
 {
-    lookup_t *ap = adjustMode + 2;
+    lookup_t *ap = adjustMode + 1;
     if (*s == '\0') {
        dp->mode = adjustMode[0].mode;
        dp->print = adjustMode[0].print;