The interface for energy functions for the Davidson Harel graph drawing method. More...
#include <ogdf/energybased/davidson_harel/EnergyFunction.h>
Public Member Functions | |
EnergyFunction (const string &funcname, GraphAttributes &AG) | |
Initializes data dtructures to speed up later computations. | |
virtual | ~EnergyFunction () |
void | candidateTaken () |
Changes m_currentX and m_currentY by setting the position of m_testNode to m_testX and m_testY. Sets m_energy to m_candidateEnergy. Computes the energy of the layout stored in AG. | |
double | computeCandidateEnergy (const node v, const DPoint &newPos) |
sets m_testNode, m_testX and m_testY and computes the energy for the new configuration (vertex v moves to newPos) | |
virtual void | computeEnergy ()=0 |
computes energy for the layout at the beginning of the optimization process | |
double | energy () const |
string | getName () const |
prints the name of the energy function | |
Protected Member Functions | |
virtual void | compCandEnergy ()=0 |
computes the energy if m_testNode changes position to m_testX and m_testY, sets the value of m_candidateEnergy. | |
DPoint | currentPos (const node v) const |
returns the current position of vertex v | |
virtual void | internalCandidateTaken ()=0 |
changes the data of a specific energy function if the candidate was taken | |
node | testNode () const |
returns the vertex that is under consideration in the current step | |
DPoint | testPos () |
returns candidate position for the node to be moved | |
Protected Attributes | |
double | m_candidateEnergy |
the energy of the layout if the candidate layout is chosen | |
double | m_energy |
energy of the current layout | |
const Graph & | m_G |
the graph that should be drawn | |
const string | m_name |
name of the energy function | |
Private Member Functions | |
EnergyFunction (const EnergyFunction &e) | |
the copy constructor is fake and can not be used. | |
EnergyFunction & | operator= (const EnergyFunction &e) |
the assignment operator is fake and can not be used. | |
Private Attributes | |
GraphAttributes & | m_AG |
This stores the graph with its graphical attributes and the current positions for the vertices. | |
node | m_testNode |
The node that changed position in the candidate. | |
DPoint | m_testPos |
New candidate positions for m_testNode. | |
The interface for energy functions for the Davidson Harel graph drawing method.
It is used in the class DavidsonHarel.
Definition at line 47 of file EnergyFunction.h.
ogdf::davidson_harel::EnergyFunction::EnergyFunction | ( | const string & | funcname, |
GraphAttributes & | AG | ||
) |
Initializes data dtructures to speed up later computations.
|
inlinevirtual |
Definition at line 52 of file EnergyFunction.h.
|
inlineprivate |
the copy constructor is fake and can not be used.
Definition at line 102 of file EnergyFunction.h.
void ogdf::davidson_harel::EnergyFunction::candidateTaken | ( | ) |
Changes m_currentX and m_currentY by setting the position of m_testNode to m_testX and m_testY. Sets m_energy to m_candidateEnergy. Computes the energy of the layout stored in AG.
computes the energy if m_testNode changes position to m_testX and m_testY, sets the value of m_candidateEnergy.
Implemented in ogdf::davidson_harel::NodePairEnergy, ogdf::davidson_harel::Planarity, and ogdf::davidson_harel::PlanarityGrid.
double ogdf::davidson_harel::EnergyFunction::computeCandidateEnergy | ( | const node | v, |
const DPoint & | newPos | ||
) |
sets m_testNode, m_testX and m_testY and computes the energy for the new configuration (vertex v moves to newPos)
computes energy for the layout at the beginning of the optimization process
Implemented in ogdf::davidson_harel::NodePairEnergy, ogdf::davidson_harel::Planarity, and ogdf::davidson_harel::PlanarityGrid.
returns the current position of vertex v
Definition at line 85 of file EnergyFunction.h.
|
inline |
Definition at line 73 of file EnergyFunction.h.
|
inline |
prints the name of the energy function
Definition at line 61 of file EnergyFunction.h.
changes the data of a specific energy function if the candidate was taken
Implemented in ogdf::davidson_harel::NodePairEnergy, ogdf::davidson_harel::Planarity, and ogdf::davidson_harel::PlanarityGrid.
|
private |
the assignment operator is fake and can not be used.
|
inlineprotected |
returns the vertex that is under consideration in the current step
Definition at line 88 of file EnergyFunction.h.
|
inlineprotected |
returns candidate position for the node to be moved
Definition at line 82 of file EnergyFunction.h.
|
private |
This stores the graph with its graphical attributes and the current positions for the vertices.
Definition at line 107 of file EnergyFunction.h.
|
protected |
the energy of the layout if the candidate layout is chosen
Definition at line 78 of file EnergyFunction.h.
|
protected |
energy of the current layout
Definition at line 79 of file EnergyFunction.h.
the graph that should be drawn
Definition at line 76 of file EnergyFunction.h.
|
protected |
name of the energy function
Definition at line 77 of file EnergyFunction.h.
|
private |
The node that changed position in the candidate.
Definition at line 108 of file EnergyFunction.h.
|
private |
New candidate positions for m_testNode.
Definition at line 109 of file EnergyFunction.h.