summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/source/SugiyamaLayout_script.h
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/base/source/SugiyamaLayout_script.h')
-rw-r--r--graphics/pgf/base/source/SugiyamaLayout_script.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/graphics/pgf/base/source/SugiyamaLayout_script.h b/graphics/pgf/base/source/SugiyamaLayout_script.h
new file mode 100644
index 0000000000..c9cf097373
--- /dev/null
+++ b/graphics/pgf/base/source/SugiyamaLayout_script.h
@@ -0,0 +1,54 @@
+#include <pgf/gd/ogdf/c/InterfaceFromOGDF.h>
+#include <ogdf/layered/SugiyamaLayout.h>
+
+struct SugiyamaLayout_script :
+ scripting::declarations,
+ scripting::ogdf_runner
+{
+ void run () {
+ using namespace ogdf;
+ SugiyamaLayout layout;
+
+ parameters->configure_option ("SugiyamaLayout.runs",
+ &SugiyamaLayout::runs, layout);
+ parameters->configure_option ("SugiyamaLayout.transpose",
+ &SugiyamaLayout::transpose, layout);
+ parameters->configure_option ("SugiyamaLayout.fails",
+ &SugiyamaLayout::fails, layout);
+
+ parameters->configure_module ("RankingModule",
+ &SugiyamaLayout::setRanking, layout);
+ parameters->configure_module ("TwoLayerCrossMin",
+ &SugiyamaLayout::setCrossMin, layout);
+ parameters->configure_module ("HierarchyLayoutModule",
+ &SugiyamaLayout::setLayout, layout);
+
+ layout.call (graph_attributes);
+ }
+
+ void declare (scripting::script s) {
+ using namespace scripting;
+ using namespace ogdf;
+ s.declare (key ("SugiyamaLayout")
+ .precondition ("connected")
+ .postcondition ("upward_oriented_swapped")
+ .algorithm (this)
+ .documentation_in ("pgf.gd.doc.ogdf.layered.SugiyamaLayout"));
+
+ s.declare (key ("SugiyamaLayout.runs")
+ .type ("number")
+ .initial ("15")
+ .documentation_in ("pgf.gd.doc.ogdf.layered.SugiyamaLayout"));
+
+ s.declare (key ("SugiyamaLayout.transpose")
+ .type ("boolean")
+ .initial ("true")
+ .documentation_in ("pgf.gd.doc.ogdf.layered.SugiyamaLayout"));
+
+ s.declare (key ("SugiyamaLayout.fails")
+ .type ("number")
+ .initial ("4")
+ .documentation_in ("pgf.gd.doc.ogdf.layered.SugiyamaLayout"));
+ }
+
+};