Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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
40namespace ogdf {
41class GraphAttributes;
42class GraphCopy;
43
90private:
91 double m_minXSep;
92 double m_ySep;
96
97protected:
98 virtual void doCall(const HierarchyLevelsBase& levels, GraphAttributes& AGC) override;
99
100public:
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
150private:
161 void markType1Conflicts(const HierarchyLevelsBase& levels, bool downward,
162 NodeArray<NodeArray<bool>>& type1Conflicts);
163
176 NodeArray<node>& align, const NodeArray<NodeArray<bool>>& type1Conflicts,
177 const bool downward, const bool leftToRight);
178
189 NodeArray<double>& blockWidth);
190
203 const NodeArray<node>& root, const NodeArray<double>& blockWidth, NodeArray<double>& x,
204 const bool leftToRight, bool downward);
205
220 const NodeArray<node>& align, const HierarchyLevelsBase& levels,
221 const NodeArray<double>& blockWidth, const NodeArray<node>& root, const bool leftToRight);
222
230 const HierarchyLevelsBase::TraversingDir dir) const;
231
240 node pred(const node v, const HierarchyLevelsBase& levels, const bool leftToRight);
241};
242
243}
Declaration of interfaces used in Sugiyama framework.
Includes declaration of graph class.
Declaration of interface hierarchy layout algorithms (3.
Basic declarations, included by all source files.
Coordinate assignment phase for the Sugiyama algorithm by Ulrik Brandes and Boris Köpf.
void computeBlockWidths(const GraphCopy &GC, const GraphAttributes &GCA, NodeArray< node > &root, NodeArray< double > &blockWidth)
Computes the width of each block, i.e., the maximal width of a node in the block, and stores it in bl...
double m_minXSep
stores the option node distance.
void verticalAlignment(const HierarchyLevelsBase &levels, NodeArray< node > &root, NodeArray< node > &align, const NodeArray< NodeArray< bool > > &type1Conflicts, const bool downward, const bool leftToRight)
Align each node to a node on the next higher level.
void markType1Conflicts(const HierarchyLevelsBase &levels, bool downward, NodeArray< NodeArray< bool > > &type1Conflicts)
Preprocessing step to find all type1 conflicts.
void leftToRight(bool b)
Sets the option left-to-right to b.
node pred(const node v, const HierarchyLevelsBase &levels, const bool leftToRight)
Predecessor of v on the same level,.
void placeBlock(node v, NodeArray< node > &sink, NodeArray< double > &shift, NodeArray< double > &x, const NodeArray< node > &align, const HierarchyLevelsBase &levels, const NodeArray< double > &blockWidth, const NodeArray< node > &root, const bool leftToRight)
Calculate the coordinate for root nodes (placing)
double layerDistance() const
Returns the option layer distance.
double nodeDistance() const
Returns the option node distance.
void horizontalCompactation(const NodeArray< node > &align, const HierarchyLevelsBase &levels, const NodeArray< node > &root, const NodeArray< double > &blockWidth, NodeArray< double > &x, const bool leftToRight, bool downward)
Calculate the coordinates for each node.
virtual void doCall(const HierarchyLevelsBase &levels, GraphAttributes &AGC) override
Implements the actual algorithm call.
node virtualTwinNode(const HierarchyLevelsBase &levels, const node v, const HierarchyLevelsBase::TraversingDir dir) const
The twin of an inner Segment.
void balanced(bool b)
Sets the option balanced to b.
FastSimpleHierarchyLayout & operator=(const FastSimpleHierarchyLayout &)
Assignment operator.
bool balanced() const
Returns the option balanced.
bool m_leftToRight
stores the option left-to-right.
FastSimpleHierarchyLayout()
Creates an instance of fast simple hierarchy layout.
void layerDistance(double dist)
Sets the option layer distance to dist.
void downward(bool d)
Sets the option downward to d.
bool leftToRight() const
Returns the option left-to-right.
FastSimpleHierarchyLayout(const FastSimpleHierarchyLayout &)
Copy constructor.
bool m_balanced
stores the option balanced.
void nodeDistance(double dist)
Sets the option node distance to dist.
bool m_downward
stores the option downward.
bool downward() const
Returns the option downward.
double m_ySep
stores the option layer distance.
Stores additional attributes of a graph (like layout information).
Copies of graphs supporting edge splitting.
Definition GraphCopy.h:390
Interface of hierarchy layout algorithms.
Class for the representation of nodes.
Definition Graph_d.h:241
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.