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/Array.h>
35#include <ogdf/basic/Graph.h>
37#include <ogdf/basic/SList.h>
38#include <ogdf/basic/basic.h>
40
41#include <iosfwd>
42
43namespace ogdf {
44
45class CombinatorialEmbedding;
46class GraphAttributes;
47class GridLayoutMapped;
48class Layout;
49class OrthoRep;
50class UMLGraph;
51
56public:
59 explicit PlanRepUML(const UMLGraph& umlGraph);
60 explicit PlanRepUML(const GraphAttributes& GA);
61
63
66
67 void initCC(int i);
68
71 bool faceSplitter(edge e) const { return m_faceSplitter[e]; }
72
75 for (edge e : edges) {
76 if (m_faceSplitter[e]) {
77 delEdge(e);
78 }
79 }
80 }
81
84
87
89 const SList<node>& incrementalMergers(int indexCC) const { return m_incMergers[indexCC]; }
90
94
95 //the edges that are embedded next to outgoing generalizations if alignment set
96 //attention: this information is NOT updated during graph changes and only
97 //to be used during the embedding phase
98 bool alignUpward(adjEntry ae) { return m_alignUpward[ae]; }
99
100 void alignUpward(adjEntry ae, bool b) { m_alignUpward[ae] = b; }
101
103
104 const UMLGraph& getUMLGraph() const { return *m_pUmlGraph; }
105
108
112
114 void expand(bool lowDegreeExpand = false) override;
115
117 void expandLowDegreeVertices(OrthoRep& OR, bool alignSmallDegree = false);
118
119 void collapseVertices(const OrthoRep& OR, Layout& drawing);
120
124
126 virtual edge split(edge e) override {
127 edge eNew = PlanRep::split(e);
128
129 //check this
130 if (m_alignUpward[e->adjSource()]) {
131 m_alignUpward[eNew->adjSource()] = true;
132 }
133 if (m_alignUpward[e->adjTarget()]) {
134 m_alignUpward[eNew->adjTarget()] = true;
135 }
136
137 return eNew;
138 }
139
142 void writeGML(const char* fileName, const Layout& drawing);
143 void writeGML(const char* fileName);
144 void writeGML(const char* fileName, GraphAttributes& AG);
146
149 void writeGML(std::ostream& os, const Layout& drawing);
150 void writeGML(const char* fileName, const OrthoRep& OR, const Layout& drawing);
151 void writeGML(std::ostream& os, const OrthoRep& OR, const Layout& drawing);
152 void writeGML(const char* fileName, const OrthoRep& OR, const GridLayoutMapped& drawing);
153 void writeGML(std::ostream& os, const OrthoRep& OR, const GridLayoutMapped& drawing);
155
157
158protected:
159 //insert mergers of generalizations in copy
161
162protected:
163 //still some AdjEntry type: used by alignment procedures
164 //attention: this information is NOT updated during graph changes and only
165 //to be used during the embedding phase
167
168private:
170
172
175};
176
177}
Declaration and implementation of Array class and Array algorithms.
Includes declaration of graph class.
Decralation of GraphElement and GraphList classes.
Declaration of a base class for planar representations of graphs and cluster graphs.
Declaration of singly linked lists and iterators.
Basic declarations, included by all source files.
Class for adjacency list elements.
Definition Graph_d.h:143
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:219
Combinatorial embeddings of planar graphs with modification functionality.
Class for the representation of edges.
Definition Graph_d.h:364
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Definition Graph_d.h:408
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Definition Graph_d.h:411
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:49
Class for the representation of nodes.
Definition Graph_d.h:241
Orthogonal representation of an embedded graph.
Definition OrthoRep.h:225
Planarized representations (of a connected component) of a graph.
Definition PlanRep.h:68
Planarized representation (of a connected component) of a UMLGraph; allows special handling of hierar...
Definition PlanRepUML.h:55
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:74
void writeGML(std::ostream &os, const OrthoRep &OR, const Layout &drawing)
void alignUpward(adjEntry ae, bool b)
Definition PlanRepUML.h:100
~PlanRepUML()
Deconstruction.
Definition PlanRepUML.h:65
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:169
EdgeArray< bool > m_faceSplitter
Definition PlanRepUML.h:171
void collapseVertices(const OrthoRep &OR, Layout &drawing)
PlanRepUML(const GraphAttributes &GA)
virtual edge split(edge e) override
Splits edge e.
Definition PlanRepUML.h:126
const UMLGraph & getUMLGraph() const
Definition PlanRepUML.h:104
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:173
AdjEntryArray< bool > m_alignUpward
Definition PlanRepUML.h:166
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:71
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:174
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:89
void writeGML(const char *fileName, const OrthoRep &OR, const Layout &drawing)
bool alignUpward(adjEntry ae)
Definition PlanRepUML.h:98
Singly linked lists (maintaining the length of the list).
Definition SList.h:845
Singly linked lists.
Definition SList.h:191
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition Graph_d.h:717
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.