Open
Graph Drawing
Framework

 v.2012.07
 

EdgeInsertionModule.h
Go to the documentation of this file.
1 /*
2  * $Revision: 2615 $
3  *
4  * last checkin:
5  * $Author: gutwenger $
6  * $Date: 2012-07-16 14:23:36 +0200 (Mo, 16. Jul 2012) $
7  ***************************************************************/
8 
43 #ifdef _MSC_VER
44 #pragma once
45 #endif
46 
47 #ifndef OGDF_EDGE_INSERTION_MODULE_H
48 #define OGDF_EDGE_INSERTION_MODULE_H
49 
50 
52 #include <ogdf/basic/Logger.h>
53 #include <ogdf/basic/Module.h>
54 #include <ogdf/basic/Timeouter.h>
55 
56 
57 namespace ogdf {
58 
65 public:
73  rrIncInserted
74  };
75 
78  // destruction
79  virtual ~EdgeInsertionModule() { }
80 
89  ReturnType call(PlanRep &PG, const List<edge> &origEdges) {
90  return doCall(PG, origEdges, false, 0, 0, 0);
91  }
92 
103  ReturnType call(PlanRep &PG,
104  const EdgeArray<int> &costOrig,
105  const List<edge> &origEdges)
106  {
107  return doCall(PG, origEdges, false, &costOrig, 0, 0);
108  }
109 
121  ReturnType call(PlanRep &PG,
122  const EdgeArray<int> &costOrig,
123  const List<edge> &origEdges,
124  const EdgeArray<unsigned int> &edgeSubGraph)
125  {
126  return doCall(PG, origEdges, false, &costOrig, 0, &edgeSubGraph);
127  }
128 
141  ReturnType call(PlanRep &PG,
142  const EdgeArray<bool> &forbidOriginal,
143  const List<edge> &origEdges)
144  {
145  return doCall(PG, origEdges, false, 0, &forbidOriginal, 0);
146  }
147 
162  ReturnType call(PlanRep &PG,
163  const EdgeArray<int> &costOrig,
164  const EdgeArray<bool> &forbidOriginal,
165  const List<edge> &origEdges)
166  {
167  return doCall(PG, origEdges, false, &costOrig, &forbidOriginal, 0);
168  }
169 
170  // inserts all edges in origEdges into PG using edge costs given by costOrig and edgeSubGraph;
171  // explicitly forbids crossing of those original edges for which
172  // forbidOriginal[eG] == true; no such edge may be in the list origEdges!
173  ReturnType call(PlanRep &PG,
174  const EdgeArray<int> &costOrig,
175  const EdgeArray<bool> &forbidOriginal,
176  const List<edge> &origEdges,
177  const EdgeArray<unsigned int> &edgeSubGraph)
178  {
179  return doCall(PG, origEdges, false, &costOrig, &forbidOriginal, &edgeSubGraph);
180  }
181 
191  ReturnType callForbidCrossingGens(PlanRepUML &PG,
192  const List<edge> &origEdges)
193  {
194  return doCall(PG, origEdges, true, 0, 0, 0);
195  }
196 
208  ReturnType callForbidCrossingGens(PlanRepUML &PG,
209  const EdgeArray<int> &costOrig,
210  const List<edge> &origEdges)
211  {
212  return doCall(PG, origEdges, true, &costOrig, 0, 0);
213  }
214 
216  virtual int runsPostprocessing() const {
217  return 0;
218  }
219 
220 
221 #ifdef OGDF_DEBUG
222  bool checkCrossingGens(const PlanRepUML &PG);
223 #endif
224 
225 protected:
240  virtual ReturnType doCall(PlanRep &PG,
241  const List<edge> &origEdges,
242  bool forbidCrossingGens,
243  const EdgeArray<int> *costOrig,
244  const EdgeArray<bool> *forbiddenEdgeOrig,
245  const EdgeArray<unsigned int> *edgeSubGraph) = 0;
246 
247 
249 };
250 
251 } // end namespace ogdf
252 
253 #endif