Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
DavidsonHarelLayout.h
Go to the documentation of this file.
1
33#pragma once
34
36
37namespace ogdf {
38
40
50public:
52 enum class SettingsParameter { Standard, Repulse, Planar };
53
55 enum class SpeedParameter { Fast, Medium, HQ };
56
59
61
63 virtual void call(GraphAttributes& GA) override;
64
67
69
74
76
80 void setPreferredEdgeLengthMultiplier(double multi) { m_multiplier = multi; }
81
83 void setPreferredEdgeLength(double elen) { m_prefEdgeLength = elen; }
84
86 void setRepulsionWeight(double w);
87
89 double getRepulsionWeight() const { return m_repulsionWeight; }
90
92 void setAttractionWeight(double);
93
95 double getAttractionWeight() const { return m_attractionWeight; }
96
99
101 double getNodeOverlapWeight() const { return m_nodeOverlapWeight; }
102
104 void setPlanarityWeight(double);
105
107 double getPlanarityWeight() const { return m_planarityWeight; }
108
111
113 int getStartTemperature() const { return m_startTemperature; }
114
117
119 int getNumberOfIterations() const { return m_numberOfIterations; }
120
123 void setIterationNumberAsFactor(bool b) { m_itAsFactor = b; }
124
125private:
137};
138
139}
Declaration of interface for layout algorithms (class LayoutModule)
The Davidson-Harel layout algorithm.
double m_prefEdgeLength
Preferred edge length (abs value), only used if > 0.
void setAttractionWeight(double)
Sets the weight for the energy function Attraction.
double getPlanarityWeight() const
Returns the weight for the energy function Planarity.
int getNumberOfIterations() const
Returns the number of iterations per temperature step.
SpeedParameter m_speed
You can override this by manually setting iter=0.
int m_startTemperature
The temperature at the start of the optimization.
void setRepulsionWeight(double w)
Sets the weight for the energy function Repulsion.
DavidsonHarelLayout()
Creates an instance of Davidson-Harel layout.
double getAttractionWeight() const
Returns the weight for the energy function Attraction.
int m_numberOfIterations
The number of iterations per temperature step.
double m_attractionWeight
The weight for attraction energy.
int getStartTemperature() const
Returns the starting temperature.
double m_repulsionWeight
The weight for repulsion energy.
void setNodeOverlapWeight(double)
Sets the weight for the energy function NodeOverlap.
void setPreferredEdgeLengthMultiplier(double multi)
Sets the preferred edge length multiplier for attraction.
void setStartTemperature(int t)
Sets the starting temperature to t.
void setPlanarityWeight(double)
Sets the weight for the energy function Planarity.
double getRepulsionWeight() const
Returns the weight for the energy function Repulsion.
void setSpeed(SpeedParameter sp)
More convenient way of setting the speed of the algorithm.
bool m_itAsFactor
Should m_numberOfIterations be factor (true) or fixed number.
double m_nodeOverlapWeight
The weight for node overlap energy.
void fixSettings(SettingsParameter sp)
Fixes the cost values to special configurations.
virtual void call(GraphAttributes &GA) override
Calls the layout algorithm for graph attributes GA.
double m_planarityWeight
The weight for edge crossing energy.
bool m_crossings
Should crossings be computed?
double getNodeOverlapWeight() const
Returns the weight for the energy function NodeOverlap.
void setNumberOfIterations(int steps)
Sets the number of iterations per temperature step to steps.
void setIterationNumberAsFactor(bool b)
Switch between using iteration number as fixed number or factor (*number of nodes of graph)
void setPreferredEdgeLength(double elen)
Sets the preferred edge length to elen.
SpeedParameter
Easy way to set temperature and iterations.
double m_multiplier
By default, number of iterations per temperature step is number of vertices multiplied by multiplier.
SettingsParameter
Easy way to set fixed costs.
Stores additional attributes of a graph (like layout information).
Interface of general layout algorithms.
#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.