Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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 
38 namespace ogdf {
39 class GraphAttributes;
40 
41 namespace davidson_harel {
42 
44 
52 class Attraction : public NodePairEnergy {
53 public:
54  //Initializes data structures to speed up later computations
55  explicit Attraction(GraphAttributes& AG);
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
67 private:
69  static const double MULTIPLIER;
73  double computeCoordEnergy(node, node, const DPoint&, const DPoint&) const override;
74 };
75 
76 }
77 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
Graph.h
Includes declaration of graph class.
ogdf::GenericPoint< double >
ogdf::davidson_harel::Attraction::setPreferredEdgelength
void setPreferredEdgelength(double length)
set the preferred edge length
Definition: Attraction.h:60
geometry.h
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
ogdf::davidson_harel::Attraction
Energy function for attraction between two adjacent vertices.
Definition: Attraction.h:52
ogdf::davidson_harel::Attraction::Attraction
Attraction(GraphAttributes &AG)
ogdf::davidson_harel::Attraction::reinitializeEdgeLength
void reinitializeEdgeLength(double multi)
set multiplier for the edge length with repspect to node size to multi
ogdf::davidson_harel::Attraction::printInternalData
void printInternalData() const override
ogdf::davidson_harel::NodePairEnergy
Definition: NodePairEnergy.h:51
ogdf::davidson_harel::Attraction::m_preferredEdgeLength
double m_preferredEdgeLength
the length that that all edges should ideally have
Definition: Attraction.h:71
ogdf::davidson_harel::Attraction::computeCoordEnergy
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
ogdf::davidson_harel::Attraction::~Attraction
~Attraction()
Definition: Attraction.h:57
NodePairEnergy.h
Declares class NodePairEnergy which implements an energy function where the energy of a layout depend...
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::davidson_harel::Attraction::MULTIPLIER
static const double MULTIPLIER
Average length and height of nodes is multiplied by this factor to get preferred edge length.
Definition: Attraction.h:69