Common base class for ogdf::SpringEmbedderBase and ogdf::SpringEmbedderGridVariant. More...
#include <ogdf/energybased/spring_embedder/SpringEmbedderBase.h>
Public Types | |
enum | Scaling { Scaling::input, Scaling::userBoundingBox, Scaling::scaleFunction, Scaling::useIdealEdgeLength } |
The scaling method used by the algorithm. More... | |
Public Member Functions | |
SpringEmbedderBase () | |
Constructor. More... | |
double | avgConvergenceFactor () const |
Returns the currently used average convergence factor. More... | |
void | avgConvergenceFactor (double f) |
Sets the average convergence factor to f . More... | |
virtual void | call (GraphAttributes &GA) override |
Computes a layout of graph GA . More... | |
double | coolDownFactor () const |
double | forceLimitStep () const |
SpringForceModel | forceModel () const |
Returns the currently used force model. More... | |
void | forceModel (SpringForceModel fm) |
Sets the used force model to fm . More... | |
SpringForceModel | forceModelImprove () const |
Returns the currently used force model for the improvement step. More... | |
void | forceModelImprove (SpringForceModel fm) |
Sets the used force model for the improvement step to fm . More... | |
double | idealEdgeLength () const |
Returns the current setting of ideal edge length. More... | |
void | idealEdgeLength (double len) |
Sets the ideal edge length to len . More... | |
int | iterations () const |
Returns the current setting of iterations. More... | |
void | iterations (int i) |
Sets the number of iterations to i . More... | |
int | iterationsImprove () const |
Returns the current setting of iterations for the improvement phase. More... | |
void | iterationsImprove (int i) |
Sets the number of iterations for the improvement phase to i . More... | |
double | maxConvergenceFactor () const |
Returns the currently used maximum convergence factor. More... | |
void | maxConvergenceFactor (double f) |
Sets the maximum convergence factor to f . More... | |
unsigned int | maxThreads () const |
Returns the maximal number of used threads. More... | |
void | maxThreads (unsigned int n) |
Sets the maximal number of used threads to n . More... | |
double | minDistCC () const |
Returns the minimum distance between connected components. More... | |
void | minDistCC (double x) |
Sets the minimum distance between connected components to x . More... | |
bool | noise () const |
Returns the current setting of noise. More... | |
void | noise (bool on) |
Sets the parameter noise to on . More... | |
double | pageRatio () |
Returns the page ratio. More... | |
void | pageRatio (double x) |
Sets the page ration to x . More... | |
double | scaleFunctionFactor () const |
Returns the current scale function factor. More... | |
void | scaleFunctionFactor (double f) |
Sets the scale function factor to f . More... | |
Scaling | scaling () const |
Returns the current scaling method. More... | |
void | scaling (Scaling sc) |
Sets the method for scaling the inital layout to sc . More... | |
DRect | userBoundingBox () const |
Gets the user bounding box. More... | |
void | userBoundingBox (double xmin, double ymin, double xmax, double ymax) |
Sets the user bounding box (used if scaling method is scUserBoundingBox). More... | |
Public Member Functions inherited from ogdf::LayoutModule | |
LayoutModule () | |
Initializes a layout module. More... | |
virtual | ~LayoutModule () |
void | operator() (GraphAttributes &GA) |
Computes a layout of graph GA . More... | |
Protected Member Functions | |
virtual void | callMaster (const GraphCopy ©, GraphAttributes &attr, DPoint &box)=0 |
Protected Attributes | |
double | m_avgConvergenceFactor |
convergence if avg. More... | |
DRect | m_boundingBox |
double | m_coolDownFactor |
double | m_forceLimitStep |
SpringForceModel | m_forceModel |
SpringForceModel | m_forceModelImprove |
The used force model. More... | |
double | m_idealEdgeLength |
The ideal edge length. More... | |
int | m_iterations |
The number of iterations. More... | |
int | m_iterationsImprove |
The number of iterations for the improvement phase. More... | |
double | m_maxConvergenceFactor |
convergence if max. More... | |
unsigned int | m_maxThreads |
The maximal number of used threads. More... | |
double | m_minDistCC |
The minimal distance between connected components. More... | |
bool | m_noise |
The used force model for the improvement phase. More... | |
double | m_pageRatio |
The page ratio. More... | |
double | m_scaleFactor |
The factor used if scaling type is scScaleFunction. More... | |
Scaling | m_scaling |
The scaling method. More... | |
DRect | m_userBoundingBox |
Common base class for ogdf::SpringEmbedderBase and ogdf::SpringEmbedderGridVariant.
Definition at line 54 of file SpringEmbedderBase.h.
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 57 of file SpringEmbedderBase.h.
|
inline |
Constructor.
Definition at line 65 of file SpringEmbedderBase.h.
|
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 187 of file SpringEmbedderBase.h.
|
inline |
Sets the average convergence factor to f
.
Definition at line 190 of file SpringEmbedderBase.h.
|
inlineoverridevirtual |
Computes a layout of graph GA
.
This method is the actual algorithm call and must be implemented by derived classes.
GA | is the input graph and will also be assigned the layout information. |
Implements ogdf::LayoutModule.
Definition at line 97 of file SpringEmbedderBase.h.
|
protectedpure virtual |
Implemented in ogdf::SpringEmbedderGridVariant.
|
inline |
Definition at line 235 of file SpringEmbedderBase.h.
|
inline |
Definition at line 237 of file SpringEmbedderBase.h.
|
inline |
Returns the currently used force model.
Definition at line 170 of file SpringEmbedderBase.h.
|
inline |
Sets the used force model to fm
.
Definition at line 173 of file SpringEmbedderBase.h.
|
inline |
Returns the currently used force model for the improvement step.
Definition at line 176 of file SpringEmbedderBase.h.
|
inline |
Sets the used force model for the improvement step to fm
.
Definition at line 179 of file SpringEmbedderBase.h.
|
inline |
Returns the current setting of ideal edge length.
Definition at line 240 of file SpringEmbedderBase.h.
|
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 247 of file SpringEmbedderBase.h.
|
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 216 of file SpringEmbedderBase.h.
|
inline |
Sets the number of iterations to i
.
Definition at line 219 of file SpringEmbedderBase.h.
|
inline |
Returns the current setting of iterations for the improvement phase.
Definition at line 226 of file SpringEmbedderBase.h.
|
inline |
Sets the number of iterations for the improvement phase to i
.
Definition at line 229 of file SpringEmbedderBase.h.
|
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 202 of file SpringEmbedderBase.h.
|
inline |
Sets the maximum convergence factor to f
.
Definition at line 205 of file SpringEmbedderBase.h.
|
inline |
Returns the maximal number of used threads.
Definition at line 288 of file SpringEmbedderBase.h.
|
inline |
Sets the maximal number of used threads to n
.
Definition at line 291 of file SpringEmbedderBase.h.
|
inline |
Returns the minimum distance between connected components.
Definition at line 256 of file SpringEmbedderBase.h.
|
inline |
Sets the minimum distance between connected components to x
.
Definition at line 259 of file SpringEmbedderBase.h.
|
inline |
Returns the current setting of noise.
Definition at line 250 of file SpringEmbedderBase.h.
|
inline |
Sets the parameter noise to on
.
Definition at line 253 of file SpringEmbedderBase.h.
|
inline |
Returns the page ratio.
Definition at line 262 of file SpringEmbedderBase.h.
|
inline |
Sets the page ration to x
.
Definition at line 265 of file SpringEmbedderBase.h.
|
inline |
Returns the current scale function factor.
Definition at line 274 of file SpringEmbedderBase.h.
|
inline |
Sets the scale function factor to f
.
Definition at line 277 of file SpringEmbedderBase.h.
|
inline |
Returns the current scaling method.
Definition at line 268 of file SpringEmbedderBase.h.
|
inline |
Sets the method for scaling the inital layout to sc
.
Definition at line 271 of file SpringEmbedderBase.h.
|
inline |
Gets the user bounding box.
Definition at line 285 of file SpringEmbedderBase.h.
|
inline |
Sets the user bounding box (used if scaling method is scUserBoundingBox).
Definition at line 280 of file SpringEmbedderBase.h.
|
protected |
convergence if avg.
displacement is at most this factor times ideal edge length
Definition at line 316 of file SpringEmbedderBase.h.
|
protected |
Definition at line 302 of file SpringEmbedderBase.h.
|
protected |
Definition at line 299 of file SpringEmbedderBase.h.
|
protected |
Definition at line 300 of file SpringEmbedderBase.h.
|
protected |
Definition at line 304 of file SpringEmbedderBase.h.
|
protected |
The used force model.
Definition at line 305 of file SpringEmbedderBase.h.
|
protected |
The ideal edge length.
Definition at line 298 of file SpringEmbedderBase.h.
|
protected |
The number of iterations.
Definition at line 296 of file SpringEmbedderBase.h.
|
protected |
The number of iterations for the improvement phase.
Definition at line 297 of file SpringEmbedderBase.h.
|
protected |
convergence if max.
displacement is at most this factor times ideal edge length
Definition at line 317 of file SpringEmbedderBase.h.
|
protected |
The maximal number of used threads.
Definition at line 319 of file SpringEmbedderBase.h.
|
protected |
The minimal distance between connected components.
Definition at line 313 of file SpringEmbedderBase.h.
|
protected |
The used force model for the improvement phase.
Perform random perturbations?
Definition at line 306 of file SpringEmbedderBase.h.
|
protected |
The page ratio.
Definition at line 314 of file SpringEmbedderBase.h.
|
protected |
The factor used if scaling type is scScaleFunction.
Definition at line 309 of file SpringEmbedderBase.h.
|
protected |
The scaling method.
Definition at line 308 of file SpringEmbedderBase.h.
|
protected |
Definition at line 311 of file SpringEmbedderBase.h.