Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ModularMultilevelMixer.h
Go to the documentation of this file.
1
32#pragma once
33
38
39#include <memory>
40
41namespace ogdf {
42
44
74private:
76
81 std::unique_ptr<LayoutModule> m_oneLevelLayoutModule;
82
84
89 std::unique_ptr<LayoutModule> m_finalLayoutModule;
90
92 std::unique_ptr<MultilevelBuilder> m_multilevelBuilder;
93
95 std::unique_ptr<InitialPlacer> m_initialPlacement;
96
99
102
105
107
110
111public:
113 enum class erc {
114 None,
115 LevelBound
116 };
117
119
122 m_oneLevelLayoutModule.reset(levelLayout);
123 }
124
126 void setFinalLayoutModule(LayoutModule* finalLayout) { m_finalLayoutModule.reset(finalLayout); }
127
130 m_multilevelBuilder.reset(levelBuilder);
131 }
132
134 void setInitialPlacer(InitialPlacer* placement) { m_initialPlacement.reset(placement); }
135
137 void setLayoutRepeats(int times = 1) { m_times = times; }
138
140 void setAllEdgeLengths(double len) { m_fixedEdgeLength = len; }
141
143 void setAllNodeSizes(double size) { m_fixedNodeSize = size; }
144
146 void setRandomize(bool b) { m_randomize = b; }
147
149 void setLevelBound(bool b) { m_levelBound = b; }
150
152 void call(GraphAttributes& GA) override;
153
164#if 0
165 virtual void call(MultilevelGraph &MLG) {
166 GraphAttributes GA(MLG.getGraph());
167 MLG.exportAttributesSimple(GA);
168 call(GA);
169 MLG.importAttributesSimple(GA);
170 };
171#else
172 virtual void call(MultilevelGraph& MLG);
173#endif
174
176 erc errorCode() { return m_errorCode; }
177
179 double coarseningRatio() { return m_coarseningRatio; }
180
181private:
183};
184
185}
Abstract InitialPlacer places the nodes of the level into the next.
Declaration of interface for layout algorithms (class LayoutModule)
Declaration of MultilevelBuilder.
MLG is the main data structure for ModularMultilevelMixer.
Stores additional attributes of a graph (like layout information).
Base class for placer modules.
Interface of general layout algorithms.
Modular multilevel graph layout.
std::unique_ptr< LayoutModule > m_oneLevelLayoutModule
The layout algorithm applied on each level.
std::unique_ptr< InitialPlacer > m_initialPlacement
The initial placer module computes the initial positions for nodes inserted into the previous level.
double m_fixedNodeSize
If set to a value > 0, all node sizes will be set to this value.
bool m_levelBound
Determines if computation is stopped when number of levels is too high.
void setAllNodeSizes(double size)
If size > 0, all node sizes will be set to size.
void setFinalLayoutModule(LayoutModule *finalLayout)
Sets the final layout module to finalLayout.
bool m_randomize
Determines if initial random layout is computed.
std::unique_ptr< MultilevelBuilder > m_multilevelBuilder
The multilevel builder module computes the multilevel hierarchy.
void setMultilevelBuilder(MultilevelBuilder *levelBuilder)
Sets the multilevel builder module to levelBuilder.
double m_coarseningRatio
Ratio between sizes of previous (p) and current (c) level graphs: c/p.
double coarseningRatio()
Returns the ratio c/p between sizes of previous (p) and current (c) level graphs.
std::unique_ptr< LayoutModule > m_finalLayoutModule
The layout algorithm applied on the last level (i.e., the largest graph in the multilevel hierarchy).
void setAllEdgeLengths(double len)
If len > 0, all edge weights will be set to len.
void setLayoutRepeats(int times=1)
Determines how many times the one-level layout will be called.
int m_times
The one-level layout will be called m_times to improve quality.
void setInitialPlacer(InitialPlacer *placement)
Sets the initial placer module to placement.
double m_fixedEdgeLength
If set to a value > 0, all edge weights will be set to this value.
erc m_errorCode
The error code of the last call.
void setRandomize(bool b)
Determines if an initial random layout is computed.
void setLevelLayoutModule(LayoutModule *levelLayout)
Sets the one-level layout module to levelLayout.
erc errorCode()
Returns the error code of last call.
void setLevelBound(bool b)
Determines if computation is stopped when number of levels is too high.
virtual void call(MultilevelGraph &MLG)
Calls the multilevel layout algorithm for multilevel graph MLG.
void call(GraphAttributes &GA) override
Calls the multilevel layout algorithm for graph attributes GA.
Base class for merger modules.
#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.
@ None
Two geometric objects do not intersect.