Open
Graph Drawing
Framework

 v.2012.05
 

FixedEmbeddingInserter.h
Go to the documentation of this file.
00001 /*
00002  * $Revision: 2299 $
00003  * 
00004  * last checkin:
00005  *   $Author: gutwenger $ 
00006  *   $Date: 2012-05-07 15:57:08 +0200 (Mon, 07 May 2012) $ 
00007  ***************************************************************/
00008  
00042 #ifdef _MSC_VER
00043 #pragma once
00044 #endif
00045 
00046 #ifndef OGDF_FIXED_EMBEDDING_INSERTER_H
00047 #define OGDF_FIXED_EMBEDDING_INSERTER_H
00048 
00049 
00050 
00051 #include <ogdf/module/EdgeInsertionModule.h>
00052 #include <ogdf/basic/CombinatorialEmbedding.h>
00053 #include <ogdf/basic/FaceArray.h>
00054 
00055 
00056 template <class E> class FaceArray;
00057 
00058 
00059 namespace ogdf {
00060 
00061 
00062 class OGDF_EXPORT FaceSetSimple;
00063 
00064 
00066 class OGDF_EXPORT FixedEmbeddingInserter : public EdgeInsertionModule
00067 {
00068 public:
00070     FixedEmbeddingInserter();
00071 
00072     ~FixedEmbeddingInserter() { }
00073 
00079 
00080     void removeReinsert(RemoveReinsertType rrOption) {
00081         m_rrOption = rrOption;
00082     }
00083 
00085     RemoveReinsertType removeReinsert() const {
00086         return m_rrOption;
00087     }
00088 
00089 
00091 
00095     void percentMostCrossed(double percent) {
00096         m_percentMostCrossed = percent;
00097     }
00098 
00100     double percentMostCrossed() const {
00101         return m_percentMostCrossed;
00102     }
00103 
00105 
00110     void keepEmbedding(bool keep) {
00111         m_keepEmbedding = keep;
00112     }
00113 
00115     bool keepEmbeding() const {
00116         return m_keepEmbedding;
00117     }
00118     
00124 
00125     int runsPostprocessing() const {
00126         return m_runsPostprocessing;
00127     }
00128 
00130 
00131 private:
00133     ReturnType doCall(
00134         PlanRep &PG,                  // planarized representation
00135         const List<edge> &origEdges,     // original edge to be inserted
00136         bool forbidCrossinGens,          // frobid crossings between gen's
00137         const EdgeArray<int> *costOrig,  // pointer to array of cost of
00138                 // original edges; if pointer is 0 all costs are 1
00139         const EdgeArray<bool> *forbiddenEdgeOrig = 0,
00140         const EdgeArray<unsigned int> *edgeSubGraph = 0); // pointer to array deciding
00141                 // which original edges are forbidden to cross; if pointer is
00142                 // is 0 no edges are explicitly forbidden to cross
00143 
00145 
00149     void constructDualForbidCrossingGens(const PlanRepUML &PG,
00150         const CombinatorialEmbedding &E);
00151 
00153 
00156     void constructDual(const GraphCopy &GC,
00157         const CombinatorialEmbedding &E,
00158         const EdgeArray<bool> *forbiddenEdgeOrig);
00159 
00161 
00165     void findShortestPath(const CombinatorialEmbedding &E,
00166         node s,
00167         node t,
00168         Graph::EdgeType eType,
00169         SList<adjEntry> &crossed);
00170 
00172 
00177     void findShortestPath(
00178         const PlanRep &PG,
00179         const CombinatorialEmbedding &E,
00180         const EdgeArray<int> &costOrig,
00181         node s,
00182         node t,
00183         Graph::EdgeType eType,
00184         SList<adjEntry> &crossed,
00185         const EdgeArray<unsigned int> *edgeSubGraph,
00186         int eSubGraph);
00187 
00188     void insertEdge(PlanRep &PG,
00189         CombinatorialEmbedding &E,
00190         edge eOrig,
00191         const SList<adjEntry> &crossed,
00192         bool forbidCrossingGens,
00193         const EdgeArray<bool> *forbiddenEdgeOrig);
00194 
00195     void removeEdge(
00196         PlanRep &PG,
00197         CombinatorialEmbedding &E,
00198         edge eOrig,
00199         bool forbidCrossingGens,
00200         const EdgeArray<bool> *forbiddenEdgeOrig);
00201 
00202     edge crossedEdge(adjEntry adj) const;
00203     int costCrossed(edge eOrig,
00204         const PlanRep &PG,
00205         const EdgeArray<int> &costOrig,
00206         const EdgeArray<unsigned int> *subgraphs) const;
00207 
00208     Graph m_dual;   
00209 
00210     EdgeArray<adjEntry> m_primalAdj;   
00211     FaceArray<node>     m_nodeOf;      
00212     EdgeArray<bool>     m_primalIsGen; 
00213     FaceSetSimple       *m_delFaces;
00214     FaceSetPure         *m_newFaces;
00215 
00216     node m_vS; 
00217     node m_vT; 
00218 
00219 
00220     RemoveReinsertType m_rrOption; 
00221     double m_percentMostCrossed;   
00222     bool m_keepEmbedding;
00223 
00224     int m_runsPostprocessing; 
00225 };
00226 
00227 } // end namespace ogdf
00228 
00229 #endif