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