Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
PlanRepUML.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Layout.h>
39#include <ogdf/uml/UMLGraph.h>
40
41namespace ogdf {
42
43class GridLayoutMapped;
44
49public:
52 explicit PlanRepUML(const UMLGraph& umlGraph);
53 explicit PlanRepUML(const GraphAttributes& GA);
54
56
59
60 void initCC(int i);
61
64 bool faceSplitter(edge e) const { return m_faceSplitter[e]; }
65
68 for (edge e : edges) {
69 if (m_faceSplitter[e]) {
70 delEdge(e);
71 }
72 }
73 }
74
77
80
82 const SList<node>& incrementalMergers(int indexCC) const { return m_incMergers[indexCC]; }
83
87
88 //the edges that are embedded next to outgoing generalizations if alignment set
89 //attention: this information is NOT updated during graph changes and only
90 //to be used during the embedding phase
91 bool alignUpward(adjEntry ae) { return m_alignUpward[ae]; }
92
93 void alignUpward(adjEntry ae, bool b) { m_alignUpward[ae] = b; }
94
96
97 const UMLGraph& getUMLGraph() const { return *m_pUmlGraph; }
98
101
105
107 void expand(bool lowDegreeExpand = false) override;
108
111
113
117
119 virtual edge split(edge e) override {
120 edge eNew = PlanRep::split(e);
121
122 //check this
123 if (m_alignUpward[e->adjSource()]) {
124 m_alignUpward[eNew->adjSource()] = true;
125 }
126 if (m_alignUpward[e->adjTarget()]) {
127 m_alignUpward[eNew->adjTarget()] = true;
128 }
129
130 return eNew;
131 }
132
135 void writeGML(const char* fileName, const Layout& drawing);
136 void writeGML(const char* fileName);
137 void writeGML(const char* fileName, GraphAttributes& AG);
139
142 void writeGML(std::ostream& os, const Layout& drawing);
143 void writeGML(const char* fileName, const OrthoRep& OR, const Layout& drawing);
144 void writeGML(std::ostream& os, const OrthoRep& OR, const Layout& drawing);
145 void writeGML(const char* fileName, const OrthoRep& OR, const GridLayoutMapped& drawing);
146 void writeGML(std::ostream& os, const OrthoRep& OR, const GridLayoutMapped& drawing);
148
150
151protected:
152 //insert mergers of generalizations in copy
154
155protected:
156 //still some AdjEntry type: used by alignment procedures
157 //attention: this information is NOT updated during graph changes and only
158 //to be used during the embedding phase
160
161private:
163
165
168};
169
170}
Edge types and patterns for planar representations.
Declaration of class Layout.
Declaration of node types and patterns for planar representations.
Declaration of orthogonal representation of planar graphs.
Declaration of a base class for planar representations of graphs and cluster graphs.
Declaration of class UMLGraph.
Class for adjacency list elements.
Definition Graph_d.h:79
Dynamic arrays indexed with adjacency entries.
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:214
Combinatorial embeddings of planar graphs with modification functionality.
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
Class for the representation of edges.
Definition Graph_d.h:300
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Definition Graph_d.h:344
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Definition Graph_d.h:347
Stores additional attributes of a graph (like layout information).
Extends GridLayout by a grid mapping mechanism.
Stores a layout of a graph (coordinates of nodes, bend points of edges).
Definition Layout.h:46
Class for the representation of nodes.
Definition Graph_d.h:177
Orthogonal representation of an embedded graph.
Definition OrthoRep.h:219
Planarized representations (of a connected component) of a graph.
Definition PlanRep.h:57
Planarized representation (of a connected component) of a UMLGraph; allows special handling of hierar...
Definition PlanRepUML.h:48
void writeGML(const char *fileName, const Layout &drawing)
Writes attributed graph in GML format to file fileName (for debugging only)
void removeFaceSplitter()
Removes all face splitting edges.
Definition PlanRepUML.h:67
void writeGML(std::ostream &os, const OrthoRep &OR, const Layout &drawing)
void alignUpward(adjEntry ae, bool b)
Definition PlanRepUML.h:93
~PlanRepUML()
Deconstruction.
Definition PlanRepUML.h:58
void writeGML(const char *fileName, const OrthoRep &OR, const GridLayoutMapped &drawing)
void setupIncremental(int indexCC, CombinatorialEmbedding &E)
Initializes incremental stuff, e.g. insert incremental mergers.
void writeGML(std::ostream &os, const OrthoRep &OR, const GridLayoutMapped &drawing)
void writeGML(const char *fileName)
const UMLGraph * m_pUmlGraph
Definition PlanRepUML.h:162
EdgeArray< bool > m_faceSplitter
Definition PlanRepUML.h:164
void collapseVertices(const OrthoRep &OR, Layout &drawing)
PlanRepUML(const GraphAttributes &GA)
virtual edge split(edge e) override
Splits edge e.
Definition PlanRepUML.h:119
const UMLGraph & getUMLGraph() const
Definition PlanRepUML.h:97
void writeGML(std::ostream &os, const Layout &drawing)
Writes attributed graph in GML format to output stream os (for debugging only)
SListPure< edge > m_mergeEdges
Definition PlanRepUML.h:166
AdjEntryArray< bool > m_alignUpward
Definition PlanRepUML.h:159
void initCC(int i)
bool faceSplitter(edge e) const
Returns true if an edge splits a face into two subfaces to guarantee generalizations to be on opposit...
Definition PlanRepUML.h:64
void prepareIncrementalMergers(int indexCC, CombinatorialEmbedding &E)
node insertGenMerger(node v, const SList< edge > &inGens, CombinatorialEmbedding &E)
Inserts a generalization merge node for all incoming generalizations of v and returns its conserving ...
void writeGML(const char *fileName, GraphAttributes &AG)
void expandLowDegreeVertices(OrthoRep &OR, bool alignSmallDegree=false)
Expands nodes with degree <= 4 and aligns opposite edges at degree 2 nodes.
Array< SList< node > > m_incMergers
Stores all incremental mergers in CC.
Definition PlanRepUML.h:167
PlanRepUML(const UMLGraph &umlGraph)
Construction.
void expand(bool lowDegreeExpand=false) override
Expands nodes with degree > 4 and merge nodes for generalizations.
const SList< node > & incrementalMergers(int indexCC) const
Returns the list of inserted incremental mergers.
Definition PlanRepUML.h:82
void writeGML(const char *fileName, const OrthoRep &OR, const Layout &drawing)
bool alignUpward(adjEntry ae)
Definition PlanRepUML.h:91
Singly linked lists (maintaining the length of the list).
Definition SList.h:833
Singly linked lists.
Definition SList.h:179
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.