summaryrefslogtreecommitdiff
path: root/graphics/pgf/base/source/InterfaceFromOGDF.h
blob: bd742eb1610e8d756576e563ee2b47ecdd5c0068 (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
42
43
44
45
#ifndef PGF_GD_INTERFACE_C_INTERFACEFROMOGDF_H
#define PGF_GD_INTERFACE_C_INTERFACEFROMOGDF_H

/** \file pgf/gd/interface/c/InterfaceFromOGDF.h

    The C++-header file that should be used by algorithms written
    for the OGFD library when the algorithm should be included in Lua. 
*/

#include <pgf/gd/interface/c/InterfaceFromC++.h>
#include <ogdf/basic/Graph.h>
#include <ogdf/basic/GraphAttributes.h>

namespace scripting {
  
  class ogdf_runner : public runner {
  public:

    void bridge ();
    void unbridge ();
    
  protected:

    ogdf::Graph           graph;
    ogdf::GraphAttributes graph_attributes;
    
  };
  
  
  class ogdf_function_runner : public ogdf_runner {
  public:
    typedef void (*function) (run_parameters&,
			      ogdf::Graph&,
			      ogdf::GraphAttributes&);
    
    ogdf_function_runner (function f) : fun(f) {}
    virtual void run () { fun(*parameters, graph, graph_attributes); }

  private:
    function fun;
  };
}


#endif