Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

Hierarchy.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/EdgeArray.h>
35 #include <ogdf/basic/GraphCopy.h>
36 
37 
38 namespace ogdf {
39 
41 
45 
46  friend class LayerBasedUPRLayout;
47 
51 
52 public:
54  Hierarchy() { }
56  Hierarchy(const Graph &G, const NodeArray<int> &rank);
57 
58  // destruction
59  ~Hierarchy() { }
60 
61  void createEmpty(const Graph &G);
62  void initByNodes(const List<node> &nodes,
63  EdgeArray<edge> &eCopy,
64  const NodeArray<int> &rank);
65 
67  operator const GraphCopy &() const { return m_GC; }
68 
70  int rank(node v) const { return m_rank[v]; }
71 
72  int maxRank() const { return m_size.high(); }
73 
74  int size(int i) const { return m_size[i]; }
75 
76  bool isLongEdgeDummy(node v) const {
77  return (m_GC.isDummy(v) && v->outdeg() == 1);
78  }
79 
80 private:
81  void doInit(const NodeArray<int> &rank);
82 };
83 
84 } // end namespace ogdf
NodeArray< int > m_rank
The rank (level) of a node.
Definition: Hierarchy.h:49
bool isLongEdgeDummy(node v) const
Definition: Hierarchy.h:76
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:472
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
int size(int i) const
Definition: Hierarchy.h:74
INDEX high() const
Returns the maximal array index.
Definition: Array.h:131
int outdeg() const
Returns the outdegree of the node.
Definition: Graph_d.h:206
Dynamic arrays indexed with edges.
Definition: EdgeArray.h:112
int rank(node v) const
Returns the rank (level) of node v.
Definition: Hierarchy.h:70
GraphCopy m_GC
The graph copy representing the topology of the proper hierarchy.
Definition: Hierarchy.h:48
int maxRank() const
Definition: Hierarchy.h:72
Declaration and implementation of EdgeArray class.
Doubly linked lists (maintaining the length of the list).
Definition: List.h:39
Declaration of graph copy classes.
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:250
Class for the representation of nodes.
Definition: Graph_d.h:167
Array< int > m_size
Definition: Hierarchy.h:50
Hierarchy()
Creates an empty hierarchy.
Definition: Hierarchy.h:54
The namespace for all OGDF objects.
bool isDummy(node v) const
Returns true iff v has no corresponding node in the original graph.
Definition: GraphCopy.h:378
Representation of proper hierarchies used by Sugiyama-layout.
Definition: Hierarchy.h:44