Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

FastMultipoleEmbedder.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Graph.h>
39 
40 namespace ogdf {
41 
43 
47 {
53 
54 public:
57 
60 
62  void call(
63  const Graph& G,
64  NodeArray<float>& nodeXPosition,
65  NodeArray<float>& nodeYPosition,
66  const EdgeArray<float>& edgeLength,
67  const NodeArray<float>& nodeSize);
68 
70  void call(GraphAttributes &GA, const EdgeArray<float>& edgeLength, const NodeArray<float>& nodeSize);
71 
73  virtual void call(GraphAttributes &GA) override;
74 
76  void setNumIterations(uint32_t numIterations) { m_numIterations = numIterations; }
77 
79  void setMultipolePrec(uint32_t precision) { m_precisionParameter = precision; }
80 
82  void setRandomize(bool b) { m_randomize = b; }
83 
85  void setDefaultEdgeLength(float edgeLength) { m_defaultEdgeLength = edgeLength; }
86 
88  void setDefaultNodeSize(float nodeSize) { m_defaultNodeSize = nodeSize; }
89 
91  void setNumberOfThreads(uint32_t numThreads) {
92 #ifndef OGDF_MEMORY_POOL_NTS
93  m_maxNumberOfThreads = numThreads;
94 #endif
95  }
96 
97 #if 0
98  void setEnablePostProcessing(bool b) { m_doPostProcessing = b; }
99 #endif
100 
101 private:
102  void initOptions();
103 
104  void runMultipole();
105 
106  void runSingle();
107 
109  void run(uint32_t numIterations);
110 
112  void allocate(uint32_t numNodes, uint32_t numEdges);
113 
115  void deallocate();
116 
117  uint32_t m_numIterations;
118 
120 
122 
124 
126 
128 
130 
132 
134 
136 };
137 
138 
140 
144 {
147 
148 public:
150  FastMultipoleMultilevelEmbedder() : m_iMaxNumThreads(1) {}
152  void call(GraphAttributes &GA) override;
153 
155  void multilevelUntilNumNodesAreLess(int nodesBound) { m_multiLevelNumNodesBound = nodesBound; }
156 
157  void maxNumThreads(int numThreads) { m_iMaxNumThreads = numThreads; }
158 private:
160  void computeAutoEdgeLength(const GraphAttributes& GA, EdgeArray<float>& edgeLength, float factor = 1.0f);
161 
163  void run(GraphAttributes& GA, const EdgeArray<float>& edgeLength);
164 
166  void createMultiLevelGraphs(Graph* pGraph, GraphAttributes& GA, const EdgeArray<float>& edgeLength);
167 
169  void initFinestLevel(GraphAttributes &GA, const EdgeArray<float>& edgeLength);
170 
172  void layoutCurrentLevel();
173 
175  void assignPositionsFromPrevLevel();
176 
178  void writeCurrentToGraphAttributes(GraphAttributes& GA);
179 
181  void nextLevel();
182 
184  void initCurrentLevel();
185 
187  void deleteMultiLevelGraphs();
188 
190  void dumpCurrentLevel(const char *filename);
191 
193  uint32_t numberOfIterationsByLevelNr(uint32_t levelNr);
194 
198 
202 
210 
213 };
214 
215 } // end of namespace ogdf
FastMultipoleMultilevelEmbedder()
Constructor, just sets number of maximum threads.
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:472
the main global options for a run
Definition: FMEFunc.h:68
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
void setDefaultEdgeLength(float edgeLength)
Definitions of various auxiliary classes for FME layout.
Declaration of class GalaxyMultilevelBuilder.
void multilevelUntilNumNodesAreLess(int nodesBound)
sets the bound for the number of nodes for multilevel step
void setDefaultNodeSize(float nodeSize)
Declaration of class FMEThread.
Stores additional attributes of a graph (like layout information).
void setMultipolePrec(uint32_t precision)
sets the number of coefficients for the expansions. default = 4
void setNumIterations(uint32_t numIterations)
sets the maximum number of iterations
The fast multipole multilevel embedder approach for force-directed multilevel layout.
Declaration of interface for layout algorithms (class LayoutModule)
Interface of general layout algorithms.
Definition: LayoutModule.h:44
void setNumberOfThreads(uint32_t numThreads)
Includes declaration of graph class.
The fast multipole embedder approach for force-directed layout.
The namespace for all OGDF objects.
void setRandomize(bool b)
if true, layout algorithm will randomize the layout in the beginning