Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

ModularMultilevelMixer.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <memory>
39 
40 namespace ogdf {
41 
43 
73 {
74 private:
75 
77 
82  std::unique_ptr<LayoutModule> m_oneLevelLayoutModule;
83 
85 
90  std::unique_ptr<LayoutModule> m_finalLayoutModule;
91 
93  std::unique_ptr<MultilevelBuilder> m_multilevelBuilder;
94 
96  std::unique_ptr<InitialPlacer> m_initialPlacement;
97 
99  int m_times;
100 
103 
106 
108 
110  bool m_randomize;
111 
112 public:
113 
115  enum class erc {
116  None,
117  LevelBound
118  };
119 
121 
123  void setLevelLayoutModule(LayoutModule *levelLayout) {
124  m_oneLevelLayoutModule.reset(levelLayout);
125  }
126 
128  void setFinalLayoutModule(LayoutModule *finalLayout) {
129  m_finalLayoutModule.reset(finalLayout);
130  }
131 
134  m_multilevelBuilder.reset(levelBuilder);
135  }
136 
138  void setInitialPlacer(InitialPlacer *placement) {
139  m_initialPlacement.reset(placement);
140  }
141 
143  void setLayoutRepeats(int times = 1) { m_times = times; }
144 
146  void setAllEdgeLengths(double len) { m_fixedEdgeLength = len; }
147 
149  void setAllNodeSizes(double size) { m_fixedNodeSize = size; }
150 
152  void setRandomize(bool b) { m_randomize = b; }
153 
155  void setLevelBound(bool b) { m_levelBound = b; }
156 
158  void call(GraphAttributes &GA) override;
159 
170 #if 0
171  virtual void call(MultilevelGraph &MLG) {
172  GraphAttributes GA(MLG.getGraph());
173  MLG.exportAttributesSimple(GA);
174  call(GA);
175  MLG.importAttributesSimple(GA);
176  };
177 #else
178  virtual void call(MultilevelGraph &MLG);
179 #endif
180 
182  erc errorCode() { return m_errorCode; }
183 
185  double coarseningRatio() { return m_coarseningRatio; }
186 
187 private:
189 };
190 
191 }
bool m_levelBound
Determines if computation is stopped when number of levels is too high.
void setInitialPlacer(InitialPlacer *placement)
Sets the initial placer module to placement.
std::unique_ptr< LayoutModule > m_oneLevelLayoutModule
The layout algorithm applied on each level.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
int m_times
The one-level layout will be called m_times to improve quality.
void setLevelLayoutModule(LayoutModule *levelLayout)
Sets the one-level layout module to levelLayout.
void setLayoutRepeats(int times=1)
Determines how many times the one-level layout will be called.
void setMultilevelBuilder(MultilevelBuilder *levelBuilder)
Sets the multilevel builder module to levelBuilder.
bool m_randomize
Determines if initial random layout is computed.
double coarseningRatio()
Returns the ratio c/p between sizes of previous (p) and current (c) level graphs. ...
erc m_errorCode
The error code of the last call.
double m_fixedEdgeLength
If set to a value > 0, all edge weights will be set to this value.
std::unique_ptr< LayoutModule > m_finalLayoutModule
The layout algorithm applied on the last level (i.e., the largest graph in the multilevel hierarchy)...
Stores additional attributes of a graph (like layout information).
std::unique_ptr< MultilevelBuilder > m_multilevelBuilder
The multilevel builder module computes the multilevel hierarchy.
Base class for merger modules.
void setFinalLayoutModule(LayoutModule *finalLayout)
Sets the final layout module to finalLayout.
erc errorCode()
Returns the error code of last call.
MLG is the main data structure for ModularMultilevelMixer.
void setAllEdgeLengths(double len)
If len > 0, all edge weights will be set to len.
void importAttributesSimple(const GraphAttributes &GA)
Declaration of interface for layout algorithms (class LayoutModule)
double m_coarseningRatio
Ratio between sizes of previous (p) and current (c) level graphs: c/p.
Interface of general layout algorithms.
Definition: LayoutModule.h:44
Base class for placer modules.
Definition: InitialPlacer.h:43
std::unique_ptr< InitialPlacer > m_initialPlacement
The initial placer module computes the initial positions for nodes inserted into the previous level...
Two geometric objects do not intersect.
Declaration of MultilevelBuilder.
Modular multilevel graph layout.
void setRandomize(bool b)
Determines if an initial random layout is computed.
double m_fixedNodeSize
If set to a value > 0, all node sizes will be set to this value.
void setAllNodeSizes(double size)
If size > 0, all node sizes will be set to size.
The namespace for all OGDF objects.
void exportAttributesSimple(GraphAttributes &GA) const
void setLevelBound(bool b)
Determines if computation is stopped when number of levels is too high.
Abstract InitialPlacer places the nodes of the level into the next.