Open
Graph Drawing
Framework

 v. snapshot-2017-02-16
 

SubgraphPlanarizerUML.h
Go to the documentation of this file.
1 
32 #pragma once
33 
37 #include <memory>
38 #include <ogdf/basic/Logger.h>
39 
40 #include <random>
41 
42 
43 namespace ogdf
44 {
45 
47 
107 {
108  class ThreadMaster;
109  class Worker;
110 
111 protected:
113  virtual ReturnType doCall(
114  PlanRepUML &pr,
115  int cc,
116  const EdgeArray<int> *pCostOrig,
117  int& crossingNumber) override;
118 
119 public:
122 
124  SubgraphPlanarizerUML(const SubgraphPlanarizerUML &planarizer);
125 
127  virtual UMLCrossingMinimizationModule *clone() const override;
128 
130  SubgraphPlanarizerUML &operator=(const SubgraphPlanarizerUML &planarizer);
131 
132 
135  m_subgraph.reset(pSubgraph);
136  }
137 
140  m_inserter.reset(pInserter);
141  }
142 
144  int permutations() { return m_permutations; }
145 
147  void permutations(int p) { m_permutations = p; }
148 
150  bool setTimeout() { return m_setTimeout; }
151 
153  void setTimeout(bool b) { m_setTimeout = b; }
154 
156  unsigned int maxThreads() const { return m_maxThreads; }
157 
159  void maxThreads(unsigned int n) {
160 #ifndef OGDF_MEMORY_POOL_NTS
161  m_maxThreads = n;
162 #endif
163  }
164 
165 private:
166  static void doWorkHelper(ThreadMaster &master, UMLEdgeInsertionModule &inserter, std::minstd_rand &rng);
167 
168  static bool doSinglePermutation(
169  PlanRepLight &prl,
170  int cc,
171  const EdgeArray<int> *pCost,
172  Array<edge> &deletedEdges,
173  UMLEdgeInsertionModule &inserter,
174  std::minstd_rand &rng,
175  int &crossingNumber);
176 
177  std::unique_ptr<PlanarSubgraphModule<int>> m_subgraph;
178  std::unique_ptr<UMLEdgeInsertionModule> m_inserter;
179 
182  unsigned int m_maxThreads;
183 };
184 
185 }
bool setTimeout()
Returns the current setting of options setTimeout.
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:56
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
std::unique_ptr< PlanarSubgraphModule< int > > m_subgraph
The planar subgraph algorithm.
void permutations(int p)
Sets the number of permutations to p.
The planarization approach for UML crossing minimization.
void setTimeout(bool b)
Sets the option setTimeout to b.
void maxThreads(unsigned int n)
Sets the maximal number of used threads to n.
void setSubgraph(PlanarSubgraphModule< int > *pSubgraph)
Sets the module option for the computation of the planar subgraph.
Declaration of interface for edge insertion algorithms.
ReturnType
The return type of a module.
Definition: Module.h:51
Light-weight version of a planarized representation, associated with a PlanRep.
Definition: PlanRepLight.h:44
unsigned int maxThreads() const
Returns the maximal number of used threads.
Contains logging functionality.
unsigned int m_maxThreads
The maximal number of used threads.
Planarized representation (of a connected component) of a UMLGraph; allows special handling of hierar...
Definition: PlanRepUML.h:49
Declaration of CrossingMinimization Module, an interface for crossing minimization algorithms...
Base class for UML crossing minimization algorithms.
int m_permutations
The number of permutations.
std::unique_ptr< UMLEdgeInsertionModule > m_inserter
The edge insertion module.
Centralized global and local logging facility working on streams like cout.
Definition: Logger.h:99
bool m_setTimeout
The option for setting timeouts in submodules.
int permutations()
Returns the number of permutations.
Interface for UML edge insertion algorithms.
The namespace for all OGDF objects.
Declaration of interface for planar subgraph algorithms.
void setInserter(UMLEdgeInsertionModule *pInserter)
Sets the module option for the edge insertion module.