Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00043 #ifdef _MSC_VER
00044 #pragma once
00045 #endif
00046
00047 #ifndef OGDF_PLAN_REP_UML_H
00048 #define OGDF_PLAN_REP_UML_H
00049
00050
00051
00052 #include <ogdf/planarity/PlanRep.h>
00053 #include <ogdf/basic/UMLGraph.h>
00054
00055 #include <ogdf/planarity/EdgeTypePatterns.h>
00056 #include <ogdf/planarity/NodeTypePatterns.h>
00057
00058
00059
00060 namespace ogdf {
00061
00062 class OGDF_EXPORT Layout;
00063 class OGDF_EXPORT GridLayoutMapped;
00064 class OGDF_EXPORT OrthoRep;
00065
00066
00067
00068
00069
00070
00071
00072
00073 class OGDF_EXPORT PlanRepUML : public PlanRep {
00074 public:
00075
00076
00077 PlanRepUML(const UMLGraph ¨Graph);
00078 PlanRepUML(const GraphAttributes &GA);
00079
00080
00081 ~PlanRepUML() {}
00082
00083 void initCC(int i);
00084
00085
00086
00087 bool faceSplitter(edge e) const{
00088 return m_faceSplitter[e];
00089 }
00090
00091
00092 void removeFaceSplitter(){
00093 edge e;
00094 forall_edges(e,(*this))
00095 if (m_faceSplitter[e])
00096 delEdge(e);
00097 }
00098
00099
00100
00101
00102
00103 void setupIncremental(int indexCC, CombinatorialEmbedding &E);
00104
00105 const SList<node>& incrementalMergers(int indexCC) const {return m_incMergers[indexCC];};
00106
00107
00108
00109
00110
00111
00112
00113
00114 bool alignUpward(adjEntry ae) {return m_alignUpward[ae];}
00115 void alignUpward(adjEntry ae, bool b) {m_alignUpward[ae] = b;}
00116
00117
00118
00119
00120
00121 const UMLGraph &getUMLGraph() const {
00122 return *m_pUmlGraph;
00123 }
00124
00125
00126
00127
00128
00129
00130
00131 node insertGenMerger(node v, const SList<edge> &inGens,
00132 CombinatorialEmbedding &E);
00133
00134
00135 void expand(bool lowDegreeExpand = false);
00136
00137
00138 void expandLowDegreeVertices(OrthoRep &OR, bool alignSmallDegree = false);
00139
00140 void collapseVertices(const OrthoRep &OR, Layout &drawing);
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 virtual edge split(edge e) {
00151
00152 edge eNew = PlanRep::split(e);
00153
00154
00155 if (m_alignUpward[e->adjSource()]) m_alignUpward[eNew->adjSource()] = true;
00156 if (m_alignUpward[e->adjTarget()]) m_alignUpward[eNew->adjTarget()] = true;
00157
00158 return eNew;
00159 }
00160
00161
00162
00163
00164 void writeGML(const char *fileName, const Layout &drawing);
00165 void writeGML(const char *fileName);
00166 void writeGML(const char *fileName, GraphAttributes &AG);
00167
00168
00169
00170 void writeGML(ostream &os, const Layout &drawing);
00171 void writeGML(const char *fileName, const OrthoRep &OR, const Layout &drawing);
00172 void writeGML(ostream &os, const OrthoRep &OR, const Layout &drawing);
00173 void writeGML(const char *fileName, const OrthoRep &OR, const GridLayoutMapped &drawing);
00174 void writeGML(ostream &os, const OrthoRep &OR, const GridLayoutMapped &drawing);
00175
00176
00177 protected:
00178
00179 void prepareIncrementalMergers(int indexCC, CombinatorialEmbedding &E);
00180
00181
00182 protected:
00183
00184
00185
00186 AdjEntryArray<bool> m_alignUpward;
00187
00188 private:
00189 const UMLGraph *m_pUmlGraph;
00190
00191 EdgeArray<bool> m_faceSplitter;
00192
00193 SListPure<edge> m_mergeEdges;
00194 Array< SList<node> > m_incMergers;
00195 };
00196
00197
00198 }
00199
00200 #endif