Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
Converter.h
Go to the documentation of this file.
1
31#pragma once
32
33#ifdef OGDF_INCLUDE_CGAL
34
36# include <ogdf/basic/Graph.h>
40
41# include <map>
42
43namespace ogdf {
44namespace internal {
45namespace gcm {
46namespace tools {
47
48template<typename kernel>
49geometry::Point_t<kernel> extract_point(const GraphAttributes& ga, const node node) {
50 return {ga.x(node), ga.y(node)};
51}
52
53template<typename kernel>
54geometry::LineSegment_t<kernel> extract_segment(const GraphAttributes& ga, const edge& edge) {
56}
57
58template<typename Graph, typename Polygon>
59void extract_polygon(const Graph& g, const face& face, Polygon& p) {
60 adjEntry first = face->firstAdj();
61 adjEntry current = first;
62 do {
63 p.push_back(g.get_point(current->theNode()));
65 OGDF_ASSERT(current != nullptr);
66 } while (current != first);
67}
68
69template<typename kernel, typename Polygon>
70void extract_polygon(const GraphAttributes& ga, const face& face,
71 NodeArray<unsigned int>& node_to_id, Polygon& p) {
72 adjEntry first = face->firstAdj();
73 adjEntry current = first;
74
75 do {
76 node_to_id[current->theEdge()->source()] = p.size();
77 p.push_back(extract_point<kernel>(ga, current->theEdge()->source()));
79 } while (current != nullptr);
80}
81
82}
83}
84}
85}
86
87#endif
Declaration of CombinatorialEmbedding and face.
Includes declaration of graph class.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
adjEntry faceCycleSucc() const
Returns the cyclic successor in face.
Definition Graph_d.h:149
node target() const
Returns the target node of the edge.
Definition Graph_d.h:338
node source() const
Returns the source node of the edge.
Definition Graph_d.h:335
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.
AdjElement * adjEntry
The type of adjacency entries.
Definition Graph_d.h:72
NodeElement * node
The type of nodes.
Definition Graph_d.h:64
EdgeElement * edge
The type of edges.
Definition Graph_d.h:68
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Definition basic.h:41
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
FaceElement * face