Don't import ogdf namespace
[TortoiseGit.git] / ext / OGDF / ogdf / planarity / VariableEmbeddingInserter2.h
blob20e2609b3e944e774475334a1fdd20590e5544c0
1 /*
2 * $Revision: 2566 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-07 23:10:08 +0200 (Sa, 07. Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Declaration of class VariableEmbeddingInserter2.
12 * \author Carsten Gutwenger<br>Jan Papenfu&szlig;
14 * \par License:
15 * This file is part of the Open Graph Drawing Framework (OGDF).
17 * \par
18 * Copyright (C)<br>
19 * See README.txt in the root directory of the OGDF installation for details.
21 * \par
22 * This program is free software; you can redistribute it and/or
23 * modify it under the terms of the GNU General Public License
24 * Version 2 or 3 as published by the Free Software Foundation;
25 * see the file LICENSE.txt included in the packaging of this file
26 * for details.
28 * \par
29 * This program is distributed in the hope that it will be useful,
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 * GNU General Public License for more details.
34 * \par
35 * You should have received a copy of the GNU General Public
36 * License along with this program; if not, write to the Free
37 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
38 * Boston, MA 02110-1301, USA.
40 * \see http://www.gnu.org/copyleft/gpl.html
41 ***************************************************************/
44 #ifdef _MSC_VER
45 #pragma once
46 #endif
49 #ifndef OGDF_VARIABLE_EMBEDDING_INSERTER_2_H
50 #define OGDF_VARIABLE_EMBEDDING_INSERTER_2_H
53 #include <ogdf/module/EdgeInsertionModule.h>
56 namespace ogdf {
58 class OGDF_EXPORT BCandSPQRtrees;
59 class OGDF_EXPORT ExpandedGraph2;
62 //---------------------------------------------------------
63 // VariableEmbeddingInserter2
64 // edge insertion module that inserts each edge optimally
65 // into a given embedding.
66 //---------------------------------------------------------
67 class OGDF_EXPORT VariableEmbeddingInserter2 : public EdgeInsertionModule
69 public:
70 // construction
71 VariableEmbeddingInserter2();
72 // destruction
73 virtual ~VariableEmbeddingInserter2() { }
76 // options
79 // sets remove-reinsert option (postprocessing)
80 // possible values: (see EdgeInsertionModule)
81 // rrNone, rrInserted, rrMostCrossed, rrAll
82 void removeReinsert(RemoveReinsertType rrOption) {
83 m_rrOption = rrOption;
86 // returns remove-reinsert option
87 RemoveReinsertType removeReinsert() const {
88 return m_rrOption;
92 // sets the portion of most crossed edges used if remove-reinsert option
93 // is set to rrMostCrossed
94 // this portion no. of edges * percentMostCrossed() / 100
95 void percentMostCrossed(double percent) {
96 m_percentMostCrossed = percent;
99 // returns option percentMostCrossed
100 double percentMostCrossed() const {
101 return m_percentMostCrossed;
105 // returns the number of runs performed by the postprocessing
106 // after algoithm has been called
107 int runsPostprocessing() const {
108 return m_runsPostprocessing;
111 private:
112 // performs actual call
113 ReturnType doCall(
114 PlanRep &PG, // planarized representation
115 const List<edge> &origEdges, // original edge to be inserted
116 bool forbidCrossingGens, // frobid crossings between gen's
117 const EdgeArray<int> *costOrig, // pointer to array of cost of original edges; if pointer is 0 all costs are 1
118 const EdgeArray<bool> *forbiddenEdgeOrig); // pointer to array deciding
119 // which original edges are forbidden to cross; if pointer
120 // is 0 no edges are explicitly forbidden to cross
122 edge crossedEdge(adjEntry adj) const;
123 int costCrossed(edge eOrig) const;
125 bool m_forbidCrossingGens;
126 const EdgeArray<int> *m_costOrig;
127 const EdgeArray<bool> *m_forbiddenEdgeOrig;
128 Graph::EdgeType m_typeOfCurrentEdge;
130 void insert(edge eOrig, SList<adjEntry> &eip);
131 void blockInsert(node s, node t, List<adjEntry> &L);
133 PlanRep *m_pPG;
135 BCandSPQRtrees *m_pBC;
137 void buildSubpath(node v,
138 node vPred,
139 node vSucc,
140 List<adjEntry> &L,
141 ExpandedGraph2 &Exp,
142 node s,
143 node t);
144 edge insertEdge(node v, node w, Graph &Exp,
145 NodeArray<node> &GtoExp, List<node> &nodesG);
148 // options
149 RemoveReinsertType m_rrOption;
150 double m_percentMostCrossed;
152 // results
153 int m_runsPostprocessing;
155 }; // class VariableEmbeddingInserter2
158 } // end namespace ogdf
161 #endif