Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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 
39 namespace ogdf {
40 namespace internal {
41 namespace gcm {
42 namespace tools {
43 
44 inline bool equal(const node a, const node b) { return a->index() == b->index(); }
45 
46 inline bool equal(const edge& a, const edge& b) {
47  return equal(a->source(), b->source()) && equal(a->target(), b->target());
48 }
49 
50 inline bool equal(const face& a, const face& b) { return a->index() == b->index(); }
51 
52 inline 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 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::internal::gcm::tools::equal
bool equal(const node a, const node b)
Definition: Universal.h:44
ogdf::NodeElement::index
int index() const
Returns the (unique) node index.
Definition: Graph_d.h:274
ogdf::internal::gcm::tools::nodes_of_face
std::vector< node > nodes_of_face(const face &face)
Definition: Universal.h:52
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:142
ogdf::FaceElement::firstAdj
adjEntry firstAdj() const
Returns the first adjacency element in the face.
Definition: CombinatorialEmbedding.h:148
ogdf::AdjElement::theEdge
edge theEdge() const
Returns the edge associated with this adjacency entry.
Definition: Graph_d.h:160
ogdf::EdgeElement::source
node source() const
Returns the source node of the edge.
Definition: Graph_d.h:398
ogdf::FaceElement::index
int index() const
Returns the index of the face.
Definition: CombinatorialEmbedding.h:145
CombinatorialEmbedding.h
Declaration of CombinatorialEmbedding and face.
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:363
ogdf::EdgeElement::target
node target() const
Returns the target node of the edge.
Definition: Graph_d.h:401
ogdf::FaceElement::nextFaceEdge
adjEntry nextFaceEdge(adjEntry adj) const
Returns the successor of adj in the list of all adjacency elements in the face.
Definition: CombinatorialEmbedding.h:160
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::FaceElement
Faces in a combinatorial embedding.
Definition: CombinatorialEmbedding.h:118