Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00048 #ifdef _MSC_VER
00049 #pragma once
00050 #endif
00051
00052
00053 #ifndef OGDF_PLAN_REP_INC_H
00054 #define OGDF_PLAN_REP_INC_H
00055
00056
00057
00058 #include <ogdf/planarity/PlanRep.h>
00059 #include <ogdf/planarity/PlanRepUML.h>
00060 #include <ogdf/basic/UMLGraph.h>
00061 #include <ogdf/basic/GraphAttributes.h>
00062 #include <ogdf/basic/GraphObserver.h>
00063 #include <ogdf/basic/Array2D.h>
00064
00065
00066 namespace ogdf {
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 class OGDF_EXPORT PlanRepInc : public PlanRepUML, public GraphObserver
00080 {
00081 public:
00082
00083
00084 PlanRepInc(const UMLGraph& UG);
00085
00086
00087 PlanRepInc(const UMLGraph& UG, const NodeArray<bool> &fixed);
00088
00089
00090 void initActiveCC(int i);
00091
00092
00093 node initMinActiveCC(int i);
00094
00095
00096
00097 virtual void nodeDeleted(node v);
00098 virtual void nodeAdded(node v);
00099 virtual void edgeDeleted(edge e);
00100 virtual void edgeAdded(edge e);
00101 virtual void reInit();
00102 virtual void cleared();
00103
00104
00105
00106 void activateNode(node v);
00107
00108
00109 void activateEdge(edge e);
00110
00111
00112
00113
00114
00115
00116 bool makeTreeConnected(adjEntry adjExternal);
00117
00118 void deleteTreeConnection(int i, int j);
00119 void deleteTreeConnection(int i, int j, CombinatorialEmbedding &E);
00120
00121
00122 void getExtAdjs(List<adjEntry> &extAdjs);
00123 adjEntry getExtAdj(GraphCopy &GC, CombinatorialEmbedding &E);
00124
00125
00126 int& componentNumber(node v) {return m_component[v];}
00127
00128 bool& treeEdge(edge e) {return m_treeEdge[e];}
00129
00130 const edge treeEdge(int i, int j) const
00131 {
00132 if (m_treeInit) return m_eTreeArray(i, j);
00133 else return 0;
00134 }
00135 bool treeInit() {return m_treeInit;}
00136
00137
00138
00139
00140
00141
00142
00143 virtual edge split(edge e) {
00144
00145 edge eNew = PlanRepUML::split(e);
00146 if (m_treeEdge[e]) m_treeEdge[eNew] = true;
00147
00148 return eNew;
00149
00150 }
00151
00152
00153 #ifdef OGDF_DEBUG
00154 void writeGML(const char *fileName)
00155 {
00156 const GraphAttributes &AG = getUMLGraph();
00157 ofstream os(fileName);
00158 PlanRepInc::writeGML(os, AG);
00159 }
00160 void writeGML(const char *fileName, const Layout &drawing)
00161 {
00162 ofstream os(fileName);
00163 writeGML(os, drawing);
00164 }
00165
00166 void writeGML(ostream &os, const GraphAttributes &AG);
00167 void writeGML(ostream &os, const Layout &drawing, bool colorEmbed = true);
00168 void writeGML(const char *fileName, GraphAttributes &AG, bool colorEmbed = true);
00169
00170
00171 int genusLayout(Layout &drawing) const;
00172 #endif
00173
00174 protected:
00175 void initMembers(const UMLGraph &UG);
00176
00177 node initActiveCCGen(int i, bool minNode);
00178
00179 private:
00180 NodeArray<bool> m_activeNodes;
00181 EdgeArray<bool> m_treeEdge;
00182 NodeArray<int> m_component;
00183
00184 Array2D<edge> m_eTreeArray;
00185 bool m_treeInit;
00186 };
00187
00188
00189 }
00190
00191 #endif