Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

GraphUtils.h
Go to the documentation of this file.
1 
31 #pragma once
32 
33 #include <ogdf/basic/Graph.h>
34 #include <ogdf/basic/basic.h>
35 
36 #include <functional>
37 
38 namespace ogdf {
39 template<class E>
40 class List;
41 } // namespace ogdf
42 
43 namespace ogdf {
44 
46 OGDF_EXPORT void moveEnd(Graph& G, edge e, node keep_end, node new_end);
47 
49 OGDF_EXPORT void moveEnd(Graph& G, adjEntry keep_adj, adjEntry new_adj,
51 
53 OGDF_EXPORT edge splitEdge(Graph& G, edge old_edge, node new_adj_to_source, node new_adj_to_target,
54  edge new_edge = nullptr);
55 
57 OGDF_EXPORT adjEntry splitEdge(Graph& G, adjEntry adj, node new_adj_to_node, node new_adj_to_twin,
58  edge new_edge = nullptr);
59 
61 OGDF_EXPORT bool joinEdge(Graph& G, edge u_e, edge v_e, node u, node v);
62 
64 OGDF_EXPORT bool joinEdge(Graph& G, adjEntry u_adj, adjEntry v_adj, node u, node v);
65 
67 OGDF_EXPORT bool joinEdge(Graph& G, edge u_e, edge v_e, node u, node v,
68  const std::function<void(edge)>& deleteEdge);
69 
71 OGDF_EXPORT bool joinEdge(Graph& G, adjEntry u_adj, adjEntry v_adj, node u, node v,
72  const std::function<void(edge)>& deleteEdge);
73 
76 
79 
80 enum class OrderComp { SAME, REVERSED, DIFFERENT };
81 
83 OGDF_EXPORT OrderComp compareCyclicOrder(node n, List<adjEntry>& o, bool full_check = false);
84 
86 OGDF_EXPORT void moveAdjToFront(Graph& G, adjEntry f);
87 
89 OGDF_EXPORT void moveAdjToBack(Graph& G, adjEntry b);
90 
91 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::Direction
Direction
Definition: basic.h:150
Graph.h
Includes declaration of graph class.
ogdf::splitEdge
edge splitEdge(Graph &G, edge old_edge, node new_adj_to_source, node new_adj_to_target, edge new_edge=nullptr)
Split an edge, moving the two new middle endpoints to some other vertices.
ogdf::OrderComp::SAME
@ SAME
ogdf::joinEdge
bool joinEdge(Graph &G, edge u_e, edge v_e, node u, node v)
Join two edges into one, keeping the two given endpoints.
ogdf::OrderComp
OrderComp
Definition: GraphUtils.h:80
ogdf::getCentreOfStar
node getCentreOfStar(node g_n)
Given a vertex that is either the centre or ray of a star, return the centre of the respective star.
ogdf::moveEnd
void moveEnd(Graph &G, edge e, node keep_end, node new_end)
Change one endpoint of an edge, no matter its direction.
ogdf::adjEntry
AdjElement * adjEntry
The type of adjacency entries.
Definition: Graph_d.h:78
ogdf::edge
EdgeElement * edge
The type of edges.
Definition: Graph_d.h:74
ogdf::Direction::after
@ after
ogdf::node
NodeElement * node
The type of nodes.
Definition: Graph_d.h:70
ogdf::moveAdjToFront
void moveAdjToFront(Graph &G, adjEntry f)
Rotate a node to move a given adjEntry to the front of its list.
ogdf::compareCyclicOrder
OrderComp compareCyclicOrder(node n, List< adjEntry > &o, bool full_check=false)
Cyclically compare the rotation of a node with a given cyclic order.
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::assertStarCentreAndRay
void assertStarCentreAndRay(node centre, node ray)
Check that one vertex is the centre of star while the other is one of its rays.
ogdf::OrderComp::REVERSED
@ REVERSED
ogdf::OrderComp::DIFFERENT
@ DIFFERENT
ogdf::moveAdjToBack
void moveAdjToBack(Graph &G, adjEntry b)
Rotate a node to move a given adjEntry to the back of its list.