Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::spring_embedder::SpringEmbedderBase Class Referenceabstract

Common base class for ogdf::SpringEmbedderBase and ogdf::SpringEmbedderGridVariant. More...

#include <ogdf/energybased/spring_embedder/SpringEmbedderBase.h>

+ Inheritance diagram for ogdf::spring_embedder::SpringEmbedderBase:

Public Types

enum class  Scaling { input , userBoundingBox , scaleFunction , useIdealEdgeLength }
 The scaling method used by the algorithm. More...
 

Public Member Functions

 SpringEmbedderBase ()
 Constructor.
 
double avgConvergenceFactor () const
 Returns the currently used average convergence factor.
 
void avgConvergenceFactor (double f)
 Sets the average convergence factor to f.
 
virtual void call (GraphAttributes &GA) override
 Computes a layout of graph GA.
 
double coolDownFactor () const
 
double forceLimitStep () const
 
SpringForceModel forceModel () const
 Returns the currently used force model.
 
void forceModel (SpringForceModel fm)
 Sets the used force model to fm.
 
SpringForceModel forceModelImprove () const
 Returns the currently used force model for the improvement step.
 
void forceModelImprove (SpringForceModel fm)
 Sets the used force model for the improvement step to fm.
 
double idealEdgeLength () const
 Returns the current setting of ideal edge length.
 
void idealEdgeLength (double len)
 Sets the ideal edge length to len.
 
int iterations () const
 Returns the current setting of iterations.
 
void iterations (int i)
 Sets the number of iterations to i.
 
int iterationsImprove () const
 Returns the current setting of iterations for the improvement phase.
 
void iterationsImprove (int i)
 Sets the number of iterations for the improvement phase to i.
 
double maxConvergenceFactor () const
 Returns the currently used maximum convergence factor.
 
void maxConvergenceFactor (double f)
 Sets the maximum convergence factor to f.
 
unsigned int maxThreads () const
 Returns the maximal number of used threads.
 
void maxThreads (unsigned int n)
 Sets the maximal number of used threads to n.
 
double minDistCC () const
 Returns the minimum distance between connected components.
 
void minDistCC (double x)
 Sets the minimum distance between connected components to x.
 
bool noise () const
 Returns the current setting of noise.
 
void noise (bool on)
 Sets the parameter noise to on.
 
double pageRatio ()
 Returns the page ratio.
 
void pageRatio (double x)
 Sets the page ration to x.
 
double scaleFunctionFactor () const
 Returns the current scale function factor.
 
void scaleFunctionFactor (double f)
 Sets the scale function factor to f.
 
Scaling scaling () const
 Returns the current scaling method.
 
void scaling (Scaling sc)
 Sets the method for scaling the inital layout to sc.
 
DRect userBoundingBox () const
 Gets the user bounding box.
 
void userBoundingBox (double xmin, double ymin, double xmax, double ymax)
 Sets the user bounding box (used if scaling method is scUserBoundingBox).
 
- Public Member Functions inherited from ogdf::LayoutModule
 LayoutModule ()
 Initializes a layout module.
 
virtual ~LayoutModule ()
 
void operator() (GraphAttributes &GA)
 Computes a layout of graph GA.
 

Protected Member Functions

virtual void callMaster (const GraphCopy &copy, GraphAttributes &attr, DPoint &box)=0
 

Protected Attributes

double m_avgConvergenceFactor
 convergence if avg.
 
DRect m_boundingBox
 
double m_coolDownFactor
 
double m_forceLimitStep
 
SpringForceModel m_forceModel
 
SpringForceModel m_forceModelImprove
 The used force model.
 
double m_idealEdgeLength
 The ideal edge length.
 
int m_iterations
 The number of iterations.
 
int m_iterationsImprove
 The number of iterations for the improvement phase.
 
double m_maxConvergenceFactor
 convergence if max.
 
unsigned int m_maxThreads
 The maximal number of used threads.
 
double m_minDistCC
 The minimal distance between connected components.
 
bool m_noise
 The used force model for the improvement phase.
 
double m_pageRatio
 The page ratio.
 
