From: erg Date: Thu, 11 May 2006 21:47:36 +0000 (+0000) Subject: Rationalize attributes used in ipsep mode, making them more X-Git-Tag: LAST_LIBGRAPH~32^2~6621 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1e798ae1bbec67bf20ab572aef16219fc543f80b;p=graphviz Rationalize attributes used in ipsep mode, making them more integrated with other attributes. This also prepares the way to pull the post-processing overlap removal in ipsep out, and make it generally available in adjust. --- diff --git a/lib/neatogen/adjust.c b/lib/neatogen/adjust.c index 66adba52e..dac891099 100644 --- a/lib/neatogen/adjust.c +++ b/lib/neatogen/adjust.c @@ -678,11 +678,6 @@ void normalize(graph_t * g) } } -typedef struct { - adjust_mode mode; - char *attrib; - char *print; -} adjust_data; static adjust_data adjustMode[] = { {AM_NONE, "", ""}, {AM_VOR, "", "Voronoi"}, @@ -700,6 +695,8 @@ static adjust_data adjustMode[] = { {AM_PORTHOXY, "porthoxy", "xy pseudo-orthogonal constraints"}, {AM_PORTHOYX, "porthoyx", "yx pseudo-orthogonal constraints"}, {AM_COMPRESS, "compress", "compress"}, + {AM_VPSC, "vpsc", "vpsc"}, + {AM_IPSEP, "ipsep", "ipsep"}, {AM_NONE, 0, 0} }; @@ -722,6 +719,11 @@ static adjust_data *getAdjustMode(char *s) return adjustMode + 1; } +adjust_data *graphAdjustMode(graph_t *G) +{ + return (getAdjustMode (agget(G, "overlap"))); +} + /* removeOverlapAs: * Use flag value to determine if and how to remove * node overlaps. diff --git a/lib/neatogen/adjust.h b/lib/neatogen/adjust.h index f2b9c8b5c..91060dad4 100644 --- a/lib/neatogen/adjust.h +++ b/lib/neatogen/adjust.h @@ -27,9 +27,16 @@ typedef enum { AM_NONE, AM_VOR, AM_COMPRESS, AM_SCALE, AM_NSCALE, AM_SCALEXY, AM_PUSH, AM_PUSHPULL, AM_ORTHO, AM_ORTHO_YX, AM_ORTHOXY, AM_ORTHOYX, - AM_PORTHO, AM_PORTHO_YX, AM_PORTHOXY, AM_PORTHOYX + AM_PORTHO, AM_PORTHO_YX, AM_PORTHOXY, AM_PORTHOYX, + AM_VPSC, AM_IPSEP } adjust_mode; +typedef struct { + adjust_mode mode; + char *attrib; + char *print; +} adjust_data; + extern double expFactor(graph_t * G); extern int adjustNodes(graph_t * G); extern void normalize(graph_t * g); @@ -37,6 +44,7 @@ typedef enum { extern int removeOverlapAs(graph_t*, char*); extern int cAdjust(graph_t *, int); extern int scAdjust(graph_t *, int); + extern adjust_data *graphAdjustMode(graph_t *G); #ifdef __cplusplus } diff --git a/lib/neatogen/neatoinit.c b/lib/neatogen/neatoinit.c index 399a16913..5e8054bb9 100644 --- a/lib/neatogen/neatoinit.c +++ b/lib/neatogen/neatoinit.c @@ -1140,6 +1140,7 @@ majorization(graph_t *mg, graph_t * g, int nv, int mode, int model, int dim, int #ifdef IPSEPCOLA else { char* str; + adjust_data* am; ipsep_options opt; pointf nsize[nv]; cluster_data *cs = (cluster_data*)cluster_map(mg,g); @@ -1160,12 +1161,12 @@ majorization(graph_t *mg, graph_t * g, int nv, int mode, int model, int dim, int fprintf(stderr,"Generating DiG-CoLa Edge Constraints...\n"); } else opt.diredges = 0; - str = agget(g, "overlapconstraints"); - if (mapbool(str)) { + am = graphAdjustMode (g); + if (am->mode == AM_IPSEP) { opt.noverlap = 1; if(Verbose) fprintf(stderr,"Generating Non-overlap Constraints...\n"); - } else if (str && !strncasecmp(str,"post",4)) { + } else if (am->mode == AM_VPSC) { opt.noverlap = 2; if(Verbose) fprintf(stderr,"Removing overlaps as postprocess...\n");