Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
Attraction.h
Go to the documentation of this file.
1
32#pragma once
33
35
36namespace ogdf {
37namespace davidson_harel {
38
40
48class Attraction : public NodePairEnergy {
49public:
50 //Initializes data structures to speed up later computations
52
54
56 void setPreferredEdgelength(double length) { m_preferredEdgeLength = length; }
57
59 void reinitializeEdgeLength(double multi);
60#ifdef OGDF_DEBUG
61 void printInternalData() const override;
62#endif
63private:
65 static const double MULTIPLIER;
69 double computeCoordEnergy(node, node, const DPoint&, const DPoint&) const override;
70};
71
72}
73}
Declares class NodePairEnergy which implements an energy function where the energy of a layout depend...
Stores additional attributes of a graph (like layout information).
Class for the representation of nodes.
Definition Graph_d.h:177
Energy function for attraction between two adjacent vertices.
Definition Attraction.h:48
void setPreferredEdgelength(double length)
set the preferred edge length
Definition Attraction.h:56
double computeCoordEnergy(node, node, const DPoint &, const DPoint &) const override
computes the energy contributed by the two nodes if they are placed at the two given positions
static const double MULTIPLIER
Average length and height of nodes is multiplied by this factor to get preferred edge length.
Definition Attraction.h:65
double m_preferredEdgeLength
the length that that all edges should ideally have
Definition Attraction.h:67
void reinitializeEdgeLength(double multi)
set multiplier for the edge length with repspect to node size to multi
Attraction(GraphAttributes &AG)
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.