Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

CrossingMinInterfaces.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
35 #include <ogdf/layered/Hierarchy.h>
36 
37 
38 namespace ogdf {
39 
41 
44 class LevelBase
45 {
46 public:
47  // destruction
48  virtual ~LevelBase() { }
49 
51  virtual const node &operator[](int i) const = 0;
52 
54  virtual node &operator[](int i) = 0;
55 
57  virtual int size() const = 0;
58 
60  virtual int high() const = 0;
61 };
62 
63 
64 
66 
67 public:
68  HierarchyLevelsBase() = default;
69 
70  HierarchyLevelsBase(const HierarchyLevelsBase&) = default;
71  HierarchyLevelsBase& operator=(const HierarchyLevelsBase&) = default;
72 
73  // destruction
74  virtual ~HierarchyLevelsBase() { }
75 
76  enum class TraversingDir { downward, upward };
77 
79  virtual const LevelBase &operator[](int i) const = 0;
80 
82  virtual int pos(node v) const = 0;
83 
85  virtual int size() const = 0;
86 
88  virtual int high() const { return size() - 1; }
89 
90  virtual const Hierarchy &hierarchy() const = 0;
91 
93  virtual const Array<node> &adjNodes(node v, TraversingDir dir) const = 0;
94 
96  int calculateCrossings(int i) const;
97 
99  int calculateCrossings() const;
100 };
101 
102 }
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
virtual int high() const
Returns the maximal array index of a level (= size()-1).
Representation of levels in hierarchies.
Declaration of Hierarchy class.
virtual int high() const =0
Returns the maximal array index (= size()-1).
virtual const node & operator[](int i) const =0
Returns the node at position i.
Class for the representation of nodes.
Definition: Graph_d.h:169
Includes declaration of graph class.
The namespace for all OGDF objects.
virtual int size() const =0
Returns the number of nodes on this level.
Representation of proper hierarchies used by Sugiyama-layout.
Definition: Hierarchy.h:44