Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
SugiyamaLayout.h
Go to the documentation of this file.
1
32#pragma once
33
42
43#include <memory>
44
45namespace ogdf {
46
161#if 0
162 class CrossMinMaster;
163 class CrossMinWorker;
164#endif
165
166protected:
168 std::unique_ptr<RankingModule> m_ranking;
169
171 std::unique_ptr<LayeredCrossMinModule> m_crossMin;
172
173 std::unique_ptr<TwoLayerCrossMinSimDraw> m_crossMinSimDraw;
174
176 std::unique_ptr<HierarchyLayoutModule> m_layout;
177
179 std::unique_ptr<HierarchyClusterLayoutModule> m_clusterLayout;
180
182 std::unique_ptr<CCLayoutPackModule> m_packer;
183
185 int m_runs;
188 double m_minDistCC;
189 double m_pageRatio;
191 unsigned int m_maxThreads;
192
196
199
201
202public:
205
206 // destructor
208
219 virtual void call(GraphAttributes& GA) override;
220
227
237
238 // special call for UML graphs
240
253 int fails() const { return m_fails; }
254
256 void fails(int nFails) { m_fails = nFails; }
257
266 int runs() const { return m_runs; }
267
269 void runs(int nRuns) { m_runs = nRuns; }
270
278 bool transpose() const { return m_transpose; }
279
281 void transpose(bool bTranspose) { m_transpose = bTranspose; }
282
289 bool arrangeCCs() const { return m_arrangeCCs; }
290
292 void arrangeCCs(bool bArrange) { m_arrangeCCs = bArrange; }
293
300 double minDistCC() const { return m_minDistCC; }
301
303 void minDistCC(double x) { m_minDistCC = x; }
304
312 double pageRatio() const { return m_pageRatio; }
313
315 void pageRatio(double x) { m_pageRatio = x; }
316
323 bool alignBaseClasses() const { return m_alignBaseClasses; }
324
326 void alignBaseClasses(bool b) { m_alignBaseClasses = b; }
327
334 bool alignSiblings() const { return m_alignSiblings; }
335
337 void alignSiblings(bool b) { m_alignSiblings = b; }
338
340 void setSubgraphs(EdgeArray<uint32_t>* esg) { m_subgraphs = esg; }
341
343 bool useSubgraphs() const { return m_subgraphs != nullptr; }
344
345 bool permuteFirst() const { return m_permuteFirst; }
346
347 void permuteFirst(bool b) { m_permuteFirst = b; }
348
350 unsigned int maxThreads() const { return m_maxThreads; }
351
353 void maxThreads(unsigned int n) {
354#ifndef OGDF_MEMORY_POOL_NTS
355 m_maxThreads = n;
356#endif
357 }
358
374 void setRanking(RankingModule* pRanking) { m_ranking.reset(pRanking); }
375
383
391 void setLayout(HierarchyLayoutModule* pLayout) { m_layout.reset(pLayout); }
392
401
409 void setPacker(CCLayoutPackModule* pPacker) { m_packer.reset(pPacker); }
410
418 int numberOfCrossings() const { return m_nCrossings; }
419
421 RCCrossings numberOfCrossingsCluster() const { return m_nCrossingsCluster; }
422
424 int numberOfLevels() { return m_numLevels; }
425
427 int maxLevelSize() { return m_maxLevelSize; }
428
429 double timeReduceCrossings() { return m_timeReduceCrossings; }
430
431 // needed by LayerByLayerSweep::
432 const EdgeArray<uint32_t>* subgraphs() const { return m_subgraphs; };
433
434 int numCC() const { return m_numCC; };
435
436 const NodeArray<int>& compGC() const { return m_compGC; };
437
438protected:
439#if 0
440 void reduceCrossings(HierarchyLevels &levels);
441#endif
443
445
446private:
449
452
453#if 0
454 int traverseTopDown(HierarchyLevels &levels);
455 int traverseBottomUp(HierarchyLevels &levels);
456
457 bool transposeLevel(int i, HierarchyLevels &levels);
458 void doTranspose(HierarchyLevels &levels);
459 void doTransposeRev(HierarchyLevels &levels);
460#endif
461
462
466
469};
470
471
472}
Declaration of interface for algorithms that arrange/pack layouts of connected components.
Declares ClusterGraphAttributes, an extension of class GraphAttributes, to store clustergraph layout ...
Declaration of ExtendedNestingGraph.
Declaration of interface for hierarchy layout algorithms (3.
Declaration of interface hierarchy layout algorithms (3.
Declaration of interface for layout algorithms (class LayoutModule)
Declaration of interface for ranking algorithms.
Declaration of interface for two-layer crossing minimization algorithms for Simultaneous Drawing.
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:214
Base class of algorithms that arrange/pack layouts of connected components.
Stores additional attributes of a clustered graph (like layout information).
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
Stores additional attributes of a graph (like layout information).
Interface of hierarchy layout algorithms for cluster graphs.
Representation of proper hierarchies used by Sugiyama-layout.
Definition Hierarchy.h:43
Interface of hierarchy layout algorithms.
Representation of proper hierarchies used by Sugiyama-layout.
Interface of crossing minimization algorithms for layered graphs.
Interface of general layout algorithms.
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
Interface of algorithms for computing a node ranking.
Sugiyama's layout algorithm.
void setLayout(HierarchyLayoutModule *pLayout)
Sets the module option for the computation of the final layout.
const NodeArray< int > & compGC() const
double m_pageRatio
Option for desired page ratio.
int m_runs
Option for number of runs.
int maxLevelSize()
Return the max. number of elements on a layer.
int m_nCrossings
Number of crossings in computed layout.
void call(ClusterGraphAttributes &CGA)
Calls the layout algorithm for clustered graph CGA.
void arrangeCCs(bool bArrange)
Sets the options arrangeCCs to bArrange.
double minDistCC() const
Returns the current setting of option minDistCC (distance between components).
int fails() const
Returns the current setting of option fails.
std::unique_ptr< TwoLayerCrossMinSimDraw > m_crossMinSimDraw
void alignSiblings(bool b)
Sets the option alignSiblings to b.
void permuteFirst(bool b)
double pageRatio() const
Returns the current setting of option pageRation.
int numberOfCrossings() const
Returns the number of crossings in the computed layout (usual graph).
void maxThreads(unsigned int n)
Sets the maximal number of used threads to n.
RCCrossings traverseBottomUp(ExtendedNestingGraph &H)
void setPacker(CCLayoutPackModule *pPacker)
Sets the module option for the arrangement of connected components.
bool m_alignSiblings
Option for aligning siblings in inheritance trees.
bool arrangeCCs() const
Returns the current setting of option arrangeCCs.
unsigned int maxThreads() const
Returns the maximal number of used threads.
RCCrossings traverseTopDown(ExtendedNestingGraph &H)
std::unique_ptr< RankingModule > m_ranking
the ranking module (level assignment)
bool useSubgraphs() const
Returns true iff subgraphs for simultaneous drawing are set.
unsigned int m_maxThreads
The maximal number of used threads.
RCCrossings numberOfCrossingsCluster() const
Returns the number of crossings in the computed layout (cluster graph).
std::unique_ptr< LayeredCrossMinModule > m_crossMin
the module for two-layer crossing minimization
void doCall(GraphAttributes &AG, bool umlCall, NodeArray< int > &rank)
void runs(int nRuns)
Sets the option runs to nRuns.
bool m_arrangeCCs
Option for laying out components separately.
void minDistCC(double x)
Sets the option minDistCC to x.
bool m_alignBaseClasses
Option for aligning base classes.
const HierarchyLevelsBase * reduceCrossings(Hierarchy &H)
bool alignBaseClasses() const
Returns the current setting of option alignBaseClasses.
std::unique_ptr< CCLayoutPackModule > m_packer
The module for arranging connected components.
void setCrossMin(LayeredCrossMinModule *pCrossMin)
Sets the module option for the two-layer crossing minimization.
RCCrossings m_nCrossingsCluster
int runs() const
Returns the current setting of option runs.
bool m_transpose
Option for switching on transposal heuristic.
std::unique_ptr< HierarchyLayoutModule > m_layout
the hierarchy layout module (final coordinate assignment)
void reduceCrossings(ExtendedNestingGraph &H)
virtual void call(GraphAttributes &GA) override
Calls the layout algorithm for graph GA.
void alignBaseClasses(bool b)
Sets the option alignBaseClasses to b.
int numberOfLevels()
Return the number of layers/levels}.
void pageRatio(double x)
Sets the option pageRatio to x.
void callUML(GraphAttributes &GA)
std::unique_ptr< HierarchyClusterLayoutModule > m_clusterLayout
the hierarchy cluster layout module (final coordinate assignment for clustered graphs)
bool permuteFirst() const
void fails(int nFails)
Sets the option fails to nFails.
EdgeArray< uint32_t > * m_subgraphs
Defines the subgraphs for simultaneous drawing.
Array< bool > m_levelChanged
bool transpose() const
Returns the current setting of option transpose.
void setClusterLayout(HierarchyClusterLayoutModule *pLayout)
Sets the module option for the computation of the final layout for clustered graphs.
void setSubgraphs(EdgeArray< uint32_t > *esg)
Sets the subgraphs for simultaneous drawing.
void setRanking(RankingModule *pRanking)
Sets the module option for the node ranking (layer assignment).
const EdgeArray< uint32_t > * subgraphs() const
double m_minDistCC
Option for distance between connected components.
NodeArray< int > m_compGC
SugiyamaLayout()
Creates an instance of SugiyamaLayout and sets options to default values.
void call(GraphAttributes &GA, NodeArray< int > &rank)
Calls the layout algorithm for graph GA with a given level assignment.
bool alignSiblings() const
Returns the current setting of option alignSiblings.
void transpose(bool bTranspose)
Sets the option transpose to bTranspose.
int m_fails
Option for maximal number of fails.
void doCall(GraphAttributes &AG, bool umlCall)
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.