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>
36 
37 namespace ogdf {
38 namespace internal {
39 namespace gcm {
40 namespace tools {
41 
42 inline bool equal(const node a, const node b) { return a->index() == b->index(); }
43 
44 inline bool equal(const edge& a, const edge& b) {
45  return equal(a->source(), b->source()) && equal(a->target(), b->target());
46 }
47 
48 inline bool equal(const face& a, const face& b) { return a->index() == b->index(); }
49 
50 inline std::vector<node> nodes_of_face(const face& face) {
51  std::vector<node> nodes;
52  adjEntry first = face->firstAdj();
53  adjEntry current = first;
54 
55  do {
56  nodes.push_back(current->theEdge()->source());
57  current = face->nextFaceEdge(current);
58  } while (current != first && current != NULL);
59  return nodes;
60 }
61 
62 }
63 }
64 }
65 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
GraphAttributes.h
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Graph.h
Includes declaration of graph class.
ogdf::internal::gcm::tools::equal
bool equal(const node a, const node b)
Definition: Universal.h:42
ogdf::NodeElement::index
int index() const
Returns the (unique) node index.
Definition: Graph_d.h:267
ogdf::internal::gcm::tools::nodes_of_face
std::vector< node > nodes_of_face(const face &face)
Definition: Universal.h:50
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:135
ogdf::FaceElement::firstAdj
adjEntry firstAdj() const
Returns the first adjacency element in the face.
Definition: CombinatorialEmbedding.h:139
ogdf::AdjElement::theEdge
edge theEdge() const
Returns the edge associated with this adjacency entry.
Definition: Graph_d.h:153
ogdf::EdgeElement::source
node source() const
Returns the source node of the edge.
Definition: Graph_d.h:391
ogdf::FaceElement::index
int index() const
Returns the index of the face.
Definition: CombinatorialEmbedding.h:136
CombinatorialEmbedding.h
Declaration of CombinatorialEmbedding and face.
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:356
ogdf::EdgeElement::target
node target() const
Returns the target node of the edge.
Definition: Graph_d.h:394
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:151
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::FaceElement
Faces in a combinatorial embedding.
Definition: CombinatorialEmbedding.h:109