Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

EmbedderModule.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
35 #include <ogdf/basic/Module.h>
36 #include <ogdf/basic/Timeouter.h>
37 #include <ogdf/basic/basic.h>
39 #include <ogdf/basic/memory.h>
40 
41 namespace ogdf {
42 
52 class OGDF_EXPORT EmbedderModule : public Module, public Timeouter {
53 public:
56 
57  virtual ~EmbedderModule() { }
58 
66  void call(Graph& G, adjEntry& adjExternal) {
67  if (G.numberOfNodes() > 1 && G.numberOfEdges() > 1) {
69  doCall(G, adjExternal);
70  } else if (G.numberOfEdges() == 1) {
71  adjExternal = G.firstEdge()->adjSource();
72  }
73  };
74 
76  void operator()(Graph& G, adjEntry& adjExternal) { call(G, adjExternal); }
77 
79 protected:
85  virtual void doCall(Graph& G, adjEntry& adjExternal) = 0;
86 };
87 
88 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
OGDF_ASSERT
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:66
extended_graph_alg.h
Declaration of extended graph algorithms.
ogdf::isPlanar
bool isPlanar(const Graph &G)
Returns true, if G is planar, false otherwise.
Definition: extended_graph_alg.h:284
ogdf::EmbedderModule::operator()
void operator()(Graph &G, adjEntry &adjExternal)
Calls the embedder algorithm for graph G.
Definition: EmbedderModule.h:76
ogdf::EmbedderModule::call
void call(Graph &G, adjEntry &adjExternal)
Calls the embedder algorithm for graph G.
Definition: EmbedderModule.h:66
Timeouter.h
Declares base class for modules with timeout functionality.
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:142
OGDF_MALLOC_NEW_DELETE
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
Definition: memory.h:92
ogdf::Module
Base class for modules.
Definition: Module.h:49
ogdf::EmbedderModule::EmbedderModule
EmbedderModule()
Initializes an embedder module.
Definition: EmbedderModule.h:55
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::EmbedderModule::~EmbedderModule
virtual ~EmbedderModule()
Definition: EmbedderModule.h:57
ogdf::EmbedderModule
Base class for embedder algorithms.
Definition: EmbedderModule.h:52
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::Timeouter
class for timeout funtionality.
Definition: Timeouter.h:46
Module.h
Declares base class for all module types.
memory.h
Declaration of memory manager for allocating small pieces of memory.