6 * $Date: 2012-07-07 23:10:08 +0200 (Sa, 07. Jul 2012) $
7 ***************************************************************/
10 * \brief Declaration of class VariableEmbeddingInserter2.
12 * \author Carsten Gutwenger<br>Jan Papenfuß
15 * This file is part of the Open Graph Drawing Framework (OGDF).
19 * See README.txt in the root directory of the OGDF installation for details.
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
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.
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 ***************************************************************/
49 #ifndef OGDF_VARIABLE_EMBEDDING_INSERTER_2_H
50 #define OGDF_VARIABLE_EMBEDDING_INSERTER_2_H
53 #include <ogdf/module/EdgeInsertionModule.h>
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
71 VariableEmbeddingInserter2();
73 virtual ~VariableEmbeddingInserter2() { }
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 {
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
;
112 // performs actual call
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
);
135 BCandSPQRtrees
*m_pBC
;
137 void buildSubpath(node v
,
144 edge
insertEdge(node v
, node w
, Graph
&Exp
,
145 NodeArray
<node
> &GtoExp
, List
<node
> &nodesG
);
149 RemoveReinsertType m_rrOption
;
150 double m_percentMostCrossed
;
153 int m_runsPostprocessing
;
155 }; // class VariableEmbeddingInserter2
158 } // end namespace ogdf