1 /** \file
2 * \brief implements class VariableEmbeddingInserterDynUML
3 *
4 * \author Carsten Gutwenger
5 *
6 * \par License:
7 * This file is part of the Open Graph Drawing Framework (OGDF).
8 *
9 * \par
10 * Copyright (C)<br>
11 * See README.md in the OGDF root directory for details.
12 *
13 * \par
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * Version 2 or 3 as published by the Free Software Foundation;
17 * see the file LICENSE.txt included in the packaging of this file
18 * for details.
19 *
20 * \par
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * \par
27 * You should have received a copy of the GNU General Public
28 * License along with this program; if not, see
29 * http://www.gnu.org/copyleft/gpl.html
30 */
31
32 #include <ogdf/uml/VariableEmbeddingInserterDynUML.h>
33 #include <ogdf/planarity/embedding_inserter/VarEdgeInserterDynCore.h>
34
35 namespace ogdf {
36
37 // constructor
38 // sets default values for options
VariableEmbeddingInserterDynUML()39 VariableEmbeddingInserterDynUML::VariableEmbeddingInserterDynUML()
40 {
41 m_rrOption = RemoveReinsertType::None;
42 m_percentMostCrossed = 25;
43 }
44
45 // copy constructor
VariableEmbeddingInserterDynUML(const VariableEmbeddingInserterDynUML & inserter)46 VariableEmbeddingInserterDynUML::VariableEmbeddingInserterDynUML(const VariableEmbeddingInserterDynUML &inserter)
47 : UMLEdgeInsertionModule(inserter)
48 {
49 m_rrOption = inserter.m_rrOption;
50 m_percentMostCrossed = inserter.m_percentMostCrossed;
51 }
52
53 // clone method
clone() const54 UMLEdgeInsertionModule *VariableEmbeddingInserterDynUML::clone() const
55 {
56 return new VariableEmbeddingInserterDynUML(*this);
57 }
58
59 // assignment operator
operator =(const VariableEmbeddingInserterDynUML & inserter)60 VariableEmbeddingInserterDynUML &VariableEmbeddingInserterDynUML::operator=(const VariableEmbeddingInserterDynUML &inserter)
61 {
62 m_timeLimit = inserter.m_timeLimit;
63 m_rrOption = inserter.m_rrOption;
64 m_percentMostCrossed = inserter.m_percentMostCrossed;
65 return *this;
66 }
67
68 // actual call method
doCall(PlanRepLight & pr,const Array<edge> & origEdges,const EdgeArray<int> * pCostOrig,const EdgeArray<uint32_t> * pEdgeSubgraph)69 Module::ReturnType VariableEmbeddingInserterDynUML::doCall(
70 PlanRepLight &pr,
71 const Array<edge> &origEdges,
72 const EdgeArray<int> *pCostOrig,
73 const EdgeArray<uint32_t> *pEdgeSubgraph)
74 {
75 VarEdgeInserterDynUMLCore core(pr, pCostOrig, pEdgeSubgraph);
76 core.timeLimit(timeLimit());
77
78 return core.call(origEdges, m_rrOption, m_percentMostCrossed);
79 }
80
81 }
82