Open
Graph Drawing
Framework

 v.2010.10
 

VariableEmbeddingInserter.h

Go to the documentation of this file.
00001 /*
00002  * $Revision: 2027 $
00003  * 
00004  * last checkin:
00005  *   $Author: gutwenger $ 
00006  *   $Date: 2010-09-01 11:55:17 +0200 (Wed, 01 Sep 2010) $ 
00007  ***************************************************************/
00008 
00052 #ifdef _MSC_VER
00053 #pragma once
00054 #endif
00055 
00056 #ifndef OGDF_VARIABLE_EMBEDDING_INSERTER_H
00057 #define OGDF_VARIABLE_EMBEDDING_INSERTER_H
00058 
00059 
00060 #include <ogdf/module/EdgeInsertionModule.h>
00061 #include <ogdf/basic/CombinatorialEmbedding.h>
00062 #include <ogdf/basic/FaceArray.h>
00063 
00064 
00065 namespace ogdf {
00066 
00067 class OGDF_EXPORT PlanarSPQRTree;
00068 class OGDF_EXPORT ExpandedGraph;
00069 class OGDF_EXPORT PlaneGraphCopy;
00070 
00071 
00072 class OGDF_EXPORT BiconnectedComponent;
00073 
00074 
00076 
00086 class OGDF_EXPORT VariableEmbeddingInserter : public EdgeInsertionModule
00087 {
00088 public:
00090     VariableEmbeddingInserter();
00091 
00092     ~VariableEmbeddingInserter() { }
00093 
00099 
00100     void removeReinsert(RemoveReinsertType rrOption) {
00101         m_rrOption = rrOption;
00102     }
00103 
00105     RemoveReinsertType removeReinsert() const {
00106         return m_rrOption;
00107     }
00108 
00109 
00111 
00115     void percentMostCrossed(double percent) {
00116         m_percentMostCrossed = percent;
00117     }
00118 
00120     double percentMostCrossed() const {
00121         return m_percentMostCrossed;
00122     }
00123 
00129 
00130     int runsPostprocessing() const {
00131         return m_runsPostprocessing;
00132     }
00133 
00135 
00136 private:
00138     ReturnType doCall(
00139         PlanRep &PG,                  // planarized representation
00140         const List<edge> &origEdges,     // original edge to be inserted
00141         bool forbidCrossingGens,         // frobid crossings between gen's
00142         const EdgeArray<int> *costOrig,  // pointer to array of cost of
00143                               // original edges; if pointer is0 all costs are 1
00144         const EdgeArray<bool> *forbiddenEdgeOrig, // pointer to array deciding
00145                 // which original edges are forbidden to cross; if pointer is
00146                 // is 0 no edges are explicitly forbidden to cross
00147         const EdgeArray<unsigned int> *edgeSubGraph); // pointer to array of SubGraphInformation
00148     // used in Simultaneous Drawing
00149 
00150     edge crossedEdge(adjEntry adj) const;
00151     int costCrossed(edge eOrig) const;
00152         
00153     bool                   m_forbidCrossingGens;
00154     const EdgeArray<int>  *m_costOrig;
00155     const EdgeArray<bool> *m_forbiddenEdgeOrig;
00156     const EdgeArray<unsigned int>  *m_edgeSubgraph;
00157     Graph::EdgeType        m_typeOfCurrentEdge;
00158 
00159     void insert(node s, node t, SList<adjEntry> &eip);
00160     void blockInsert(const BiconnectedComponent &G,
00161         node s,
00162         node t,
00163         List<adjEntry> &L);
00164 
00165     bool dfsVertex(node v, int parent);
00166     bool dfsComp(int i, node parent, node &repT);
00167 
00168     PlanRep *m_pPG;
00169     node   m_s, m_t;
00170     edge   m_st;
00171     SList<adjEntry> *m_pEip;
00172 
00173     static int m_bigM;  // used for SimDraw
00174 
00175     NodeArray<SList<int> > m_compV;
00176     Array<SList<node> >    m_nodeB;
00177     Array<SList<edge> >    m_edgeB;
00178     NodeArray<node>        m_GtoBC;
00179 
00180     bool pathSearch(node v, edge parent, List<edge> &path);
00181     void buildSubpath(node v,
00182         edge eIn,
00183         edge eOut,
00184         List<adjEntry> &L,
00185         ExpandedGraph &Exp,
00186         node s,
00187         node t);
00188     edge insertEdge(node v, node w, Graph &Exp,
00189         NodeArray<node> &GtoExp, List<node> &nodesG);
00190 
00191     node m_v1, m_v2;
00192 
00193     RemoveReinsertType m_rrOption; 
00194     double m_percentMostCrossed;   
00195 
00196     int m_runsPostprocessing; 
00197 };
00198 
00199 } // end namespace ogdf
00200 
00201 #endif