Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::davidson_harel::EnergyFunction Class Referenceabstract

The interface for energy functions for the Davidson Harel graph drawing method. More...

#include <ogdf/energybased/davidson_harel/EnergyFunction.h>

+ Inheritance diagram for ogdf::davidson_harel::EnergyFunction:

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 Graphm_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.
 
EnergyFunctionoperator= (const EnergyFunction &e)
 the assignment operator is fake and can not be used.
 

Private Attributes

GraphAttributesm_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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ EnergyFunction() [1/2]

ogdf::davidson_harel::EnergyFunction::EnergyFunction ( const string &  funcname,
GraphAttributes AG 
)

Initializes data dtructures to speed up later computations.

◆ ~EnergyFunction()

virtual ogdf::davidson_harel::EnergyFunction::~EnergyFunction ( )
inlinevirtual

Definition at line 52 of file EnergyFunction.h.

◆ EnergyFunction() [2/2]

ogdf::davidson_harel::EnergyFunction::EnergyFunction ( const EnergyFunction e)
inlineprivate

the copy constructor is fake and can not be used.

Definition at line 102 of file EnergyFunction.h.

Member Function Documentation

◆ candidateTaken()

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.

◆ compCandEnergy()

virtual void ogdf::davidson_harel::EnergyFunction::compCandEnergy ( )
protectedpure virtual

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.

◆ computeCandidateEnergy()

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)

◆ computeEnergy()

virtual void ogdf::davidson_harel::EnergyFunction::computeEnergy ( )
pure virtual

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.

◆ currentPos()

DPoint ogdf::davidson_harel::EnergyFunction::currentPos ( const node  v) const
inlineprotected

returns the current position of vertex v

Definition at line 85 of file EnergyFunction.h.

◆ energy()

double ogdf::davidson_harel::EnergyFunction::energy ( ) const
inline

Definition at line 73 of file EnergyFunction.h.

◆ getName()

string ogdf::davidson_harel::EnergyFunction::getName ( ) const
inline

prints the name of the energy function

Definition at line 61 of file EnergyFunction.h.

◆ internalCandidateTaken()

virtual void ogdf::davidson_harel::EnergyFunction::internalCandidateTaken ( )
protectedpure virtual

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.

◆ operator=()

EnergyFunction & ogdf::davidson_harel::EnergyFunction::operator= ( const EnergyFunction e)
private

the assignment operator is fake and can not be used.

◆ testNode()

node ogdf::davidson_harel::EnergyFunction::testNode ( ) const
inlineprotected

returns the vertex that is under consideration in the current step

Definition at line 88 of file EnergyFunction.h.

◆ testPos()

DPoint ogdf::davidson_harel::EnergyFunction::testPos ( )
inlineprotected

returns candidate position for the node to be moved

Definition at line 82 of file EnergyFunction.h.

Member Data Documentation

◆ m_AG

GraphAttributes& ogdf::davidson_harel::EnergyFunction::m_AG
private

This stores the graph with its graphical attributes and the current positions for the vertices.

Definition at line 107 of file EnergyFunction.h.

◆ m_candidateEnergy

double ogdf::davidson_harel::EnergyFunction::m_candidateEnergy
protected

the energy of the layout if the candidate layout is chosen

Definition at line 78 of file EnergyFunction.h.

◆ m_energy

double ogdf::davidson_harel::EnergyFunction::m_energy
protected

energy of the current layout

Definition at line 79 of file EnergyFunction.h.

◆ m_G

const Graph& ogdf::davidson_harel::EnergyFunction::m_G
protected

the graph that should be drawn

Definition at line 76 of file EnergyFunction.h.

◆ m_name

const string ogdf::davidson_harel::EnergyFunction::m_name
protected

name of the energy function

Definition at line 77 of file EnergyFunction.h.

◆ m_testNode

node ogdf::davidson_harel::EnergyFunction::m_testNode
private

The node that changed position in the candidate.

Definition at line 108 of file EnergyFunction.h.

◆ m_testPos

DPoint ogdf::davidson_harel::EnergyFunction::m_testPos
private

New candidate positions for m_testNode.

Definition at line 109 of file EnergyFunction.h.


The documentation for this class was generated from the following file: