Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Attraction.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 
36 namespace ogdf {
37 namespace davidson_harel {
38 
40 
48 class Attraction : public NodePairEnergy {
49 public:
50  //Initializes data structures to speed up later computations
51  explicit Attraction(GraphAttributes& AG);
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
63 private:
65  static const double MULTIPLIER;
69  double computeCoordEnergy(node, node, const DPoint&, const DPoint&) const override;
70 };
71 
72 }
73 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:66
ogdf::GenericPoint< double >
ogdf::davidson_harel::Attraction::setPreferredEdgelength
void setPreferredEdgelength(double length)
set the preferred edge length
Definition: Attraction.h:56
ogdf::davidson_harel::Attraction
Energy function for attraction between two adjacent vertices.
Definition: Attraction.h:48
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:43
ogdf::davidson_harel::Attraction::m_preferredEdgeLength
double m_preferredEdgeLength
the length that that all edges should ideally have
Definition: Attraction.h:67
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:53
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:233
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:65