#include <SpringEmbedderFR.h>

Public Types | |
| enum | Scaling { scInput, scUserBoundingBox, scScaleFunction } |
| The scaling method used by the algorithm. More... | |
Public Member Functions | |
| SpringEmbedderFR () | |
| Creates an instance of Fruchterman/Reingold layout. | |
| ~SpringEmbedderFR () | |
| void | call (GraphAttributes &GA) |
| Calls the layout algorithm for graph attributes GA. | |
| int | iterations () const |
| Returns the current setting of iterations. | |
| void | iterations (int i) |
| Sets the number of iterations to i. | |
| bool | noise () const |
| Returns the current setting of nodes. | |
| void | noise (bool on) |
| Sets the parameter noise to on. | |
| double | minDistCC () const |
| Returns the minimum distance between connected components. | |
| void | minDistCC (double x) |
| Sets the minimum distance between connected components to x. | |
| double | pageRatio () |
| Returns the page ratio. | |
| void | pageRatio (double x) |
| Sets the page ration to x. | |
| Scaling | scaling () const |
| Returns the current scaling method. | |
| void | scaling (Scaling sc) |
| Sets the method for scaling the inital layout to sc. | |
| double | scaleFunctionFactor () const |
| Returns the current scale function factor. | |
| void | scaleFunctionFactor (double f) |
| Sets the scale function factor to f. | |
| void | userBoundingBox (double xmin, double ymin, double xmax, double ymax) |
| Sets the user bounding box (used if scaling method is scUserBoundingBox). | |
Private Member Functions | |
| bool | initialize (GraphCopy &G, GraphCopyAttributes &AG) |
| void | mainStep (GraphCopy &G, GraphCopyAttributes &AG) |
| void | cleanup () |
| double | mylog2 (int x) |
Private Attributes | |
| NodeArray< ListIterator< node > > | m_lit |
| int | m_cF |
| double | m_width |
| double | m_height |
| double | m_txNull |
| double | m_tyNull |
| double | m_tx |
| double | m_ty |
| double | m_k |
| double | m_k2 |
| double | m_kk |
| int | m_ki |
| int | m_xA |
| int | m_yA |
| Array2D< List< node > > * | m_A |
| int | m_iterations |
| The number of iterations. | |
| double | m_fineness |
| The fineness of the grid. | |
| double | m_edgeLength |
| double | m_xleft |
| Bounding box (minimal x-coordinate). | |
| double | m_xright |
| Bounding box (maximal x-coordinate). | |
| double | m_ysmall |
| Bounding box (minimal y-coordinate). | |
| double | m_ybig |
| Bounding box (maximal y-coordinate). | |
| bool | m_noise |
| Perform random perturbations? | |
| Scaling | m_scaling |
| The scaling method. | |
| double | m_scaleFactor |
| The factor used if scaling type is scScaleFunction. | |
| double | m_bbXmin |
| User bounding box (minimal x-coordinate). | |
| double | m_bbYmin |
| User bounding box (maximal x-coordinate). | |
| double | m_bbXmax |
| User bounding box (minimal y-coordinate). | |
| double | m_bbYmax |
| User bounding box (maximal y-coordinate). | |
| double | m_minDistCC |
| The minimal distance between connected components. | |
| double | m_pageRatio |
| The page ratio. | |
The implementation used in SpringEmbedderFR is based on the following publication:
Thomas M. J. Fruchterman, Edward M. Reingold: Graph Drawing by Force-directed Placement. Software - Practice and Experience 21(11), pp. 1129-1164, 1991.
Fruchterman/Reingold layout provides the following optional parameters.
| Option | Type | Default | Description |
|---|---|---|---|
| iterations | int | 400 | The number of iterations performed in the optimization. |
| noise | bool | true | If set to true, (small) random perturbations are performed. |
| minDistCC | double | 20.0 | The minimum distance between connected components. |
| pageRatio | double | 1.0 | The page ratio. |
| scaling | Scaling | scScaleFunction | The scaling method for scaling the inital layout. |
| scaleFunctionFactor | double | 8.0 | The scale function factor (used if scaling = scScaleFunction). |
| userBoundingBox | rectangle | (0.0,100.0,0.0,100.0) | The user bounding box for scaling (used if scaling = scUserBoundingBox). |
Definition at line 109 of file SpringEmbedderFR.h.
The scaling method used by the algorithm.
| scInput | bounding box of input is used. |
| scUserBoundingBox | bounding box set by userBoundingBox() is used. |
| scScaleFunction | automatic scaling is used with parameter set by scaleFunctionFactor() (larger factor, larger b-box). |
Definition at line 113 of file SpringEmbedderFR.h.
| ogdf::SpringEmbedderFR::SpringEmbedderFR | ( | ) |
Creates an instance of Fruchterman/Reingold layout.
| ogdf::SpringEmbedderFR::~SpringEmbedderFR | ( | ) | [inline] |
Definition at line 124 of file SpringEmbedderFR.h.
| void ogdf::SpringEmbedderFR::call | ( | GraphAttributes & | GA | ) | [virtual] |
| int ogdf::SpringEmbedderFR::iterations | ( | ) | const [inline] |
| void ogdf::SpringEmbedderFR::iterations | ( | int | i | ) | [inline] |
| bool ogdf::SpringEmbedderFR::noise | ( | ) | const [inline] |
| void ogdf::SpringEmbedderFR::noise | ( | bool | on | ) | [inline] |
| double ogdf::SpringEmbedderFR::minDistCC | ( | ) | const [inline] |
Returns the minimum distance between connected components.
Definition at line 153 of file SpringEmbedderFR.h.
| void ogdf::SpringEmbedderFR::minDistCC | ( | double | x | ) | [inline] |
Sets the minimum distance between connected components to x.
Definition at line 156 of file SpringEmbedderFR.h.
| double ogdf::SpringEmbedderFR::pageRatio | ( | ) | [inline] |
| void ogdf::SpringEmbedderFR::pageRatio | ( | double | x | ) | [inline] |
| Scaling ogdf::SpringEmbedderFR::scaling | ( | ) | const [inline] |
| void ogdf::SpringEmbedderFR::scaling | ( | Scaling | sc | ) | [inline] |
Sets the method for scaling the inital layout to sc.
Definition at line 170 of file SpringEmbedderFR.h.
| double ogdf::SpringEmbedderFR::scaleFunctionFactor | ( | ) | const [inline] |
| void ogdf::SpringEmbedderFR::scaleFunctionFactor | ( | double | f | ) | [inline] |
| void ogdf::SpringEmbedderFR::userBoundingBox | ( | double | xmin, | |
| double | ymin, | |||
| double | xmax, | |||
| double | ymax | |||
| ) | [inline] |
Sets the user bounding box (used if scaling method is scUserBoundingBox).
Definition at line 185 of file SpringEmbedderFR.h.
| bool ogdf::SpringEmbedderFR::initialize | ( | GraphCopy & | G, | |
| GraphCopyAttributes & | AG | |||
| ) | [private] |
| void ogdf::SpringEmbedderFR::mainStep | ( | GraphCopy & | G, | |
| GraphCopyAttributes & | AG | |||
| ) | [private] |
| void ogdf::SpringEmbedderFR::cleanup | ( | ) | [inline, private] |
Definition at line 196 of file SpringEmbedderFR.h.
| double ogdf::SpringEmbedderFR::mylog2 | ( | int | x | ) | [inline, private] |
Definition at line 224 of file SpringEmbedderFR.h.
NodeArray<ListIterator<node> > ogdf::SpringEmbedderFR::m_lit [private] |
Definition at line 201 of file SpringEmbedderFR.h.
int ogdf::SpringEmbedderFR::m_cF [private] |
Definition at line 203 of file SpringEmbedderFR.h.
double ogdf::SpringEmbedderFR::m_width [private] |
Definition at line 205 of file SpringEmbedderFR.h.
double ogdf::SpringEmbedderFR::m_height [private] |
Definition at line 206 of file SpringEmbedderFR.h.
double ogdf::SpringEmbedderFR::m_txNull [private] |
Definition at line 208 of file SpringEmbedderFR.h.
double ogdf::SpringEmbedderFR::m_tyNull [private] |
Definition at line 209 of file SpringEmbedderFR.h.
double ogdf::SpringEmbedderFR::m_tx [private] |
Definition at line 210 of file SpringEmbedderFR.h.
double ogdf::SpringEmbedderFR::m_ty [private] |
Definition at line 211 of file SpringEmbedderFR.h.
double ogdf::SpringEmbedderFR::m_k [private] |
Definition at line 213 of file SpringEmbedderFR.h.
double ogdf::SpringEmbedderFR::m_k2 [private] |
Definition at line 214 of file SpringEmbedderFR.h.
double ogdf::SpringEmbedderFR::m_kk [private] |
Definition at line 215 of file SpringEmbedderFR.h.
int ogdf::SpringEmbedderFR::m_ki [private] |
Definition at line 216 of file SpringEmbedderFR.h.
int ogdf::SpringEmbedderFR::m_xA [private] |
Definition at line 218 of file SpringEmbedderFR.h.
int ogdf::SpringEmbedderFR::m_yA [private] |
Definition at line 219 of file SpringEmbedderFR.h.
Array2D<List<node> >* ogdf::SpringEmbedderFR::m_A [private] |
Definition at line 221 of file SpringEmbedderFR.h.
int ogdf::SpringEmbedderFR::m_iterations [private] |
double ogdf::SpringEmbedderFR::m_fineness [private] |
double ogdf::SpringEmbedderFR::m_edgeLength [private] |
Definition at line 235 of file SpringEmbedderFR.h.
double ogdf::SpringEmbedderFR::m_xleft [private] |
double ogdf::SpringEmbedderFR::m_xright [private] |
double ogdf::SpringEmbedderFR::m_ysmall [private] |
double ogdf::SpringEmbedderFR::m_ybig [private] |
bool ogdf::SpringEmbedderFR::m_noise [private] |
Scaling ogdf::SpringEmbedderFR::m_scaling [private] |
double ogdf::SpringEmbedderFR::m_scaleFactor [private] |
The factor used if scaling type is scScaleFunction.
Definition at line 245 of file SpringEmbedderFR.h.
double ogdf::SpringEmbedderFR::m_bbXmin [private] |
double ogdf::SpringEmbedderFR::m_bbYmin [private] |
double ogdf::SpringEmbedderFR::m_bbXmax [private] |
double ogdf::SpringEmbedderFR::m_bbYmax [private] |
double ogdf::SpringEmbedderFR::m_minDistCC [private] |
The minimal distance between connected components.
Definition at line 252 of file SpringEmbedderFR.h.
double ogdf::SpringEmbedderFR::m_pageRatio [private] |