Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

FastSimpleHierarchyLayout.h
Go to the documentation of this file.
1 
33 #pragma once
34 
36 #include <ogdf/layered/Hierarchy.h>
37 #include <ogdf/basic/NodeArray.h>
38 
39 namespace ogdf {
40 
87 {
88 private:
89  double m_minXSep;
90  double m_ySep;
91  bool m_balanced;
92  bool m_downward;
94 
95 protected:
96  virtual void doCall(const HierarchyLevelsBase &levels, GraphCopyAttributes &AGC) override;
97 
98 public:
100 
106 
107 
110 
111  // destructor
113 
114 
117 
118 
120  double nodeDistance() const {
121  return m_minXSep;
122  }
123 
125  void nodeDistance(double dist) {
126  m_minXSep = dist;
127  }
128 
130  double layerDistance() const {
131  return m_ySep;
132  }
133 
135  void layerDistance(double dist) {
136  m_ySep = dist;
137  }
138 
140  bool downward() const {
141  return m_downward;
142  }
143 
145  void downward(bool d) {
146  m_downward = d;
147  }
148 
150  bool leftToRight() const {
151  return m_leftToRight;
152  }
153 
155  void leftToRight(bool b) {
156  m_leftToRight = b;
157  }
158 
160  bool balanced() const {
161  return m_balanced;
162  }
163 
165  void balanced(bool b) {
166  m_balanced = b;
167  }
168 
169 
170 private:
181  void markType1Conflicts(const HierarchyLevelsBase &levels, bool downward, NodeArray<NodeArray<bool> > &type1Conflicts);
182 
194  void verticalAlignment(
195  const HierarchyLevelsBase &levels,
196  NodeArray<node> &root,
197  NodeArray<node> &align,
198  const NodeArray<NodeArray<bool> > &type1Conflicts,
199  const bool downward,
200  const bool leftToRight);
201 
211  void computeBlockWidths(
212  const GraphCopy &GC,
213  const GraphCopyAttributes &GCA,
214  NodeArray<node> &root,
215  NodeArray<double> &blockWidth);
216 
228  void horizontalCompactation(
229  const NodeArray<node> &align,
230  const HierarchyLevelsBase &levels,
231  const NodeArray<node> &root,
232  const NodeArray<double> &blockWidth,
234  const bool leftToRight,
235  bool downward);
236 
250  void placeBlock(
251  node v,
252  NodeArray<node> &sink,
253  NodeArray<double> &shift,
255  const NodeArray<node> &align,
256  const HierarchyLevelsBase &levels,
257  const NodeArray<double> &blockWidth,
258  const NodeArray<node> &root,
259  const bool leftToRight);
260 
267  node virtualTwinNode(const HierarchyLevelsBase &levels, const node v, const HierarchyLevelsBase::TraversingDir dir) const;
268 
277  node pred(const node v, const HierarchyLevelsBase &levels, const bool leftToRight);
278 };
279 
280 } // end namespace ogdf
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
bool m_balanced
stores the option balanced.
double m_ySep
stores the option layer distance.
Declaration of interface hierarchy layout algorithms (3.
bool m_downward
stores the option downward.
bool downward() const
Returns the option downward.
Declaration of Hierarchy class.
double nodeDistance() const
Returns the option node distance.
Dynamic arrays indexed with nodes.
Definition: Graph_d.h:423
double layerDistance() const
Returns the option layer distance.
Helper class for accessing graph attributes from a copy of the graph.
void layerDistance(double dist)
Sets the option layer distance to dist.
Interface of hierarchy layout algorithms.
void balanced(bool b)
Sets the option balanced to b.
double m_minXSep
stores the option node distance.
Edges are oriented from left to right.
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:250
bool balanced() const
Returns the option balanced.
void downward(bool d)
Sets the option downward to d.
Class for the representation of nodes.
Definition: Graph_d.h:167
Declaration and implementation of NodeArray class.
bool leftToRight() const
Returns the option left-to-right.
void nodeDistance(double dist)
Sets the option node distance to dist.
void leftToRight(bool b)
Sets the option left-to-right to b.
bool m_leftToRight
stores the option left-to-right.
The namespace for all OGDF objects.
Coordinate assignment phase for the Sugiyama algorithm by Ulrik Brandes and Boris Köpf...