double m_scaleFactor
 The factor used if scaling type is scScaleFunction.
 
Scaling m_scaling
 The scaling method.
 
DRect m_userBoundingBox
 

Detailed Description

Common base class for ogdf::SpringEmbedderBase and ogdf::SpringEmbedderGridVariant.

Definition at line 44 of file SpringEmbedderBase.h.

Member Enumeration Documentation

◆ Scaling

The scaling method used by the algorithm.

Enumerator
input 

bounding box of input is used.

userBoundingBox 

bounding box set by userBoundingBox() is used.

scaleFunction 

automatic scaling is used with parameter set by scaleFunctionFactor() (larger factor, larger b-box).

useIdealEdgeLength 

use the given ideal edge length to scale the layout suitably.

Definition at line 47 of file SpringEmbedderBase.h.

Constructor & Destructor Documentation

◆ SpringEmbedderBase()

ogdf::spring_embedder::SpringEmbedderBase::SpringEmbedderBase ( )
inline

Constructor.

Definition at line 55 of file SpringEmbedderBase.h.

Member Function Documentation

◆ avgConvergenceFactor() [1/2]

double ogdf::spring_embedder::SpringEmbedderBase::avgConvergenceFactor ( ) const
inline

Returns the currently used average convergence factor.

This factor is used for detecting convergence of the energy system. With respect to the average displacement of a node in a single step, we assume to have convergence if it is at most m_avgConvergenceFactor * m_idealEdgeLength.

Definition at line 173 of file SpringEmbedderBase.h.

◆ avgConvergenceFactor() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::avgConvergenceFactor ( double  f)
inline

Sets the average convergence factor to f.

Definition at line 176 of file SpringEmbedderBase.h.

◆ call()

virtual void ogdf::spring_embedder::SpringEmbedderBase::call ( GraphAttributes GA)
inlineoverridevirtual

Computes a layout of graph GA.

This method is the actual algorithm call and must be implemented by derived classes.

Parameters
GAis the input graph and will also be assigned the layout information.

Implements ogdf::LayoutModule.

Definition at line 87 of file SpringEmbedderBase.h.

◆ callMaster()

virtual void ogdf::spring_embedder::SpringEmbedderBase::callMaster ( const GraphCopy copy,
GraphAttributes attr,
DPoint box 
)
protectedpure virtual

◆ coolDownFactor()

double ogdf::spring_embedder::SpringEmbedderBase::coolDownFactor ( ) const
inline

Definition at line 221 of file SpringEmbedderBase.h.

◆ forceLimitStep()

double ogdf::spring_embedder::SpringEmbedderBase::forceLimitStep ( ) const
inline

Definition at line 223 of file SpringEmbedderBase.h.

◆ forceModel() [1/2]

SpringForceModel ogdf::spring_embedder::SpringEmbedderBase::forceModel ( ) const
inline

Returns the currently used force model.

Definition at line 156 of file SpringEmbedderBase.h.

◆ forceModel() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::forceModel ( SpringForceModel  fm)
inline

Sets the used force model to fm.

Definition at line 159 of file SpringEmbedderBase.h.

◆ forceModelImprove() [1/2]

SpringForceModel ogdf::spring_embedder::SpringEmbedderBase::forceModelImprove ( ) const
inline

Returns the currently used force model for the improvement step.

Definition at line 162 of file SpringEmbedderBase.h.

◆ forceModelImprove() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::forceModelImprove ( SpringForceModel  fm)
inline

Sets the used force model for the improvement step to fm.

Definition at line 165 of file SpringEmbedderBase.h.

◆ idealEdgeLength() [1/2]

double ogdf::spring_embedder::SpringEmbedderBase::idealEdgeLength ( ) const
inline

Returns the current setting of ideal edge length.

Definition at line 226 of file SpringEmbedderBase.h.

◆ idealEdgeLength() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::idealEdgeLength ( double  len)
inline

Sets the ideal edge length to len.

Edge lengths are measured between the centers of the two nodes, i.e., node sizes are not taken into account.

