Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
VertexOrder.h
Go to the documentation of this file.
1
34#pragma once
35
36#include <ogdf/basic/Graph.h>
38#include <ogdf/basic/List.h>
39#include <ogdf/basic/basic.h>
40
41#include <utility>
42#include <vector>
43
44namespace ogdf {
45
46enum class OrderEnum { asc, desc, rnd };
47enum class MeasureEnum { zero, log, sum, squared };
48
53private:
55
56 using QElement = std::pair<ogdf::node, unsigned int>;
57
58 std::vector<QElement> vertex_order;
61
62 void sort();
63
64 double crossings(int c);
65
66 void init_all();
67 void init();
68
69
70 void init_cr(edge e);
71
72public:
74 : ga(_ga), o(_o), m(_m) {
75 //nothing to do
76 }
77
79 init();
80 List<node> order;
81 for (auto v : vertex_order) {
82 order.pushBack(v.first);
83 }
84 return order;
85 }
86
88 vertex_order.clear();
89 init_cr(e);
90 List<node> order;
91 for (auto v : vertex_order) {
92 order.pushBack(v.first);
93 }
94 return order;
95 }
96};
97}
Includes declaration of graph class.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Declaration of doubly linked lists and iterators.
Basic declarations, included by all source files.
std::vector< QElement > vertex_order
Definition VertexOrder.h:58
List< node > get_vertex_order()
Definition VertexOrder.h:78
CrossingVertexOrder(GraphAttributes &_ga, OrderEnum _o, MeasureEnum _m)
Definition VertexOrder.h:73
std::pair< ogdf::node, unsigned int > QElement
Definition VertexOrder.h:56
List< node > get_vertex_order_by_crossed_edges(edge e)
Definition VertexOrder.h:87
Class for the representation of edges.
Definition Graph_d.h:364
Stores additional attributes of a graph (like layout information).
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
iterator pushBack(const E &x)
Adds element x at the end of the list.
Definition List.h:1547
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.
MeasureEnum
Definition VertexOrder.h:47