summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/source/FastSimpleHierarchyLayout_script.h
blob: 37c6c94bc052308d1061278d1cbcc1148c6d2c95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <pgf/gd/ogdf/c/InterfaceFromOGDF.h>
#include <ogdf/layered/FastSimpleHierarchyLayout.h>

struct FastSimpleHierarchyLayout_script :
  scripting::declarations,
  scripting::factory<ogdf::FastSimpleHierarchyLayout>
{
  
  ogdf::FastSimpleHierarchyLayout* make (scripting::run_parameters* parameters) {
    using namespace ogdf;
    
    FastSimpleHierarchyLayout* r = new FastSimpleHierarchyLayout
      (
       parameters->option<int> ("FastSimpleHierarchyLayout.siblingDistance"),
       parameters->option<int> ("FastSimpleHierarchyLayout.layerDistance")
      );
    
    return r;
  }
  
  void declare (scripting::script s) {
    using namespace scripting;
    using namespace ogdf;

    s.declare (key ("FastSimpleHierarchyLayout")
	       .documentation_in ("pgf.gd.doc.ogdf.layered.FastSimpleHierarchyLayout")
	       .set_module ("HierarchyLayoutModule", this));

    s.declare (key ("FastSimpleHierarchyLayout.layerDistance")
	       .type ("length")
	       .alias ("level distance")
	       .documentation_in ("pgf.gd.doc.ogdf.layered.FastSimpleHierarchyLayout"));

    s.declare (key ("FastSimpleHierarchyLayout.siblingDistance")
	       .type ("length")
	       .alias ("sibling distance")
	       .documentation_in ("pgf.gd.doc.ogdf.layered.FastSimpleHierarchyLayout"));
  }
};