Definition at line 233 of file SpringEmbedderBase.h.

◆ iterations() [1/2]

int ogdf::spring_embedder::SpringEmbedderBase::iterations ( ) const
inline

Returns the current setting of iterations.

This setting limits the number of optimization rounds. If convergence (with respect to node displacement) is detected, the optimization process is immediately finished.

Definition at line 202 of file SpringEmbedderBase.h.

◆ iterations() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::iterations ( int  i)
inline

Sets the number of iterations to i.

Definition at line 205 of file SpringEmbedderBase.h.

◆ iterationsImprove() [1/2]

int ogdf::spring_embedder::SpringEmbedderBase::iterationsImprove ( ) const
inline

Returns the current setting of iterations for the improvement phase.

Definition at line 212 of file SpringEmbedderBase.h.

◆ iterationsImprove() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::iterationsImprove ( int  i)
inline

Sets the number of iterations for the improvement phase to i.

Definition at line 215 of file SpringEmbedderBase.h.

◆ maxConvergenceFactor() [1/2]

double ogdf::spring_embedder::SpringEmbedderBase::maxConvergenceFactor ( ) const
inline

Returns the currently used maximum convergence factor.

This factor is used for detecting convergence of the energy system. With respect to the maximum displacement of a node in a single step, we assume to have convergence if it is at most m_maxConvergenceFactor * m_idealEdgeLength.

Definition at line 188 of file SpringEmbedderBase.h.

◆ maxConvergenceFactor() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::maxConvergenceFactor ( double  f)
inline

Sets the maximum convergence factor to f.

Definition at line 191 of file SpringEmbedderBase.h.

◆ maxThreads() [1/2]

unsigned int ogdf::spring_embedder::SpringEmbedderBase::maxThreads ( ) const
inline

Returns the maximal number of used threads.

Definition at line 274 of file SpringEmbedderBase.h.

◆ maxThreads() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::maxThreads ( unsigned int  n)
inline

Sets the maximal number of used threads to n.

Definition at line 277 of file SpringEmbedderBase.h.

◆ minDistCC() [1/2]

double ogdf::spring_embedder::SpringEmbedderBase::minDistCC ( ) const
inline

Returns the minimum distance between connected components.

Definition at line 242 of file SpringEmbedderBase.h.

◆ minDistCC() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::minDistCC ( double  x)
inline

Sets the minimum distance between connected components to x.

Definition at line 245 of file SpringEmbedderBase.h.

◆ noise() [1/2]

bool ogdf::spring_embedder::SpringEmbedderBase::noise ( ) const
inline

Returns the current setting of noise.

Definition at line 236 of file SpringEmbedderBase.h.

◆ noise() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::noise ( bool  on)
inline

Sets the parameter noise to on.

Definition at line 239 of file SpringEmbedderBase.h.

◆ pageRatio() [1/2]

double ogdf::spring_embedder::SpringEmbedderBase::pageRatio ( )
inline

Returns the page ratio.

Definition at line 248 of file SpringEmbedderBase.h.

◆ pageRatio() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::pageRatio ( double  x)
inline

Sets the page ration to x.

Definition at line 251 of file SpringEmbedderBase.h.

◆ scaleFunctionFactor() [1/2]

double ogdf::spring_embedder::SpringEmbedderBase::scaleFunctionFactor ( ) const
inline

Returns the current scale function factor.

Definition at line 260 of file SpringEmbedderBase.h.

◆ scaleFunctionFactor() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::scaleFunctionFactor ( double  f)
inline

Sets the scale function factor to f.

Definition at line 263 of file SpringEmbedderBase.h.

◆ scaling() [1/2]

Scaling ogdf::spring_embedder::SpringEmbedderBase::scaling ( ) const
inline

Returns the current scaling method.

Definition at line 254 of file SpringEmbedderBase.h.

◆ scaling() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::scaling ( Scaling  sc)
inline

Sets the method for scaling the inital layout to sc.

Definition at line 257 of file SpringEmbedderBase.h.

◆ userBoundingBox() [1/2]

DRect ogdf::spring_embedder::SpringEmbedderBase::userBoundingBox ( ) const
inline

