41namespace spring_embedder {
88 const Graph& G =
GA.constGraph();
106 for (
node v : G.nodes) {
107 nodesInCC[component[v]].pushBack(v);
113 for (
int i = 0; i < numCC; ++i) {
117 const int n =
GC.numberOfNodes();
123 boundingBox[i] =
DPoint(0, 0);
140 for (
int i = 0; i < numCC; ++i) {
143 const double dx = offset[i].m_x;
144 const double dy = offset[i].m_y;
148 for (
node v : nodes) {
Declaration of graph copy classes.
Declaration of interface for layout algorithms (class LayoutModule)
Declaration of SpringForceModel enumeration.
Declaration of class TileToRowsCCPacker.
The parameterized class Array implements dynamic arrays of type E.
Rectangles with real coordinates.
Dynamic arrays indexed with edges.
Stores additional attributes of a graph (like layout information).
Copies of graphs supporting edge splitting.
void createEmpty(const Graph &G)
Associates the graph copy with G, but does not create any nodes or edges.
Data type for general directed graphs (adjacency list representation).
Interface of general layout algorithms.
static double defaultNodeSeparation()
Returns the global default node separation.
static double defaultNodeWidth()
Returns the global default width for nodes.
static double defaultNodeHeight()
Returns the global default height for nodes.
static double defaultCCSeparation()
Returns the global default separation between connected components.
Doubly linked lists (maintaining the length of the list).
Encapsulates a pointer to a list element.
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
static int numberOfProcessors()
Returns the number of processors (cores) available on the current system.
The tile-to-rows algorithm for packing drawings of connected components.
virtual void call(Array< DPoint > &box, Array< DPoint > &offset, double pageRatio=1.0) override
Arranges the rectangles given by box.
Common base class for ogdf::SpringEmbedderBase and ogdf::SpringEmbedderGridVariant.
double maxConvergenceFactor() const
Returns the currently used maximum convergence factor.
void forceModel(SpringForceModel fm)
Sets the used force model to fm.
double m_avgConvergenceFactor
convergence if avg.
virtual void callMaster(const GraphCopy ©, GraphAttributes &attr, DPoint &box)=0
int m_iterationsImprove
The number of iterations for the improvement phase.
SpringForceModel m_forceModelImprove
The used force model.
double forceLimitStep() const
void userBoundingBox(double xmin, double ymin, double xmax, double ymax)
Sets the user bounding box (used if scaling method is scUserBoundingBox).
double scaleFunctionFactor() const
Returns the current scale function factor.
void forceModelImprove(SpringForceModel fm)
Sets the used force model for the improvement step to fm.
void scaleFunctionFactor(double f)
Sets the scale function factor to f.
Scaling scaling() const
Returns the current scaling method.
void noise(bool on)
Sets the parameter noise to on.
virtual void call(GraphAttributes &GA) override
Computes a layout of graph GA.
SpringForceModel m_forceModel
Scaling m_scaling
The scaling method.
SpringForceModel forceModelImprove() const
Returns the currently used force model for the improvement step.
DRect userBoundingBox() const
Gets the user bounding box.
int m_iterations
The number of iterations.
unsigned int m_maxThreads
The maximal number of used threads.
void maxConvergenceFactor(double f)
Sets the maximum convergence factor to f.
bool noise() const
Returns the current setting of noise.
void idealEdgeLength(double len)
Sets the ideal edge length to len.
void minDistCC(double x)
Sets the minimum distance between connected components to x.
bool m_noise
The used force model for the improvement phase.
double m_minDistCC
The minimal distance between connected components.
void avgConvergenceFactor(double f)
Sets the average convergence factor to f.
void iterationsImprove(int i)
Sets the number of iterations for the improvement phase to i.
double m_pageRatio
The page ratio.
SpringForceModel forceModel() const
Returns the currently used force model.
void scaling(Scaling sc)
Sets the method for scaling the inital layout to sc.
SpringEmbedderBase()
Constructor.
int iterationsImprove() const
Returns the current setting of iterations for the improvement phase.
double idealEdgeLength() const
Returns the current setting of ideal edge length.
double coolDownFactor() const
int iterations() const
Returns the current setting of iterations.
unsigned int maxThreads() const
Returns the maximal number of used threads.
double m_idealEdgeLength
The ideal edge length.
double m_maxConvergenceFactor
convergence if max.
double avgConvergenceFactor() const
Returns the currently used average convergence factor.
void maxThreads(unsigned int n)
Sets the maximal number of used threads to n.
double pageRatio()
Returns the page ratio.
void iterations(int i)
Sets the number of iterations to i.
double m_scaleFactor
The factor used if scaling type is scScaleFunction.
void pageRatio(double x)
Sets the page ration to x.
Scaling
The scaling method used by the algorithm.
@ input
bounding box of input is used.
@ useIdealEdgeLength
use the given ideal edge length to scale the layout suitably.
@ userBoundingBox
bounding box set by userBoundingBox() is used.
@ scaleFunction
automatic scaling is used with parameter set by scaleFunctionFactor() (larger factor,...
double minDistCC() const
Returns the minimum distance between connected components.
int connectedComponents(const Graph &G, NodeArray< int > &component, List< node > *isolated=nullptr)
Computes the connected components of G and optionally generates a list of isolated nodes.
void makeSimpleUndirected(Graph &G)
Removes all self-loops and all but one edge of each bundle of undirected parallel edges.
SpringForceModel
The force model used for computing forces on nodes.
@ FruchtermanReingold
the force model proposed by Fruchterman and Reingold.
@ FruchtermanReingoldModRep
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
GenericPoint< double > DPoint
Representing two-dimensional point with real coordinates.
Declaration of simple graph algorithms.