51namespace spring_embedder {
116 for (
node v : G.nodes) {
117 nodesInCC[component[v]].pushBack(v);
124 for (
int i = 0; i < numCC; ++i) {
136 GA.
x(vOrig) = GA.
y(vOrig) = 0;
137 boundingBox[i] =
DPoint(0, 0);
154 for (
int i = 0; i < numCC; ++i) {
157 const double dx = offset[i].m_x;
158 const double dy = offset[i].m_y;
162 for (
node v : nodes) {
Declaration and implementation of Array class and Array algorithms.
Includes declaration of graph class.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Declaration of graph copy classes.
Decralation of GraphElement and GraphList classes.
Declaration of interface for layout algorithms (class LayoutModule)
Declares class LayoutStandards which specifies default / standard values used in graph layouts.
Declaration of doubly linked lists and iterators.
Declaration of SpringForceModel enumeration.
Decalration of System class which provides unified access to system information.
Declaration of class TileToRowsCCPacker.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
The parameterized class Array implements dynamic arrays of type E.
Rectangles with real coordinates.
Stores additional attributes of a graph (like layout information).
double y(node v) const
Returns the y-coordinate of node v.
double x(node v) const
Returns the x-coordinate of node v.
const Graph & constGraph() const
Returns a reference to the associated graph.
void clearAllBends()
Removes all edge bends.
const Graph & original() const
Returns a reference to the original graph.
Copies of graphs supporting edge splitting.
void setOriginalGraph(const Graph *G) override
Associates the graph copy with G, but does not create any nodes or edges.
void clear() override
Removes all nodes and edges from this copy but does not break the link with the original graph.
Data type for general directed graphs (adjacency list representation).
int numberOfNodes() const
Returns the number of nodes in the graph.
node firstNode() const
Returns the first node in the list of all nodes.
std::pair< int, int > insert(const NI &nodesBegin, const NI &nodesEnd, const EI &edgesBegin, const EI &edgesEnd, NodeArray< node > &nodeMap, EdgeArray< edge > &edgeMap)
Inserts a copy of a given subgraph into this graph.
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.
Class for the representation of nodes.
void init(const Base *base=nullptr)
Reinitializes the array. Associates the array with the matching registry of base.
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.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
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, ArrayBuffer< node > *reprs=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
The namespace for all OGDF objects.
GenericPoint< double > DPoint
Representing two-dimensional point with real coordinates.
HypergraphRegistry< HypernodeElement >::iterator begin(const HypergraphRegistry< HypernodeElement > &self)
bool filter_any_edge(edge e)
std::function<bool(edge)> that returns true for any edge e
HypergraphRegistry< HypernodeElement >::iterator end(const HypergraphRegistry< HypernodeElement > &self)
Declaration of simple graph algorithms.