Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

MultilevelBuilder.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
36 
37 namespace ogdf {
38 
40 
44 {
45 private:
56  virtual bool buildOneLevel(MultilevelGraph &MLG) = 0;
57 
58 protected:
59  // if set to true the length of the edge between two merged nodes will be added to
60  // all edges that are moved to the other node in this merge.
63 
64 public:
65  virtual ~MultilevelBuilder() { }
66  MultilevelBuilder():m_adjustEdgeLengths(0),m_numLevels(1) { }
67 
68  virtual void buildAllLevels(MultilevelGraph &MLG)
69  {
70  m_numLevels = 1;
72  MLG.updateMergeWeights();
73  while (buildOneLevel(MLG))
74  {
75  m_numLevels++;
76  }
78  }
79 
80  void setEdgeLengthAdjustment(int factor) { m_adjustEdgeLengths = factor; }
81  int getNumLevels() {return m_numLevels;}
82 
83 };
84 
85 } // namespace ogdf
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
void setEdgeLengthAdjustment(int factor)
Base class for merger modules.
MLG is the main data structure for ModularMultilevelMixer.
Includes declaration of graph class.
virtual void buildAllLevels(MultilevelGraph &MLG)
The namespace for all OGDF objects.
int m_numLevels
stores number of levels for statistics purposes