# OpenGraph DrawingFramework

v. 2023.09 (Elderberry)

Searching...
No Matches
CrossingMinInterfaces.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
36
37namespace ogdf {
38
40
43class LevelBase {
44public:
45 // destruction
46 virtual ~LevelBase() { }
47
49 virtual const node& operator[](int i) const = 0;
50
52 virtual node& operator[](int i) = 0;
53
55 virtual int size() const = 0;
56
58 virtual int high() const = 0;
59};
60
62public:
64
67
68 // destruction
70
71 enum class TraversingDir { downward, upward };
72
74 virtual const LevelBase& operator[](int i) const = 0;
75
77 virtual int pos(node v) const = 0;
78
80 virtual int size() const = 0;
81
83 virtual int high() const { return size() - 1; }
84
85 virtual const Hierarchy& hierarchy() const = 0;
86
88 virtual const Array<node>& adjNodes(node v, TraversingDir dir) const = 0;
89
91 int calculateCrossings(int i) const;
92
94 int calculateCrossings() const;
95};
96
97}
Includes declaration of graph class.
Declaration of Hierarchy class.
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:214
Representation of proper hierarchies used by Sugiyama-layout.
Definition Hierarchy.h:43
int calculateCrossings(int i) const
Computes the number of crossings between level i and i+1.
HierarchyLevelsBase(const HierarchyLevelsBase &)=default
virtual const Array< node > & adjNodes(node v, TraversingDir dir) const =0
Returns the adjacent nodes of v.
virtual const Hierarchy & hierarchy() const =0
HierarchyLevelsBase & operator=(const HierarchyLevelsBase &)=default
int calculateCrossings() const
Computes the total number of crossings.
virtual int size() const =0
Returns the number of levels.
virtual const LevelBase & operator[](int i) const =0
Returns the i-th level.
virtual int high() const
Returns the maximal array index of a level (= size()-1).
virtual int pos(node v) const =0
Returns the position of node v on its level.
Representation of levels in hierarchies.
virtual int high() const =0
Returns the maximal array index (= size()-1).
virtual node & operator[](int i)=0
Returns the node at position i.
virtual int size() const =0
Returns the number of nodes on this level.
virtual const node & operator[](int i) const =0
Returns the node at position i.
Class for the representation of nodes.
Definition Graph_d.h:177
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
The namespace for all OGDF objects.