From e0c6872cf40896c7be36b11dcc744620f10adf1d Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 2 Sep 2019 13:46:59 +0900 Subject: Initial commit --- graphics/pgf/base/source/FMMMLayout_script.h | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 graphics/pgf/base/source/FMMMLayout_script.h (limited to 'graphics/pgf/base/source/FMMMLayout_script.h') diff --git a/graphics/pgf/base/source/FMMMLayout_script.h b/graphics/pgf/base/source/FMMMLayout_script.h new file mode 100644 index 0000000000..bdaf26bf67 --- /dev/null +++ b/graphics/pgf/base/source/FMMMLayout_script.h @@ -0,0 +1,44 @@ +#include +#include + +struct FMMMLayout_script : + scripting::declarations, + scripting::ogdf_runner +{ + void run () { + using namespace ogdf; + FMMMLayout layout; + + layout.newInitialPlacement(false); + layout.qualityVersusSpeed(FMMMLayout::qvsGorgeousAndEfficient); + + parameters->configure_option ("FMMMLayout.unitEdgeLength", + &FMMMLayout::unitEdgeLength, layout); + parameters->configure_option ("FMMMLayout.randSeed", + &FMMMLayout::randSeed, layout); + + layout.call (graph_attributes); + } + + void declare (scripting::script s) { + using namespace scripting; + using namespace ogdf; + s.declare (key ("FMMMLayout") + .precondition ("connected") + .algorithm (this) + .documentation_in ("pgf.gd.doc.ogdf.energybased.FMMMLayout")); + + s.declare (key ("FMMMLayout.randSeed") + .type ("number") + .initial ("42") + .alias ("random seed") + .documentation_in ("pgf.gd.doc.ogdf.energybased.FMMMLayout")); + + s.declare (key ("FMMMLayout.unitEdgeLength") + .type ("length") + .initial ("1cm") + .alias_function ("function (o) return o['node pre sep'] + o['node post sep'] end") + .documentation_in ("pgf.gd.doc.ogdf.energybased.FMMMLayout")); + } + +}; -- cgit v1.2.3