Gets the user bounding box.

Definition at line 271 of file SpringEmbedderBase.h.

◆ userBoundingBox() [2/2]

void ogdf::spring_embedder::SpringEmbedderBase::userBoundingBox ( double  xmin,
double  ymin,
double  xmax,
double  ymax 
)
inline

Sets the user bounding box (used if scaling method is scUserBoundingBox).

Definition at line 266 of file SpringEmbedderBase.h.

Member Data Documentation

◆ m_avgConvergenceFactor

double ogdf::spring_embedder::SpringEmbedderBase::m_avgConvergenceFactor
protected

convergence if avg.

displacement is at most this factor times ideal edge length

Definition at line 302 of file SpringEmbedderBase.h.

◆ m_boundingBox

DRect ogdf::spring_embedder::SpringEmbedderBase::m_boundingBox
protected

Definition at line 288 of file SpringEmbedderBase.h.

◆ m_coolDownFactor

double ogdf::spring_embedder::SpringEmbedderBase::m_coolDownFactor
protected

Definition at line 285 of file SpringEmbedderBase.h.

◆ m_forceLimitStep

double ogdf::spring_embedder::SpringEmbedderBase::m_forceLimitStep
protected

Definition at line 286 of file SpringEmbedderBase.h.

◆ m_forceModel

SpringForceModel ogdf::spring_embedder::SpringEmbedderBase::m_forceModel
protected

Definition at line 290 of file SpringEmbedderBase.h.

◆ m_forceModelImprove

SpringForceModel ogdf::spring_embedder::SpringEmbedderBase::m_forceModelImprove
protected

The used force model.

Definition at line 291 of file SpringEmbedderBase.h.

◆ m_idealEdgeLength

double ogdf::spring_embedder::SpringEmbedderBase::m_idealEdgeLength
protected

The ideal edge length.

Definition at line 284 of file SpringEmbedderBase.h.

◆ m_iterations

int ogdf::spring_embedder::SpringEmbedderBase::m_iterations
protected

The number of iterations.

Definition at line 282 of file SpringEmbedderBase.h.

◆ m_iterationsImprove

int ogdf::spring_embedder::SpringEmbedderBase::m_iterationsImprove
protected

The number of iterations for the improvement phase.

Definition at line 283 of file SpringEmbedderBase.h.

◆ m_maxConvergenceFactor

double ogdf::spring_embedder::SpringEmbedderBase::m_maxConvergenceFactor
protected

convergence if max.

displacement is at most this factor times ideal edge length

Definition at line 303 of file SpringEmbedderBase.h.

◆ m_maxThreads

unsigned int ogdf::spring_embedder::SpringEmbedderBase::m_maxThreads
protected

The maximal number of used threads.

Definition at line 305 of file SpringEmbedderBase.h.

◆ m_minDistCC

double ogdf::spring_embedder::SpringEmbedderBase::m_minDistCC
protected

The minimal distance between connected components.

Definition at line 299 of file SpringEmbedderBase.h.

◆ m_noise

bool ogdf::spring_embedder::SpringEmbedderBase::m_noise
protected

The used force model for the improvement phase.

Perform random perturbations?

Definition at line 292 of file SpringEmbedderBase.h.

◆ m_pageRatio

double ogdf::spring_embedder::SpringEmbedderBase::m_pageRatio
protected

The page ratio.

Definition at line 300 of file SpringEmbedderBase.h.

◆ m_scaleFactor

double ogdf::spring_embedder::SpringEmbedderBase::m_scaleFactor
protected

The factor used if scaling type is scScaleFunction.

Definition at line 295 of file SpringEmbedderBase.h.

◆ m_scaling

Scaling ogdf::spring_embedder::SpringEmbedderBase::m_scaling
protected

The scaling method.

Definition at line 294 of file SpringEmbedderBase.h.

◆ m_userBoundingBox

DRect ogdf::spring_embedder::SpringEmbedderBase::m_userBoundingBox
protected

Definition at line 297 of file SpringEmbedderBase.h.


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