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/Module.h>
35 #include <ogdf/basic/Timeouter.h>
37 
38 namespace ogdf {
39 
49 class OGDF_EXPORT EmbedderModule : public Module, public Timeouter {
50 public:
53 
54  virtual ~EmbedderModule() { }
55 
63  void call(Graph& G, adjEntry& adjExternal) {
64  if (G.numberOfNodes() > 1 && G.numberOfEdges() > 1) {
66  doCall(G, adjExternal);
67  } else if (G.numberOfEdges() == 1) {
68  adjExternal = G.firstEdge()->adjSource();
69  }
70  };
71 
73  void operator()(Graph& G, adjEntry& adjExternal) { call(G, adjExternal); }
74 
76 protected:
82  virtual void doCall(Graph& G, adjEntry& adjExternal) = 0;
83 };
84 
85 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
OGDF_ASSERT
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition: basic.h:54
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:274
ogdf::EmbedderModule::operator()
void operator()(Graph &G, adjEntry &adjExternal)
Calls the embedder algorithm for graph G.
Definition: EmbedderModule.h:73
ogdf::EmbedderModule::call
void call(Graph &G, adjEntry &adjExternal)
Calls the embedder algorithm for graph G.
Definition: EmbedderModule.h:63
Timeouter.h
Declares base class for modules with timeout functionality.
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:135
OGDF_MALLOC_NEW_DELETE
#define OGDF_MALLOC_NEW_DELETE
Makes the class use malloc for memory allocation.
Definition: memory.h:91
ogdf::Module
Base class for modules.
Definition: Module.h:47
ogdf::EmbedderModule::EmbedderModule
EmbedderModule()
Initializes an embedder module.
Definition: EmbedderModule.h:52
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:862
ogdf::EmbedderModule::~EmbedderModule
virtual ~EmbedderModule()
Definition: EmbedderModule.h:54
ogdf::EmbedderModule
Base class for embedder algorithms.
Definition: EmbedderModule.h:49
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.