From 203ad14599575afb91084f3bb5351d4883110f05 Mon Sep 17 00:00:00 2001 From: erg Date: Fri, 21 Jan 2011 19:44:33 +0000 Subject: [PATCH] Make prism the default overlap removal algorithm --- lib/fdpgen/xlayout.c | 2 +- lib/neatogen/adjust.c | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/fdpgen/xlayout.c b/lib/fdpgen/xlayout.c index 608c3387f..ab3e6daa3 100644 --- a/lib/fdpgen/xlayout.c +++ b/lib/fdpgen/xlayout.c @@ -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) diff --git a/lib/neatogen/adjust.c b/lib/neatogen/adjust.c index e608f57a8..a795d3819 100644 --- a/lib/neatogen/adjust.c +++ b/lib/neatogen/adjust.c @@ -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; -- 2.40.0