|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
51 namespace 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) {
double coolDownFactor() const
The namespace for all OGDF objects.
Stores additional attributes of a graph (like layout information).
void maxConvergenceFactor(double f)
Sets the maximum convergence factor to f.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
bool noise() const
Returns the current setting of noise.
void idealEdgeLength(double len)
Sets the ideal edge length to len.
Declaration of SpringForceModel enumeration.
@ scaleFunction
automatic scaling is used with parameter set by scaleFunctionFactor() (larger factor,...
Includes declaration of graph class.
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.
Declaration of classes GenericPoint, GenericPolyline, GenericLine, GenericSegment,...
void setOriginalGraph(const Graph *G) override
Associates the graph copy with G, but does not create any nodes or edges.
Decalration of System class which provides unified access to system information.
HypergraphRegistry< HypernodeElement >::iterator begin(const HypergraphRegistry< HypernodeElement > &self)
double maxConvergenceFactor() const
Returns the currently used maximum convergence factor.
double x(node v) const
Returns the x-coordinate of node v.
SpringEmbedderBase()
Constructor.
bool filter_any_edge(edge e)
std::function<bool(edge)> that returns true for any edge e
SpringForceModel forceModelImprove() const
Returns the currently used force model for the improvement step.
Copies of graphs supporting edge splitting.
unsigned int maxThreads() const
Returns the maximal number of used threads.
Declaration of interface for layout algorithms (class LayoutModule)
static double defaultNodeHeight()
Returns the global default height for nodes.
void clear() override
Removes all nodes and edges from this copy but does not break the link with the original graph.
void makeSimpleUndirected(Graph &G)
Removes all self-loops and all but one edge of each bundle of undirected parallel edges.
double m_avgConvergenceFactor
convergence if avg.
void maxThreads(unsigned int n)
Sets the maximal number of used threads to n.
const Graph & constGraph() const
Returns a reference to the associated graph.
void iterationsImprove(int i)
Sets the number of iterations for the improvement phase to i.
int m_iterationsImprove
The number of iterations for the improvement phase.
Common base class for ogdf::SpringEmbedderBase and ogdf::SpringEmbedderGridVariant.
DRect userBoundingBox() const
Gets the user bounding box.
bool m_noise
The used force model for the improvement phase.
void iterations(int i)
Sets the number of iterations to i.
double avgConvergenceFactor() const
Returns the currently used average convergence factor.
void scaleFunctionFactor(double f)
Sets the scale function factor to f.
@ useIdealEdgeLength
use the given ideal edge length to scale the layout suitably.
double y(node v) const
Returns the y-coordinate of node v.
static void copy(const T &from, T &to)
int m_iterations
The number of iterations.
int numberOfNodes() const
Returns the number of nodes in the graph.
static double defaultCCSeparation()
Returns the global default separation between connected components.
Scaling
The scaling method used by the algorithm.
Declares class LayoutStandards which specifies default / standard values used in graph layouts.
The parameterized class Array implements dynamic arrays of type E.
Decralation of GraphElement and GraphList classes.
Rectangles with real coordinates.
void forceModel(SpringForceModel fm)
Sets the used force model to fm.
node firstNode() const
Returns the first node in the list of all nodes.
double m_scaleFactor
The factor used if scaling type is scScaleFunction.
virtual void call(Array< DPoint > &box, Array< DPoint > &offset, double pageRatio=1.0) override
Arranges the rectangles given by box.
virtual void call(GraphAttributes &GA) override
Computes a layout of graph GA.
unsigned int m_maxThreads
The maximal number of used threads.
Declaration of graph copy classes.
Doubly linked lists (maintaining the length of the list).
RegisteredArray for nodes, edges and adjEntries of a graph.
Data type for general directed graphs (adjacency list representation).
void userBoundingBox(double xmin, double ymin, double xmax, double ymax)
Sets the user bounding box (used if scaling method is scUserBoundingBox).
void clearAllBends()
Removes all edge bends.
void forceModelImprove(SpringForceModel fm)
Sets the used force model for the improvement step to fm.
double m_minDistCC
The minimal distance between connected components.
virtual void callMaster(const GraphCopy ©, GraphAttributes &attr, DPoint &box)=0
int iterationsImprove() const
Returns the current setting of iterations for the improvement phase.
GenericPoint< double > DPoint
Representing two-dimensional point with real coordinates.
SpringForceModel forceModel() const
Returns the currently used force model.
Declaration of class TileToRowsCCPacker.
void pageRatio(double x)
Sets the page ration to x.
void minDistCC(double x)
Sets the minimum distance between connected components to x.
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.
void scaling(Scaling sc)
Sets the method for scaling the inital layout to sc.
Scaling scaling() const
Returns the current scaling method.
Scaling m_scaling
The scaling method.
SpringForceModel
The force model used for computing forces on nodes.
HypergraphRegistry< HypernodeElement >::iterator end(const HypergraphRegistry< HypernodeElement > &self)
double idealEdgeLength() const
Returns the current setting of ideal edge length.
SpringForceModel m_forceModel
@ userBoundingBox
bounding box set by userBoundingBox() is used.
double pageRatio()
Returns the page ratio.
Declaration and implementation of Array class and Array algorithms.
@ input
bounding box of input is used.
double m_maxConvergenceFactor
convergence if max.
@ FruchtermanReingoldModRep
Declaration of doubly linked lists and iterators.
double m_idealEdgeLength
The ideal edge length.
void init(const Graph *base=nullptr)
Reinitializes the array. Associates the array with the matching registry of base.
double forceLimitStep() const
@ FruchtermanReingold
the force model proposed by Fruchterman and Reingold.
void noise(bool on)
Sets the parameter noise to on.
void avgConvergenceFactor(double f)
Sets the average convergence factor to f.
Encapsulates a pointer to a list element.
The tile-to-rows algorithm for packing drawings of connected components.
static double defaultNodeWidth()
Returns the global default width for nodes.
int iterations() const
Returns the current setting of iterations.
Class for the representation of nodes.
double scaleFunctionFactor() const
Returns the current scale function factor.
Declaration of simple graph algorithms.
static double defaultNodeSeparation()
Returns the global default node separation.
static int numberOfProcessors()
Returns the number of processors (cores) available on the current system.
double m_pageRatio
The page ratio.
SpringForceModel m_forceModelImprove
The used force model.
const Graph & original() const
Returns a reference to the original graph.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Interface of general layout algorithms.
double minDistCC() const
Returns the minimum distance between connected components.