Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

DavidsonHarelLayout.h
Go to the documentation of this file.
1 
33 #pragma once
34 
36 
37 namespace ogdf {
38 
40 
50 {
51 public:
53  enum class SettingsParameter {Standard, Repulse, Planar};
54 
56  enum class SpeedParameter {Fast, Medium, HQ};
57 
60 
62 
64  virtual void call(GraphAttributes &GA) override;
65 
67  void fixSettings(SettingsParameter sp);
68 
70 
74  void setSpeed(SpeedParameter sp);
75 
77 
81  void setPreferredEdgeLengthMultiplier(double multi) {m_multiplier = multi;}
82 
84  void setPreferredEdgeLength(double elen) {m_prefEdgeLength = elen;}
85 
87  void setRepulsionWeight(double w);
88 
90  double getRepulsionWeight() const {return m_repulsionWeight;}
91 
93  void setAttractionWeight(double);
94 
96  double getAttractionWeight() const {return m_attractionWeight;}
97 
99  void setNodeOverlapWeight(double);
100 
102  double getNodeOverlapWeight() const {return m_nodeOverlapWeight;}
103 
105  void setPlanarityWeight(double);
106 
108  double getPlanarityWeight() const {return m_planarityWeight;}
109 
111  void setStartTemperature(int t);
112 
114  int getStartTemperature() const {return m_startTemperature;}
115 
117  void setNumberOfIterations(int steps);
118 
120  int getNumberOfIterations() const {return m_numberOfIterations;}
121 
124  void setIterationNumberAsFactor(bool b) {m_itAsFactor = b;}
125 
126 private:
134  double m_multiplier;
136  bool m_crossings;
138 };
139 
140 }
void setPreferredEdgeLengthMultiplier(double multi)
Sets the preferred edge length multiplier for attraction.
void setPreferredEdgeLength(double elen)
Sets the preferred edge length to elen.
SpeedParameter
Easy way to set temperature and iterations.
double m_planarityWeight
The weight for edge crossing energy.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
int m_startTemperature
The temperature at the start of the optimization.
SettingsParameter
Easy way to set fixed costs.
int m_numberOfIterations
The number of iterations per temperature step.
void setIterationNumberAsFactor(bool b)
Switch between using iteration number as fixed number or factor (*number of nodes of graph) ...
bool m_itAsFactor
Should m_numberOfIterations be factor (true) or fixed number.
int getStartTemperature() const
Returns the starting temperature.
bool m_crossings
Should crossings be computed?
double m_repulsionWeight
The weight for repulsion energy.
SpeedParameter m_speed
You can override this by manually setting iter=0.
The Davidson-Harel layout algorithm.
double getNodeOverlapWeight() const
Returns the weight for the energy function NodeOverlap.
Stores additional attributes of a graph (like layout information).
double getRepulsionWeight() const
Returns the weight for the energy function Repulsion.
Declaration of interface for layout algorithms (class LayoutModule)
double getPlanarityWeight() const
Returns the weight for the energy function Planarity.
Interface of general layout algorithms.
Definition: LayoutModule.h:44
int getNumberOfIterations() const
Returns the number of iterations per temperature step.
The namespace for all OGDF objects.
double getAttractionWeight() const
Returns the weight for the energy function Attraction.
double m_prefEdgeLength
Preferred edge length (abs value), only used if > 0.
double m_attractionWeight
The weight for attraction energy.
double m_nodeOverlapWeight
The weight for node overlap energy.
double m_multiplier
By default, number of iterations per temperature step is number of vertices multiplied by multiplier...