Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

FastSimpleHierarchyLayout.h
Go to the documentation of this file.
1 
33 #pragma once
34 
35 #include <ogdf/basic/Graph.h>
36 #include <ogdf/basic/basic.h>
39 
40 namespace ogdf {
41 class GraphAttributes;
42 class GraphCopy;
43 
90 private:
91  double m_minXSep;
92  double m_ySep;
93  bool m_balanced;
94  bool m_downward;
96 
97 protected:
98  virtual void doCall(const HierarchyLevelsBase& levels, GraphAttributes& AGC) override;
99 
100 public:
102 
108 
109 
112 
113  // destructor
115 
118 
120  double nodeDistance() const { return m_minXSep; }
121 
123  void nodeDistance(double dist) { m_minXSep = dist; }
124 
126  double layerDistance() const { return m_ySep; }
127 
129  void layerDistance(double dist) { m_ySep = dist; }
130 
132  bool downward() const { return m_downward; }
133 
135  void downward(bool d) { m_downward = d; }
136 
138  bool leftToRight() const { return m_leftToRight; }
139 
141  void leftToRight(bool b) { m_leftToRight = b; }
142 
144  bool balanced() const { return m_balanced; }
145 
147  void balanced(bool b) { m_balanced = b; }
148 
149 
150 private:
161  void markType1Conflicts(const HierarchyLevelsBase& levels, bool downward,
162  NodeArray<NodeArray<bool>>& type1Conflicts);
163 
175  void verticalAlignment(const HierarchyLevelsBase& levels, NodeArray<node>& root,
176  NodeArray<node>& align, const NodeArray<NodeArray<bool>>& type1Conflicts,
177  const bool downward, const bool leftToRight);
178 
188  void computeBlockWidths(const GraphCopy& GC, const GraphAttributes& GCA, NodeArray<node>& root,
189  NodeArray<double>& blockWidth);
190 
202  void horizontalCompactation(const NodeArray<node>& align, const HierarchyLevelsBase& levels,
203  const NodeArray<node>& root, const NodeArray<double>& blockWidth, NodeArray<double>& x,
204  const bool leftToRight, bool downward);
205 
219  void placeBlock(node v, NodeArray<node>& sink, NodeArray<double>& shift, NodeArray<double>& x,
220  const NodeArray<node>& align, const HierarchyLevelsBase& levels,
221  const NodeArray<double>& blockWidth, const NodeArray<node>& root, const bool leftToRight);
222 
229  node virtualTwinNode(const HierarchyLevelsBase& levels, const node v,
230  const HierarchyLevelsBase::TraversingDir dir) const;
231 
240  node pred(const node v, const HierarchyLevelsBase& levels, const bool leftToRight);
241 };
242 
243 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
ogdf::FastSimpleHierarchyLayout::m_balanced
bool m_balanced
stores the option balanced.
Definition: FastSimpleHierarchyLayout.h:93
Graph.h
Includes declaration of graph class.
ogdf::FastSimpleHierarchyLayout::downward
void downward(bool d)
Sets the option downward to d.
Definition: FastSimpleHierarchyLayout.h:135
ogdf::HierarchyLayoutModule
Interface of hierarchy layout algorithms.
Definition: HierarchyLayoutModule.h:52
ogdf::GraphCopy
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:391
ogdf::FastSimpleHierarchyLayout
Coordinate assignment phase for the Sugiyama algorithm by Ulrik Brandes and Boris Köpf.
Definition: FastSimpleHierarchyLayout.h:89
ogdf::HierarchyLevelsBase
Definition: CrossingMinInterfaces.h:63
ogdf::FastSimpleHierarchyLayout::m_leftToRight
bool m_leftToRight
stores the option left-to-right.
Definition: FastSimpleHierarchyLayout.h:95
ogdf::FastSimpleHierarchyLayout::leftToRight
bool leftToRight() const
Returns the option left-to-right.
Definition: FastSimpleHierarchyLayout.h:138
ogdf::FastSimpleHierarchyLayout::downward
bool downward() const
Returns the option downward.
Definition: FastSimpleHierarchyLayout.h:132
ogdf::HierarchyLevelsBase::TraversingDir
TraversingDir
Definition: CrossingMinInterfaces.h:73
ogdf::FastSimpleHierarchyLayout::balanced
bool balanced() const
Returns the option balanced.
Definition: FastSimpleHierarchyLayout.h:144
ogdf::FastSimpleHierarchyLayout::layerDistance
void layerDistance(double dist)
Sets the option layer distance to dist.
Definition: FastSimpleHierarchyLayout.h:129
ogdf::FastSimpleHierarchyLayout::leftToRight
void leftToRight(bool b)
Sets the option left-to-right to b.
Definition: FastSimpleHierarchyLayout.h:141
ogdf::FastSimpleHierarchyLayout::m_ySep
double m_ySep
stores the option layer distance.
Definition: FastSimpleHierarchyLayout.h:92
ogdf::FastSimpleHierarchyLayout::nodeDistance
double nodeDistance() const
Returns the option node distance.
Definition: FastSimpleHierarchyLayout.h:120
ogdf::FastSimpleHierarchyLayout::nodeDistance
void nodeDistance(double dist)
Sets the option node distance to dist.
Definition: FastSimpleHierarchyLayout.h:123
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::FastSimpleHierarchyLayout::m_minXSep
double m_minXSep
stores the option node distance.
Definition: FastSimpleHierarchyLayout.h:91
CrossingMinInterfaces.h
Declaration of interfaces used in Sugiyama framework.
ogdf::FastSimpleHierarchyLayout::~FastSimpleHierarchyLayout
virtual ~FastSimpleHierarchyLayout()
Definition: FastSimpleHierarchyLayout.h:114
basic.h
Basic declarations, included by all source files.
ogdf::FastSimpleHierarchyLayout::balanced
void balanced(bool b)
Sets the option balanced to b.
Definition: FastSimpleHierarchyLayout.h:147
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
HierarchyLayoutModule.h
Declaration of interface hierarchy layout algorithms (3. phase of Sugiyama).
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::FastSimpleHierarchyLayout::m_downward
bool m_downward
stores the option downward.
Definition: FastSimpleHierarchyLayout.h:94
ogdf::FastSimpleHierarchyLayout::layerDistance
double layerDistance() const
Returns the option layer distance.
Definition: FastSimpleHierarchyLayout.h:126