Open
Graph Drawing
Framework

 v.2012.05
 

VariableEmbeddingInserter.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_VARIABLE_EMBEDDING_INSERTER_H
00047 #define OGDF_VARIABLE_EMBEDDING_INSERTER_H
00048 
00049 
00050 #include <ogdf/module/EdgeInsertionModule.h>
00051 #include <ogdf/basic/CombinatorialEmbedding.h>
00052 #include <ogdf/basic/FaceArray.h>
00053 
00054 
00055 namespace ogdf {
00056 
00057 class OGDF_EXPORT PlanarSPQRTree;
00058 class OGDF_EXPORT ExpandedGraph;
00059 class OGDF_EXPORT PlaneGraphCopy;
00060 
00061 
00062 class OGDF_EXPORT BiconnectedComponent;
00063 
00064 
00066 
00076 class OGDF_EXPORT VariableEmbeddingInserter : public EdgeInsertionModule
00077 {
00078 public:
00080     VariableEmbeddingInserter();
00081 
00082     ~VariableEmbeddingInserter() { }
00083 
00092     ReturnType callPostprocessing(PlanRep &PG, const List<edge> &origEdges) {
00093         return doCallPostprocessing(PG, origEdges, false, 0, 0, 0);
00094     }
00095 
00096 
00102 
00103     void removeReinsert(RemoveReinsertType rrOption) {
00104         m_rrOption = rrOption;
00105     }
00106 
00108     RemoveReinsertType removeReinsert() const {
00109         return m_rrOption;
00110     }
00111 
00112 
00114 
00118     void percentMostCrossed(double percent) {
00119         m_percentMostCrossed = percent;
00120     }
00121 
00123     double percentMostCrossed() const {
00124         return m_percentMostCrossed;
00125     }
00126 
00132 
00133     int runsPostprocessing() const {
00134         return m_runsPostprocessing;
00135     }
00136 
00138 
00139 private:
00141     ReturnType doCall(
00142         PlanRep &PG,                  // planarized representation
00143         const List<edge> &origEdges,     // original edge to be inserted
00144         bool forbidCrossingGens,         // frobid crossings between gen's
00145         const EdgeArray<int> *costOrig,  // pointer to array of cost of
00146                               // original edges; if pointer is0 all costs are 1
00147         const EdgeArray<bool> *forbiddenEdgeOrig, // pointer to array deciding
00148                 // which original edges are forbidden to cross; if pointer is
00149                 // is 0 no edges are explicitly forbidden to cross
00150         const EdgeArray<unsigned int> *edgeSubGraph); // pointer to array of SubGraphInformation
00151     // used in Simultaneous Drawing
00152 
00153     ReturnType doCallPostprocessing(
00154         PlanRep &PG,                  // planarized representation
00155         const List<edge> &origEdges,     // original edge to be inserted
00156         bool forbidCrossingGens,         // frobid crossings between gen's
00157         const EdgeArray<int> *costOrig,  // pointer to array of cost of
00158                               // original edges; if pointer is0 all costs are 1
00159         const EdgeArray<bool> *forbiddenEdgeOrig, // pointer to array deciding
00160                 // which original edges are forbidden to cross; if pointer is
00161                 // is 0 no edges are explicitly forbidden to cross
00162         const EdgeArray<unsigned int> *edgeSubGraph); // pointer to array of SubGraphInformation
00163 
00164     edge crossedEdge(adjEntry adj) const;
00165     int costCrossed(edge eOrig) const;
00166         
00167     bool                   m_forbidCrossingGens;
00168     const EdgeArray<int>  *m_costOrig;
00169     const EdgeArray<bool> *m_forbiddenEdgeOrig;
00170     const EdgeArray<unsigned int>  *m_edgeSubgraph;
00171     Graph::EdgeType        m_typeOfCurrentEdge;
00172 
00173     void insert(node s, node t, SList<adjEntry> &eip);
00174     void blockInsert(const BiconnectedComponent &G,
00175         node s,
00176         node t,
00177         List<adjEntry> &L);
00178 
00179     bool dfsVertex(node v, int parent);
00180     bool dfsComp(int i, node parent, node &repT);
00181 
00182     PlanRep *m_pPG;
00183     node   m_s, m_t;
00184     edge   m_st;
00185     SList<adjEntry> *m_pEip;
00186 
00187     static int m_bigM;  // used for SimDraw
00188 
00189     NodeArray<SList<int> > m_compV;
00190     Array<SList<node> >    m_nodeB;
00191     Array<SList<edge> >    m_edgeB;
00192     NodeArray<node>        m_GtoBC;
00193 
00194     bool pathSearch(node v, edge parent, List<edge> &path);
00195     void buildSubpath(node v,
00196         edge eIn,
00197         edge eOut,
00198         List<adjEntry> &L,
00199         ExpandedGraph &Exp,
00200         node s,
00201         node t);
00202     edge insertEdge(node v, node w, Graph &Exp,
00203         NodeArray<node> &GtoExp, List<node> &nodesG);
00204 
00205     node m_v1, m_v2;
00206 
00207     RemoveReinsertType m_rrOption; 
00208     double m_percentMostCrossed;   
00209 
00210     int m_runsPostprocessing; 
00211 };
00212 
00213 } // end namespace ogdf
00214 
00215 #endif