Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Hierarchy.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/GraphCopy.h>
37 #include <ogdf/basic/basic.h>
38 
39 namespace ogdf {
40 template<class E>
41 class List;
42 
44 
48  friend class LayerBasedUPRLayout;
49 
53 
54 public:
56  Hierarchy() { }
57 
59  Hierarchy(const Graph& G, const NodeArray<int>& rank);
60 
61  // destruction
62  ~Hierarchy() { }
63 
64  void createEmpty(const Graph& G);
65  void initByNodes(const List<node>& nodes, EdgeArray<edge>& eCopy, const NodeArray<int>& rank);
66 
68  operator const GraphCopy&() const { return m_GC; }
69 
71  int rank(node v) const { return m_rank[v]; }
72 
73  int maxRank() const { return m_size.high(); }
74 
75  int size(int i) const { return m_size[i]; }
76 
77  bool isLongEdgeDummy(node v) const { return m_GC.isDummy(v) && v->outdeg() == 1; }
78 
79 private:
80  void doInit(const NodeArray<int>& rank);
81 };
82 
83 }
ogdf::Hierarchy::size
int size(int i) const
Definition: Hierarchy.h:75
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::GraphCopyBase::isDummy
bool isDummy(node v) const
Returns true iff v has no corresponding node in the original graph.
Definition: GraphCopy.h:173
ogdf::Hierarchy::Hierarchy
Hierarchy()
Creates an empty hierarchy.
Definition: Hierarchy.h:56
ogdf::Array::high
INDEX high() const
Returns the maximal array index.
Definition: Array.h:299
ogdf::Hierarchy::m_size
Array< int > m_size
Definition: Hierarchy.h:52
ogdf::GraphCopy
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:391
ogdf::Hierarchy
Representation of proper hierarchies used by Sugiyama-layout.
Definition: Hierarchy.h:47
ogdf::Hierarchy::~Hierarchy
~Hierarchy()
Definition: Hierarchy.h:62
ogdf::LayerBasedUPRLayout
Definition: LayerBasedUPRLayout.h:109
ogdf::Hierarchy::m_rank
NodeArray< int > m_rank
The rank (level) of a node.
Definition: Hierarchy.h:51
ogdf::NodeElement::outdeg
int outdeg() const
Returns the outdegree of the node.
Definition: Graph_d.h:280
ogdf::Array< int >
GraphCopy.h
Declaration of graph copy classes.
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::Hierarchy::m_GC
GraphCopy m_GC
The graph copy representing the topology of the proper hierarchy.
Definition: Hierarchy.h:50
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::Hierarchy::isLongEdgeDummy
bool isLongEdgeDummy(node v) const
Definition: Hierarchy.h:77
ogdf::Hierarchy::rank
int rank(node v) const
Returns the rank (level) of node v.
Definition: Hierarchy.h:71
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::Hierarchy::maxRank
int maxRank() const
Definition: Hierarchy.h:73
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716