Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

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 namespace ogdf {
43 
45 
105 {
106  class ThreadMaster;
107  class Worker;
108 
109 protected:
111  virtual ReturnType doCall(
112  PlanRepUML &pr,
113  int cc,
114  const EdgeArray<int> *pCostOrig,
115  int& crossingNumber) override;
116 
117 public:
120 
122  SubgraphPlanarizerUML(const SubgraphPlanarizerUML &planarizer);
123 
125  virtual UMLCrossingMinimizationModule *clone() const override;
126 
128  SubgraphPlanarizerUML &operator=(const SubgraphPlanarizerUML &planarizer);
129 
130 
133  m_subgraph.reset(pSubgraph);
134  }
135 
138  m_inserter.reset(pInserter);
139  }
140 
142  int permutations() { return m_permutations; }
143 
145  void permutations(int p) { m_permutations = p; }
146 
148  bool setTimeout() { return m_setTimeout; }
149 
151  void setTimeout(bool b) { m_setTimeout = b; }
152 
154  unsigned int maxThreads() const { return m_maxThreads; }
155 
157  void maxThreads(unsigned int n) {
158 #ifndef OGDF_MEMORY_POOL_NTS
159  m_maxThreads = n;
160 #endif
161  }
162 
163 private:
164  static void doWorkHelper(ThreadMaster &master, UMLEdgeInsertionModule &inserter, std::minstd_rand &rng);
165 
166  static bool doSinglePermutation(
167  PlanRepLight &prl,
168  int cc,
169  const EdgeArray<int> *pCost,
170  Array<edge> &deletedEdges,
171  UMLEdgeInsertionModule &inserter,
172  std::minstd_rand &rng,
173  int &crossingNumber);
174 
175  std::unique_ptr<PlanarSubgraphModule<int>> m_subgraph;
176  std::unique_ptr<UMLEdgeInsertionModule> m_inserter;
177 
180  unsigned int m_maxThreads;
181 };
182 
183 }
bool setTimeout()
Returns the current setting of options setTimeout.
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:200
#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 std::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.