]> granicus.if.org Git - graphviz/commitdiff
Rationalize attributes used in ipsep mode, making them more
authorerg <devnull@localhost>
Thu, 11 May 2006 21:47:36 +0000 (21:47 +0000)
committererg <devnull@localhost>
Thu, 11 May 2006 21:47:36 +0000 (21:47 +0000)
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.

lib/neatogen/adjust.c
lib/neatogen/adjust.h
lib/neatogen/neatoinit.c

index 66adba52ec34e933e077ea4529e186dbdda1f786..dac89109982341e1177c8c95f628a37a47f7dc5b 100644 (file)
@@ -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.
index f2b9c8b5c33aef0df5bf73f0c8b4a88d3714f802..91060dad4b5af188bec95cdcefbabeead6ece2f9 100644 (file)
@@ -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
 }
index 399a169139d7bcf08b59806ff8c3d753e3948bf6..5e8054bb9dd232b07b15253a4f07b2c149307e35 100644 (file)
@@ -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");