Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

SpringEmbedderGridVariant.h
Go to the documentation of this file.
1 
32 #pragma once
33 
35 #include <ogdf/basic/Array2D.h>
38 
39 namespace ogdf {
40 
42 
82 {
83 public:
85  enum class Scaling {
86  input,
87  userBoundingBox,
88  scaleFunction,
89  useIdealEdgeLength
90  };
91 
92 
95 
96  // destructor
98 
99 
101  virtual void call(GraphAttributes &GA) override;
102 
103 #if 0
104  void call_mt(GraphAttributes &GA);
105 #endif
106 
109  return m_forceModel;
110  }
111 
114  m_forceModel = fm;
115  }
116 
119  return m_forceModelImprove;
120  }
121 
124  m_forceModelImprove = fm;
125  }
126 
128 
133  double avgConvergenceFactor() const {
134  return m_avgConvergenceFactor;
135  }
136 
138  void avgConvergenceFactor(double f) {
139  if(f >= 0)
140  m_avgConvergenceFactor = f;
141  }
142 
144 
149  double maxConvergenceFactor() const {
150  return m_maxConvergenceFactor;
151  }
152 
154  void maxConvergenceFactor(double f) {
155  if(f >= 0)
156  m_maxConvergenceFactor = f;
157  }
158 
160 
164  int iterations() const {
165  return m_iterations;
166  }
167 
169  void iterations(int i) {
170  if (i >= 0)
171  m_iterations = i;
172  }
173 
175  int iterationsImprove() const {
176  return m_iterationsImprove;
177  }
178 
180  void iterationsImprove(int i) {
181  if (i >= 0)
182  m_iterationsImprove = i;
183  }
184 
186  double idealEdgeLength() const {
187  return m_idealEdgeLength;
188  }
189 
190  double coolDownFactor() const {
191  return m_coolDownFactor;
192  }
193 
194  double forceLimitStep() const {
195  return m_forceLimitStep;
196  }
197 
199 
203  void idealEdgeLength(double len) {
204  m_idealEdgeLength = len;
205  }
206 
208  bool noise() const {
209  return m_noise;
210  }
211 
213  void noise(bool on) {
214  m_noise = on;
215  }
216 
218  double minDistCC() const { return m_minDistCC; }
219 
221  void minDistCC(double x) { m_minDistCC = x; }
222 
224  double pageRatio() { return m_pageRatio; }
225 
227  void pageRatio(double x) { m_pageRatio = x; }
228 
230  Scaling scaling() const {
231  return m_scaling;
232  }
233 
235  void scaling(Scaling sc) {
236  m_scaling = sc;
237  }
238 
240  double scaleFunctionFactor() const {
241  return m_scaleFactor;
242  }
243 
245  void scaleFunctionFactor(double f) {
246  m_scaleFactor = f;
247  }
248 
250  void userBoundingBox(double xmin, double ymin, double xmax, double ymax) {
251  m_bbXmin = xmin;
252  m_bbYmin = ymin;
253  m_bbXmax = xmax;
254  m_bbYmax = ymax;
255  }
256 
258  unsigned int maxThreads() const { return m_maxThreads; }
259 
261  void maxThreads(unsigned int n) { m_maxThreads = n; }
262 
263 private:
264  struct NodeInfo
265  {
267 
270 
271  int m_gridX;
272  int m_gridY;
273 
275  };
276 
277 
278  class ForceModelBase;
279  class ForceModelFR;
280  class ForceModelFRModAttr;
281  class ForceModelFRModRep;
282  class ForceModelEades;
283  class ForceModelHachul;
284  class ForceModelGronemann;
285 
286  class Master;
287  class Worker;
288 
289  int m_iterations;
294 
295  double m_xleft;
296  double m_xright;
297  double m_ysmall;
298  double m_ybig;
299 
302  bool m_noise;
303 
305  double m_scaleFactor;
306 
307  double m_bbXmin;
308  double m_bbYmin;
309  double m_bbXmax;
310  double m_bbYmax;
311 
312  double m_minDistCC;
313  double m_pageRatio;
314 
317 
318  unsigned int m_maxThreads;
319 };
320 
321 
322 } // end namespace ogdf
double m_bbXmax
User bounding box (minimal y-coordinate).
double m_bbYmin
User bounding box (maximal x-coordinate).
SpringForceModel forceModel() const
Returns the currently used force model.
double pageRatio()
Returns the page ratio.
Scaling m_scaling
The scaling method.
unsigned int maxThreads() const
Returns the maximal number of used threads.
double m_avgConvergenceFactor
convergence if avg.
void scaling(Scaling sc)
Sets the method for scaling the inital layout to sc.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
double m_xright
Bounding box (maximal x-coordinate).
double minDistCC() const
Returns the minimum distance between connected components.
SpringForceModel m_forceModelImprove
The used force model.
double avgConvergenceFactor() const
Returns the currently used average convergence factor.
void idealEdgeLength(double len)
Sets the ideal edge length to len.
void pageRatio(double x)
Sets the page ration to x.
double m_bbYmax
User bounding box (maximal y-coordinate).
int m_iterations
The number of iterations.
SpringForceModel forceModelImprove() const
Returns the currently used force model for the improvement step.
void forceModel(SpringForceModel fm)
Sets the used force model to fm.
double idealEdgeLength() const
Returns the current setting of ideal edge length.
The spring-embedder layout algorithm with force approximation using hte grid variant approach...
void iterationsImprove(int i)
Sets the number of iterations for the improvement phase to i.
void avgConvergenceFactor(double f)
Sets the average convergence factor to f.
Real points.
Definition: geometry.h:219
int iterations() const
Returns the current setting of iterations.
double m_ybig
Bounding box (maximal y-coordinate).
bool noise() const
Returns the current setting of noise.
Declaration of class GraphCopy Attributes which manages access on a copy of an attributed graph...
bool m_noise
The used force model for the improvement phase.
Scaling scaling() const
Returns the current scaling method.
double m_ysmall
Bounding box (minimal y-coordinate).
double m_idealEdgeLength
The ideal edge length.
Stores additional attributes of a graph (like layout information).
void maxThreads(unsigned int n)
Sets the maximal number of used threads to n.
void iterations(int i)
Sets the number of iterations to i.
double m_bbXmin
User bounding box (minimal x-coordinate).
void userBoundingBox(double xmin, double ymin, double xmax, double ymax)
Sets the user bounding box (used if scaling method is scUserBoundingBox).
Declaration of interface for layout algorithms (class LayoutModule)
Encapsulates a pointer to a list element.
Definition: List.h:41
Interface of general layout algorithms.
Definition: LayoutModule.h:44
void maxConvergenceFactor(double f)
Sets the maximum convergence factor to f.
Scaling
The scaling method used by the algorithm.
double m_xleft
Bounding box (minimal x-coordinate).
SpringForceModel
The force model used for computing forces on nodes.
double m_maxConvergenceFactor
convergence if max.
int m_iterationsImprove
The number of iterations for the improvement phase.
double m_scaleFactor
The factor used if scaling type is scScaleFunction.
double scaleFunctionFactor() const
Returns the current scale function factor.
double maxConvergenceFactor() const
Returns the currently used maximum convergence factor.
void scaleFunctionFactor(double f)
Sets the scale function factor to f.
The namespace for all OGDF objects.
void minDistCC(double x)
Sets the minimum distance between connected components to x.
int iterationsImprove() const
Returns the current setting of iterations for the improvement phase.
void noise(bool on)
Sets the parameter noise to on.
Declaration of SpringForceModel enumeration.
void forceModelImprove(SpringForceModel fm)
Sets the used force model for the improvement step to fm.
unsigned int m_maxThreads
The maximal number of used threads.
double m_minDistCC
The minimal distance between connected components.
Declaration and implementation of class Array2D which implements dynamic two dimensional arrays...