Add tests for UpdateCrypto
[TortoiseGit.git] / ext / OGDF / ogdf / module / UpwardEdgeInserterModule.h
blobba18065d4cde376dd06d5364ac42947bd87e89cd
1 /*
2 * $Revision: 2583 $
4 * last checkin:
5 * $Author: gutwenger $
6 * $Date: 2012-07-12 01:02:21 +0200 (Do, 12. Jul 2012) $
7 ***************************************************************/
9 /** \file
10 * \brief Declaration of interface for edge insertion algorithms
12 * \author Hoi-Ming Wong
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 ***************************************************************/
43 #ifdef _MSC_VER
44 #pragma once
45 #endif
47 #ifndef OGDF_UPWARD_EDGE_INSERTER_MODULE_H
48 #define OGDF_UPWARD_EDGE_INSERTER_MODULE_H
51 #include <ogdf/upward/UpwardPlanRep.h>
52 #include <ogdf/basic/Module.h>
55 namespace ogdf {
58 class OGDF_EXPORT UpwardEdgeInserterModule : public Module{
59 public:
62 //! Initializes an edge insertion module.
63 UpwardEdgeInserterModule() { }
65 // destruction
66 virtual ~UpwardEdgeInserterModule() { }
68 /**
69 * \brief Inserts all edges in \a origEdges into \a UPR.
71 * @param UPR is the input upward planarized representation of a FUPS and will also receive the result.
72 * @param origEdges is the list of original edges (edges in the original graph
73 * of \a UPR) that have to be inserted.
74 * \return the status of the result.
76 ReturnType call(UpwardPlanRep &UPR, const List<edge> &origEdges) {
77 return doCall(UPR, origEdges, 0, 0);
80 /**
81 * \brief Inserts all edges in \a origEdges with given costs into \a UPR.
83 * @param UPR is the input upward planarized representation of a FUPS and will also receive the result.
84 * @param costOrig points to an edge array containing the costs of original edges; edges in
85 * \a UPR without an original edge have zero costs.
86 * @param origEdges is the list of original edges (edges in the original graph
87 * of \a UPR) that have to be inserted.
88 * \return the status of the result.
90 ReturnType call(UpwardPlanRep &UPR,
91 const EdgeArray<int> &costOrig,
92 const List<edge> &origEdges)
94 return doCall(UPR, origEdges, &costOrig, 0);
98 /**
99 * \brief Inserts all edges in \a origEdges with given forbidden edges into \a UPR.
101 * @param UPR is the input upward planarized representation of a FUPS and will also receive the result.
102 * @param costOrig points to an edge array containing the costs of original edges; edges in
103 * \a UPR without an original edge have zero costs.
104 * @param forbidOriginal points to an edge array indicating if an original edge is
105 * forbidden to be crossed.
106 * @param origEdges is the list of original edges (edges in the original graph
107 * of \a UPR) that have to be inserted.
109 ReturnType call(UpwardPlanRep &UPR,
110 const EdgeArray<int> &costOrig,
111 const EdgeArray<bool> &forbidOriginal,
112 const List<edge> &origEdges)
114 return doCall(UPR, origEdges, &costOrig, &forbidOriginal);
119 * \brief Inserts all edges in \a origEdges with given forbidden edges into \a UPR.
121 * \pre No forbidden edge may be in \a origEdges.
123 * @param UPR is the input upward planarized representation of a FUPS and will also receive the result.
124 * @param forbidOriginal points to an edge array indicating if an original edge is
125 * forbidden to be crossed.
126 * @param origEdges is the list of original edges (edges in the original graph
127 * of \a UPR) that have to be inserted.
128 * \return the status of the result.
130 ReturnType call(UpwardPlanRep &UPR,
131 const EdgeArray<bool> &forbidOriginal,
132 const List<edge> &origEdges)
134 return doCall(UPR, origEdges, 0, &forbidOriginal);
141 protected:
143 * \brief Actual algorithm call that has to be implemented by derived classes.
145 * @param UPR is the input upward planarized representation of a FUPS and will also receive the result.
146 * @param origEdges is the list of original edges (edges in the original graph
147 * of \a UPR) that have to be inserted.
148 * @param costOrig points to an edge array containing the costs of original edges; edges in
149 * \a UPR without an original edge have zero costs.
150 * @param forbiddenEdgeOrig points to an edge array indicating if an original edge is
151 * forbidden to be crossed.
153 virtual ReturnType doCall(UpwardPlanRep &UPR,
154 const List<edge> &origEdges,
155 const EdgeArray<int> *costOrig,
156 const EdgeArray<bool> *forbiddenEdgeOrig
157 ) = 0;
160 OGDF_MALLOC_NEW_DELETE
163 } // end namespace ogdf
165 #endif