Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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
42namespace ogdf {
43
45
105 class ThreadMaster;
106 class Worker;
107
108protected:
111 int& crossingNumber) override;
112
113public:
116
119
121 virtual UMLCrossingMinimizationModule* clone() const override;
122
125
128
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
154private:
155 static void doWorkHelper(ThreadMaster& master, UMLEdgeInsertionModule& inserter,
156 std::minstd_rand& rng);
157
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}
Contains logging functionality.
Declaration of interface for planar subgraph algorithms.
Declaration of CrossingMinimization Module, an interface for crossing minimization algorithms.
Declaration of interface for edge insertion algorithms.
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:214
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
Centralized global and local logging facility working on streams like std::cout.
Definition Logger.h:100
ReturnType
The return type of a module.
Definition Module.h:50
Light-weight version of a planarized representation, associated with a PlanRep.
Planarized representation (of a connected component) of a UMLGraph; allows special handling of hierar...
Definition PlanRepUML.h:48
Interface for planar subgraph algorithms.
The planarization approach for UML crossing minimization.
void setSubgraph(PlanarSubgraphModule< int > *pSubgraph)
Sets the module option for the computation of the planar subgraph.
SubgraphPlanarizerUML(const SubgraphPlanarizerUML &planarizer)
Creates an instance of subgraph planarizer with the same settings as planarizer.
unsigned int maxThreads() const
Returns the maximal number of used threads.
int m_permutations
The number of permutations.
std::unique_ptr< PlanarSubgraphModule< int > > m_subgraph
The planar subgraph algorithm.
static void doWorkHelper(ThreadMaster &master, UMLEdgeInsertionModule &inserter, std::minstd_rand &rng)
unsigned int m_maxThreads
The maximal number of used threads.
virtual UMLCrossingMinimizationModule * clone() const override
Returns a new instance of subgraph planarizer with the same option settings.
static bool doSinglePermutation(PlanRepLight &prl, int cc, const EdgeArray< int > *pCost, Array< edge > &deletedEdges, UMLEdgeInsertionModule &inserter, std::minstd_rand &rng, int &crossingNumber)
std::unique_ptr< UMLEdgeInsertionModule > m_inserter
The edge insertion module.
bool setTimeout()
Returns the current setting of options setTimeout.
void setInserter(UMLEdgeInsertionModule *pInserter)
Sets the module option for the edge insertion module.
SubgraphPlanarizerUML()
Creates an instance of subgraph planarizer with default settings.
void maxThreads(unsigned int n)
Sets the maximal number of used threads to n.
bool m_setTimeout
The option for setting timeouts in submodules.
void permutations(int p)
Sets the number of permutations to p.
virtual ReturnType doCall(PlanRepUML &pr, int cc, const EdgeArray< int > *pCostOrig, int &crossingNumber) override
Implements the algorithm call.
void setTimeout(bool b)
Sets the option setTimeout to b.
int permutations()
Returns the number of permutations.
SubgraphPlanarizerUML & operator=(const SubgraphPlanarizerUML &planarizer)
Assignment operator. Copies option settings only.
Base class for UML crossing minimization algorithms.
Interface for UML edge insertion algorithms.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.