93 const Graph& G =
GA.constGraph();
102 for (
node v = G.firstNode(); v; v = v->succ()) {
103 GA.x(v) = coords[v].coords[0];
104 GA.y(v) = coords[v].coords[1];
116 const Graph& G =
GA.constGraph();
125 for (
node v = G.firstNode(); v; v = v->succ()) {
126 GA.x(v) = coords[v].coords[0];
127 GA.y(v) = coords[v].coords[1];
128 GA.z(v) = coords[v].coords[2];
135 using namespace energybased::dtree;
175 for (
node v =
pCurrLevel->graph().firstNode(); v; v = v->succ()) {
177 for (
int d = 0;
d <
Dim;
d++) {
184 for (
node v =
pCurrLevel->graph().firstNode(); v; v = v->succ()) {
189 for (
int d = 0;
d <
Dim;
d++) {
194 embedder.setPosition(v,
d, offset +
randomDouble(-1.0, 1.0));
200 if (m_useMultilevelWeights) {
202 for (
node v =
pCurrLevel->graph().firstNode(); v; v = v->succ()) {
206 for (
edge e =
pCurrLevel->graph().firstEdge(); e; e = e->succ()) {
207 embedder.setEdgeWeight(e,
pCurrLevel->edgeWeight(e));
214 m_maxIterationsPerLevel);
216 embedder.scaleNodes(3.0);
219 embedder.scaleNodes(1.0 / 3.0);
228 for (
node v =
pCurrLevel->graph().firstNode(); v; v = v->succ()) {
230 for (
int d = 0;
d <
Dim;
d++) {
Declaration of interface for layout algorithms (class LayoutModule)
void call(GraphAttributes &GA) override
Computes a layout of graph GA.
void call(GraphAttributes &GA) override
Computes a layout of graph GA.
bool m_useMultilevelWeights
int m_minIterationsPerLevel
int m_numIterationsCoarsestLevel
int m_numIterationsFinestLevel
double m_numIterationsFactorPerLevel
DTreeMultilevelEmbedder()
constructor with a given graph, allocates memory and does initialization
double m_thresholdFinestLevel
double m_thresholdCoarsestLevel
void call(const Graph &graph, NodeArray< NodeCoords > &coords)
call the multilevel embedder layout for graph, the result is stored in coords
double m_thresholdFactorPerLevel
int m_maxIterationsPerLevel
double m_scaleFactorPerLevel
Class for the representation of edges.
Stores additional attributes of a graph (like layout information).
static const long threeD
Corresponds to node attribute z(node). Note that all methods work on 2D coordinates only.
Data type for general directed graphs (adjacency list representation).
Interface of general layout algorithms.
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
bool isConnected(const Graph &G)
Returns true iff G is connected.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
double randomDouble(double low, double high)
Returns a random double value from the interval [low, high).
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
Declaration of simple graph algorithms.