Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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>
36 #include <ogdf/basic/GraphList.h>
37 #include <ogdf/basic/SList.h>
38 #include <ogdf/basic/basic.h>
39 #include <ogdf/planarity/PlanRep.h>
40 
41 #include <iosfwd>
42 
43 namespace ogdf {
44 
45 class CombinatorialEmbedding;
46 class GraphAttributes;
47 class GridLayoutMapped;
48 class Layout;
49 class OrthoRep;
50 class UMLGraph;
51 
55 class OGDF_EXPORT PlanRepUML : public PlanRep {
56 public:
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 
86  void setupIncremental(int indexCC, CombinatorialEmbedding& E);
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 
111  node insertGenMerger(node v, const SList<edge>& inGens, CombinatorialEmbedding& E);
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 
158 protected:
159  //insert mergers of generalizations in copy
160  void prepareIncrementalMergers(int indexCC, CombinatorialEmbedding& E);
161 
162 protected:
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 
168 private:
170 
172 
175 };
176 
177 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
ogdf::PlanRepUML::m_pUmlGraph
const UMLGraph * m_pUmlGraph
Definition: PlanRepUML.h:169
Graph.h
Includes declaration of graph class.
ogdf::PlanRep
Planarized representations (of a connected component) of a graph.
Definition: PlanRep.h:69
ogdf::PlanRepUML
Planarized representation (of a connected component) of a UMLGraph; allows special handling of hierar...
Definition: PlanRepUML.h:55
ogdf::SList
Singly linked lists (maintaining the length of the list).
Definition: SList.h:845
ogdf::PlanRepUML::incrementalMergers
const SList< node > & incrementalMergers(int indexCC) const
Returns the list of inserted incremental mergers.
Definition: PlanRepUML.h:89
ogdf::PlanRepUML::removeFaceSplitter
void removeFaceSplitter()
Removes all face splitting edges.
Definition: PlanRepUML.h:74
ogdf::PlanRepUML::m_faceSplitter
EdgeArray< bool > m_faceSplitter
Definition: PlanRepUML.h:171
PlanRep.h
Declaration of a base class for planar representations of graphs and cluster graphs.
ogdf::AdjElement
Class for adjacency list elements.
Definition: Graph_d.h:142
ogdf::PlanRepUML::alignUpward
bool alignUpward(adjEntry ae)
Definition: PlanRepUML.h:98
ogdf::PlanRepUML::m_mergeEdges
SListPure< edge > m_mergeEdges
Definition: PlanRepUML.h:173
ogdf::Layout
Stores a layout of a graph (coordinates of nodes, bend points of edges).
Definition: Layout.h:49
ogdf::PlanRepUML::faceSplitter
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
ogdf::OrthoRep
Orthogonal representation of an embedded graph.
Definition: OrthoRep.h:225
SList.h
Declaration of singly linked lists and iterators.
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:219
GraphList.h
Decralation of GraphElement and GraphList classes.
ogdf::SListPure
Singly linked lists.
Definition: SList.h:52
ogdf::PlanRepUML::alignUpward
void alignUpward(adjEntry ae, bool b)
Definition: PlanRepUML.h:100
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:658
ogdf::EdgeElement::adjSource
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Definition: Graph_d.h:407
ogdf::PlanRepUML::split
virtual edge split(edge e) override
Splits edge e.
Definition: PlanRepUML.h:126
ogdf::PlanRepUML::~PlanRepUML
~PlanRepUML()
Deconstruction.
Definition: PlanRepUML.h:65
ogdf::EdgeElement::adjTarget
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Definition: Graph_d.h:410
ogdf::UMLGraph
Definition: UMLGraph.h:48
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::CombinatorialEmbedding
Combinatorial embeddings of planar graphs with modification functionality.
Definition: CombinatorialEmbedding.h:406
Array.h
Declaration and implementation of Array class and Array algorithms.
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:363
ogdf::GridLayoutMapped
Extends GridLayout by a grid mapping mechanism.
Definition: GridLayoutMapped.h:49
ogdf::PlanRepUML::m_incMergers
Array< SList< node > > m_incMergers
Stores all incremental mergers in CC.
Definition: PlanRepUML.h:174
ogdf::PlanRepUML::m_alignUpward
AdjEntryArray< bool > m_alignUpward
Definition: PlanRepUML.h:166
ogdf::PlanRepUML::getUMLGraph
const UMLGraph & getUMLGraph() const
Definition: PlanRepUML.h:104
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:240
ogdf::PlanRep::split
virtual edge split(edge e) override
Splits edge e.
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:716