Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

SubgraphPlanarizerUML.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/basic/Logger.h>
38 
39 #include <memory>
40 #include <random>
41 
42 namespace ogdf {
43 
45 
105  class ThreadMaster;
106  class Worker;
107 
108 protected:
110  virtual ReturnType doCall(PlanRepUML& pr, int cc, const EdgeArray<int>* pCostOrig,
111  int& crossingNumber) override;
112 
113 public:
116 
118  SubgraphPlanarizerUML(const SubgraphPlanarizerUML& planarizer);
119 
121  virtual UMLCrossingMinimizationModule* clone() const override;
122 
124  SubgraphPlanarizerUML& operator=(const SubgraphPlanarizerUML& planarizer);
125 
127  void setSubgraph(PlanarSubgraphModule<int>* pSubgraph) { m_subgraph.reset(pSubgraph); }
128 
130  void setInserter(UMLEdgeInsertionModule* pInserter) { m_inserter.reset(pInserter); }
131 
133  int permutations() { return m_permutations; }
134 
136  void permutations(int p) { m_permutations = p; }
137 
139  bool setTimeout() { return m_setTimeout; }
140 
142  void setTimeout(bool b) { m_setTimeout = b; }
143 
145  unsigned int maxThreads() const { return m_maxThreads; }
146 
148  void maxThreads(unsigned int n) {
149 #ifndef OGDF_MEMORY_POOL_NTS
150  m_maxThreads = n;
151 #endif
152  }
153 
154 private:
155  static void doWorkHelper(ThreadMaster& master, UMLEdgeInsertionModule& inserter,
156  std::minstd_rand& rng);
157 
158  static bool doSinglePermutation(PlanRepLight& prl, int cc, const EdgeArray<int>* pCost,
159  Array<edge>& deletedEdges, UMLEdgeInsertionModule& inserter, std::minstd_rand& rng,
160  int& crossingNumber);
161 
162  std::unique_ptr<PlanarSubgraphModule<int>> m_subgraph;
163  std::unique_ptr<UMLEdgeInsertionModule> m_inserter;
164 
167  unsigned int m_maxThreads;
168 };
169 
170 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::PlanarSubgraphModule< int >
ogdf::SubgraphPlanarizerUML::permutations
void permutations(int p)
Sets the number of permutations to p.
Definition: SubgraphPlanarizerUML.h:136
ogdf::PlanRepUML
Planarized representation (of a connected component) of a UMLGraph; allows special handling of hierar...
Definition: PlanRepUML.h:48
ogdf::SubgraphPlanarizerUML::setSubgraph
void setSubgraph(PlanarSubgraphModule< int > *pSubgraph)
Sets the module option for the computation of the planar subgraph.
Definition: SubgraphPlanarizerUML.h:127
ogdf::SubgraphPlanarizerUML::permutations
int permutations()
Returns the number of permutations.
Definition: SubgraphPlanarizerUML.h:133
ogdf::PlanRepLight
Light-weight version of a planarized representation, associated with a PlanRep.
Definition: PlanRepLight.h:43
ogdf::UMLEdgeInsertionModule
Interface for UML edge insertion algorithms.
Definition: UMLEdgeInsertionModule.h:48
ogdf::SubgraphPlanarizerUML::m_permutations
int m_permutations
The number of permutations.
Definition: SubgraphPlanarizerUML.h:165
ogdf::SubgraphPlanarizerUML::maxThreads
void maxThreads(unsigned int n)
Sets the maximal number of used threads to n.
Definition: SubgraphPlanarizerUML.h:148
ogdf::SubgraphPlanarizerUML::setTimeout
void setTimeout(bool b)
Sets the option setTimeout to b.
Definition: SubgraphPlanarizerUML.h:142
Logger.h
Contains logging functionality.
UMLEdgeInsertionModule.h
Declaration of interface for edge insertion algorithms.
ogdf::UMLCrossingMinimizationModule
Base class for UML crossing minimization algorithms.
Definition: UMLCrossingMinimizationModule.h:41
ogdf::SubgraphPlanarizerUML::m_setTimeout
bool m_setTimeout
The option for setting timeouts in submodules.
Definition: SubgraphPlanarizerUML.h:166
ogdf::SubgraphPlanarizerUML::m_maxThreads
unsigned int m_maxThreads
The maximal number of used threads.
Definition: SubgraphPlanarizerUML.h:167
PlanarSubgraphModule.h
Declaration of interface for planar subgraph algorithms.
ogdf::SubgraphPlanarizerUML::m_inserter
std::unique_ptr< UMLEdgeInsertionModule > m_inserter
The edge insertion module.
Definition: SubgraphPlanarizerUML.h:163
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:214
ogdf::SubgraphPlanarizerUML
The planarization approach for UML crossing minimization.
Definition: SubgraphPlanarizerUML.h:104
ogdf::SubgraphPlanarizerUML::setTimeout
bool setTimeout()
Returns the current setting of options setTimeout.
Definition: SubgraphPlanarizerUML.h:139
UMLCrossingMinimizationModule.h
Declaration of CrossingMinimization Module, an interface for crossing minimization algorithms.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::Logger
Centralized global and local logging facility working on streams like std::cout.
Definition: Logger.h:100
ogdf::Module::ReturnType
ReturnType
The return type of a module.
Definition: Module.h:50
ogdf::SubgraphPlanarizerUML::maxThreads
unsigned int maxThreads() const
Returns the maximal number of used threads.
Definition: SubgraphPlanarizerUML.h:145
ogdf::SubgraphPlanarizerUML::m_subgraph
std::unique_ptr< PlanarSubgraphModule< int > > m_subgraph
The planar subgraph algorithm.
Definition: SubgraphPlanarizerUML.h:162
ogdf::SubgraphPlanarizerUML::setInserter
void setInserter(UMLEdgeInsertionModule *pInserter)
Sets the module option for the edge insertion module.
Definition: SubgraphPlanarizerUML.h:130
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:709