Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
Universal.h
Go to the documentation of this file.
1
31#pragma once
32
34#include <ogdf/basic/Graph.h>
35
36#include <cstddef>
37#include <vector>
38
39namespace ogdf {
40namespace internal {
41namespace gcm {
42namespace tools {
43
44inline bool equal(const node a, const node b) { return a->index() == b->index(); }
45
46inline bool equal(const edge& a, const edge& b) {
47 return equal(a->source(), b->source()) && equal(a->target(), b->target());
48}
49
50inline bool equal(const face& a, const face& b) { return a->index() == b->index(); }
51
52inline std::vector<node> nodes_of_face(const face& face) {
53 std::vector<node> nodes;
54 adjEntry first = face->firstAdj();
55 adjEntry current = first;
56
57 do {
58 nodes.push_back(current->theEdge()->source());
59 current = face->nextFaceEdge(current);
60 } while (current != first && current != NULL);
61 return nodes;
62}
63
64}
65}
66}
67}
Declaration of CombinatorialEmbedding and face.
Includes declaration of graph class.
Class for adjacency list elements.
Definition Graph_d.h:143
edge theEdge() const
Returns the edge associated with this adjacency entry.
Definition Graph_d.h:161
Class for the representation of edges.
Definition Graph_d.h:364
node target() const
Returns the target node of the edge.
Definition Graph_d.h:402
node source() const
Returns the source node of the edge.
Definition Graph_d.h:399
Faces in a combinatorial embedding.
adjEntry nextFaceEdge(adjEntry adj) const
Returns the successor of adj in the list of all adjacency elements in the face.
adjEntry firstAdj() const
Returns the first adjacency element in the face.
int index() const
Returns the index of the face.
Class for the representation of nodes.
Definition Graph_d.h:241
int index() const
Returns the (unique) node index.
Definition Graph_d.h:275
bool equal(const node a, const node b)
Definition Universal.h:44
std::vector< node > nodes_of_face(const face &face)
Definition Universal.h:52
The namespace for all OGDF objects.