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
34#include <ogdf/basic/Graph.h>
35#include <ogdf/basic/geometry.h>
37
38namespace ogdf {
39class GraphAttributes;
40
41namespace davidson_harel {
42
44
52class Attraction : public NodePairEnergy {
53public:
54 //Initializes data structures to speed up later computations
56
58
60 void setPreferredEdgelength(double length) { m_preferredEdgeLength = length; }
61
63 void reinitializeEdgeLength(double multi);
64#ifdef OGDF_DEBUG
65 void printInternalData() const override;
66#endif
67private:
69 static const double MULTIPLIER;
73 double computeCoordEnergy(node, node, const DPoint&, const DPoint&) const override;
74};
75
76}
77}
Includes declaration of graph class.
Declares class NodePairEnergy which implements an energy function where the energy of a layout depend...
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
Stores additional attributes of a graph (like layout information).
Class for the representation of nodes.
Definition Graph_d.h:241
Energy function for attraction between two adjacent vertices.
Definition Attraction.h:52
void setPreferredEdgelength(double length)
set the preferred edge length
Definition Attraction.h:60
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:69
void printInternalData() const override
double m_preferredEdgeLength
the length that that all edges should ideally have
Definition Attraction.h:71
void reinitializeEdgeLength(double multi)
set multiplier for the edge length with repspect to node size to multi
Attraction(GraphAttributes &AG)
The namespace for all OGDF objects.