]> granicus.if.org Git - graphviz/commitdiff
Add pseudo layout engines:
authorellson <devnull@localhost>
Fri, 13 Jan 2006 16:36:27 +0000 (16:36 +0000)
committerellson <devnull@localhost>
Fri, 13 Jan 2006 16:36:27 +0000 (16:36 +0000)
dot -Knop   ==  neato -n1
dot -Knop1  ==  neato -n1
dot -Knop2  ==  neato -n2
These are needed primarily by the script bindings.

plugin/neato_layout/gvlayout_neato_layout.c

index b7f73b250078a59788ef7422c630a3380676ae44..79d68d74f0800686bb10634c1331bc65fe76dd3f 100644 (file)
@@ -27,6 +27,8 @@
 #include <stdio.h>
 
 #include "types.h"
+/* FIXME - globals.h is needed for Nop */
+#include "globals.h"
 
 #include "gvplugin_layout.h"
 
@@ -34,6 +36,8 @@ typedef enum { LAYOUT_NEATO,
                LAYOUT_FDP,
                LAYOUT_TWOPI,
                LAYOUT_CIRCO,
+               LAYOUT_NOP1,
+               LAYOUT_NOP2,
        } layout_type;
 
 extern void neato_layout(graph_t * g);
@@ -46,6 +50,18 @@ extern void fdp_cleanup(graph_t * g);
 extern void twopi_cleanup(graph_t * g);
 extern void circo_cleanup(graph_t * g);
 
+static void nop1_layout(graph_t * g)
+{
+    Nop = 1;
+    neato_layout(g);
+}
+
+static void nop2_layout(graph_t * g)
+{
+    Nop = 2;
+    neato_layout(g);
+}
+
 gvlayout_engine_t neatogen_engine = {
     neato_layout,
     neato_cleanup,
@@ -66,6 +82,16 @@ gvlayout_engine_t circogen_engine = {
     circo_cleanup,
 };
 
+gvlayout_engine_t nop1gen_engine = {
+    nop1_layout,
+    neato_cleanup,
+};
+
+gvlayout_engine_t nop2gen_engine = {
+    nop2_layout,
+    neato_cleanup,
+};
+
 gvlayout_features_t neatogen_features = {
         0,
 };
@@ -75,5 +101,8 @@ gvplugin_installed_t gvlayout_neato_types[] = {
     {LAYOUT_FDP, "fdp", 0, &fdpgen_engine, &neatogen_features},
     {LAYOUT_TWOPI, "twopi", 0, &twopigen_engine, &neatogen_features},
     {LAYOUT_CIRCO, "circo", 0, &circogen_engine, &neatogen_features},
+    {LAYOUT_NOP1, "nop", 0, &nop1gen_engine, &neatogen_features},
+    {LAYOUT_NOP1, "nop1", 0, &nop1gen_engine, &neatogen_features},
+    {LAYOUT_NOP1, "nop2", 0, &nop2gen_engine, &neatogen_features},
     {0, NULL, 0, NULL, NULL}
 };