Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

CrossingMinInterfaces.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Array.h>
35 #include <ogdf/basic/Graph.h>
36 #include <ogdf/basic/basic.h>
37 
38 namespace ogdf {
39 class Hierarchy;
40 
42 
45 class LevelBase {
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 
64 public:
65  HierarchyLevelsBase() = default;
66 
67  HierarchyLevelsBase(const HierarchyLevelsBase&) = default;
68  HierarchyLevelsBase& operator=(const HierarchyLevelsBase&) = default;
69 
70  // destruction
71  virtual ~HierarchyLevelsBase() { }
72 
73  enum class TraversingDir { downward, upward };
74 
76  virtual const LevelBase& operator[](int i) const = 0;
77 
79  virtual int pos(node v) const = 0;
80 
82  virtual int size() const = 0;
83 
85  virtual int high() const { return size() - 1; }
86 
87  virtual const Hierarchy& hierarchy() const = 0;
88 
90  virtual const Array<node>& adjNodes(node v, TraversingDir dir) const = 0;
91 
93  int calculateCrossings(int i) const;
94 
96  int calculateCrossings() const;
97 };
98 
99 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::HierarchyLevelsBase::~HierarchyLevelsBase
virtual ~HierarchyLevelsBase()
Definition: CrossingMinInterfaces.h:71
ogdf::Hierarchy
Representation of proper hierarchies used by Sugiyama-layout.
Definition: Hierarchy.h:47
ogdf::HierarchyLevelsBase
Definition: CrossingMinInterfaces.h:63
ogdf::HierarchyLevelsBase::TraversingDir
TraversingDir
Definition: CrossingMinInterfaces.h:73
ogdf::LevelBase::high
virtual int high() const =0
Returns the maximal array index (= size()-1).
ogdf::Array< node >
ogdf::HierarchyLevelsBase::high
virtual int high() const
Returns the maximal array index of a level (= size()-1).
Definition: CrossingMinInterfaces.h:85
ogdf::LevelBase::operator[]
virtual const node & operator[](int i) const =0
Returns the node at position i.
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
Array.h
Declaration and implementation of Array class and Array algorithms.
ogdf::LevelBase::~LevelBase
virtual ~LevelBase()
Definition: CrossingMinInterfaces.h:48
ogdf::LevelBase::size
virtual int size() const =0
Returns the number of nodes on this level.
ogdf::LevelBase
Representation of levels in hierarchies.
Definition: CrossingMinInterfaces.h:45
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240