Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00054 #ifdef _MSC_VER
00055 #pragma once
00056 #endif
00057
00058 #ifndef OGDF_CCONNECT_CLUSTER_PLANAR_EMBED_H
00059 #define OGDF_CCONNECT_CLUSTER_PLANAR_EMBED_H
00060
00061
00062 #include <ogdf/internal/planarity/EmbedPQTree.h>
00063 #include <ogdf/cluster/ClusterArray.h>
00064 #include <ogdf/basic/Stack.h>
00065 #include <ogdf/internal/cluster/ClusterPQContainer.h>
00066
00067 namespace ogdf {
00068
00069 class OGDF_EXPORT CconnectClusterPlanarEmbed {
00070
00071
00072 public:
00073
00074
00075 enum ccErrorCode {none = 0,
00076 nonConnected = 1,
00077 nonCConnected = 2,
00078 nonPlanar = 3,
00079 nonCPlanar = 4
00080 };
00081 ccErrorCode errCode() {return m_errorCode;}
00082
00083
00084
00085
00086 CconnectClusterPlanarEmbed();
00087
00088
00089 virtual ~CconnectClusterPlanarEmbed();
00090
00091
00092 virtual bool embed(ClusterGraph &C,Graph &G);
00093
00094
00095
00096 virtual bool embed(ClusterGraph &C,Graph &G, char (&code)[124]);
00097
00098
00099 private:
00100
00101 bool planarityTest(ClusterGraph &C,
00102 cluster &act,
00103 Graph &G);
00104
00105 bool preProcess(ClusterGraph &Ccopy,Graph &Gcopy);
00106
00107 bool preparation(Graph &subGraph,cluster &origCluster,node superSink);
00108
00109 bool doEmbed(Graph *biconComp,
00110 NodeArray<int> &numbering,
00111 cluster &origCluster,
00112 node superSink,
00113 Graph &subGraph,
00114 EdgeArray<edge> &tableEdgesBiComp2SubGraph,
00115 EdgeArray<edge> &tableEdgesSubGraph2BiComp,
00116 NodeArray<node> &tableNodesBiComp2SubGraph);
00117
00118
00119
00120
00121 void entireEmbed(Graph &biconComp,
00122 NodeArray<SListPure<adjEntry> > &entireEmbedding,
00123 NodeArray<SListIterator<adjEntry> > &adjMarker,
00124 NodeArray<bool> &mark,
00125 node v);
00126
00127 void recursiveEmbed(ClusterGraph &Ccopy,Graph &Gcopy);
00128
00129 void prepareParallelEdges(Graph &G);
00130
00131
00132 void constructWheelGraph(ClusterGraph &C,
00133 Graph &G,
00134 cluster &parent,
00135 cluster &origCl,
00136 EmbedPQTree* T,
00137 EdgeArray<node> &outgoingTable,
00138 node superSink);
00139
00140 void hubControl(Graph &G,NodeArray<bool> &hubs);
00141
00142 void nonPlanarCleanup(ClusterGraph &Ccopy,Graph &Gcopy);
00143
00144 void copyEmbedding(ClusterGraph &Ccopy,Graph &Gcopy,ClusterGraph &C,Graph &G);
00145
00146
00147
00148
00149
00150
00151
00152
00153 ClusterArray<EmbedPQTree*> m_clusterPQTree;
00154
00155
00156 ccErrorCode m_errorCode;
00157
00158
00159 char errorCode[124];
00160
00161
00162
00163 EdgeArray<ListPure<edge> > m_parallelEdges;
00164 EdgeArray<bool> m_isParallel;
00165 int m_parallelCount;
00166
00167
00168
00169
00170
00171
00172
00173 ClusterGraph *m_instance;
00174
00175
00176
00177
00178
00179
00180
00181 ClusterArray<NodeArray<SListPure<adjEntry> >*> m_clusterEmbedding;
00182
00183
00184
00185
00186 ClusterArray<Graph*> m_clusterSubgraph;
00187
00188
00189
00190
00191
00192 ClusterArray<NodeArray<bool> *> m_clusterSubgraphHubs;
00193
00194
00195
00196
00197
00198
00199
00200 ClusterArray<NodeArray<cluster> *> m_clusterSubgraphWheelGraph;
00201
00202
00203
00204
00205 ClusterArray<NodeArray<node> *> m_clusterNodeTableNew2Orig;
00206
00207
00208 ClusterArray<ClusterGraph*> m_clusterClusterGraph;
00209 ClusterArray<ClusterArray<cluster>*>m_clusterClusterTableOrig2New;
00210
00211
00212
00213
00214 NodeArray<cluster> m_wheelGraphNodes;
00215
00216
00217
00218
00219 NodeArray<bool> m_currentHubs;
00220
00221
00222
00223
00224
00225 ClusterArray<cluster> m_clusterTableCopy2Orig;
00226
00227
00228 ClusterArray<cluster> m_clusterTableOrig2Copy;
00229
00230
00231 ClusterArray<node> m_clusterSuperSink;
00232
00233
00234
00235
00236
00237
00238 NodeArray<node> m_nodeTableCopy2Orig;
00239
00240
00241 NodeArray<node> m_nodeTableOrig2Copy;
00242
00243
00244 EdgeArray<Stack<edge>*> m_outgoingEdgesAnker;
00245 ClusterArray<EdgeArray<Stack<edge>*>*> m_clusterOutgoingEdgesAnker;
00246
00247
00248
00249 ClusterArray<ClusterPQContainer> m_clusterPQContainer;
00250
00251
00252
00253
00254 Stack<cluster> m_callStack;
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264 ClusterArray<bool> m_unsatisfiedCluster;
00265
00266
00267 };
00268
00269 }
00270
00271
00272 #endif