Common base class for ogdf::SpringEmbedderBase and ogdf::SpringEmbedderGridVariant. More...
#include <ogdf/energybased/spring_embedder/SpringEmbedderBase.h>
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 ©, 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 |
Common base class for ogdf::SpringEmbedderBase and ogdf::SpringEmbedderGridVariant.
Definition at line 44 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 47 of file SpringEmbedderBase.h.
|
inline |
Constructor.
Definition at line 55 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 173 of file SpringEmbedderBase.h.
Sets the average convergence factor to f
.
Definition at line 176 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 87 of file SpringEmbedderBase.h.
|
protectedpure virtual |
Implemented in ogdf::SpringEmbedderGridVariant.
|
inline |
Definition at line 221 of file SpringEmbedderBase.h.
|
inline |
Definition at line 223 of file SpringEmbedderBase.h.
|
inline |
Returns the currently used force model.
Definition at line 156 of file SpringEmbedderBase.h.
|
inline |
Sets the used force model to fm
.
Definition at line 159 of file SpringEmbedderBase.h.
|
inline |
Returns the currently used force model for the improvement step.
Definition at line 162 of file SpringEmbedderBase.h.
|
inline |
Sets the used force model for the improvement step to fm
.
Definition at line 165 of file SpringEmbedderBase.h.
|
inline |
Returns the current setting of ideal edge length.
Definition at line 226 of file SpringEmbedderBase.h.
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.
|
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.
Sets the number of iterations to i
.
Definition at line 205 of file SpringEmbedderBase.h.
|
inline |
Returns the current setting of iterations for the improvement phase.
Definition at line 212 of file SpringEmbedderBase.h.
Sets the number of iterations for the improvement phase to i
.
Definition at line 215 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 188 of file SpringEmbedderBase.h.
Sets the maximum convergence factor to f
.
Definition at line 191 of file SpringEmbedderBase.h.
Returns the maximal number of used threads.
Definition at line 274 of file SpringEmbedderBase.h.
Sets the maximal number of used threads to n
.
Definition at line 277 of file SpringEmbedderBase.h.
|
inline |
Returns the minimum distance between connected components.
Definition at line 242 of file SpringEmbedderBase.h.
Sets the minimum distance between connected components to x
.
Definition at line 245 of file SpringEmbedderBase.h.
|
inline |
Returns the current setting of noise.
Definition at line 236 of file SpringEmbedderBase.h.
Sets the parameter noise to on
.
Definition at line 239 of file SpringEmbedderBase.h.
|
inline |
Returns the page ratio.
Definition at line 248 of file SpringEmbedderBase.h.
Sets the page ration to x
.
Definition at line 251 of file SpringEmbedderBase.h.
|
inline |
Returns the current scale function factor.
Definition at line 260 of file SpringEmbedderBase.h.
Sets the scale function factor to f
.
Definition at line 263 of file SpringEmbedderBase.h.
|
inline |
Returns the current scaling method.
Definition at line 254 of file SpringEmbedderBase.h.
Sets the method for scaling the inital layout to sc
.
Definition at line 257 of file SpringEmbedderBase.h.
|
inline |
Gets the user bounding box.
Definition at line 271 of file SpringEmbedderBase.h.
|
inline |
Sets the user bounding box (used if scaling method is scUserBoundingBox).
Definition at line 266 of file SpringEmbedderBase.h.
|
protected |
convergence if avg.
displacement is at most this factor times ideal edge length
Definition at line 302 of file SpringEmbedderBase.h.
|
protected |
Definition at line 288 of file SpringEmbedderBase.h.
|
protected |
Definition at line 285 of file SpringEmbedderBase.h.
|
protected |
Definition at line 286 of file SpringEmbedderBase.h.
|
protected |
Definition at line 290 of file SpringEmbedderBase.h.
|
protected |
The used force model.
Definition at line 291 of file SpringEmbedderBase.h.
|
protected |
The ideal edge length.
Definition at line 284 of file SpringEmbedderBase.h.
|
protected |
The number of iterations.
Definition at line 282 of file SpringEmbedderBase.h.
|
protected |
The number of iterations for the improvement phase.
Definition at line 283 of file SpringEmbedderBase.h.
|
protected |
convergence if max.
displacement is at most this factor times ideal edge length
Definition at line 303 of file SpringEmbedderBase.h.
The maximal number of used threads.
Definition at line 305 of file SpringEmbedderBase.h.
|
protected |
The minimal distance between connected components.
Definition at line 299 of file SpringEmbedderBase.h.
|
protected |
The used force model for the improvement phase.
Perform random perturbations?
Definition at line 292 of file SpringEmbedderBase.h.
|
protected |
The page ratio.
Definition at line 300 of file SpringEmbedderBase.h.
|
protected |
The factor used if scaling type is scScaleFunction.
Definition at line 295 of file SpringEmbedderBase.h.
|
protected |
The scaling method.
Definition at line 294 of file SpringEmbedderBase.h.
|
protected |
Definition at line 297 of file SpringEmbedderBase.h.