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/Layout.h>
38 #include <ogdf/planarity/PlanRep.h>
39 #include <ogdf/uml/UMLGraph.h>
40 
41 namespace ogdf {
42 
43 class GridLayoutMapped;
44 
48 class OGDF_EXPORT PlanRepUML : public PlanRep {
49 public:
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 
79  void setupIncremental(int indexCC, CombinatorialEmbedding& E);
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 
104  node insertGenMerger(node v, const SList<edge>& inGens, CombinatorialEmbedding& E);
105 
107  void expand(bool lowDegreeExpand = false) override;
108 
110  void expandLowDegreeVertices(OrthoRep& OR, bool alignSmallDegree = false);
111 
112  void collapseVertices(const OrthoRep& OR, Layout& drawing);
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 
151 protected:
152  //insert mergers of generalizations in copy
153  void prepareIncrementalMergers(int indexCC, CombinatorialEmbedding& E);
154 
155 protected:
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 
161 private:
163 
165 
168 };
169 
170 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:66
ogdf::PlanRepUML::m_pUmlGraph
const UMLGraph * m_pUmlGraph
Definition: PlanRepUML.h:162
ogdf::PlanRep
Planarized representations (of a connected component) of a graph.
Definition: PlanRep.h:57
Layout.h
Declaration of class Layout.
ogdf::PlanRepUML
Planarized representation (of a connected component) of a UMLGraph; allows special handling of hierar...
Definition: PlanRepUML.h:48
ogdf::SList
Singly linked lists (maintaining the length of the list).
Definition: SList.h:833
UMLGraph.h
Declaration of class UMLGraph.
ogdf::PlanRepUML::incrementalMergers
const SList< node > & incrementalMergers(int indexCC) const
Returns the list of inserted incremental mergers.
Definition: PlanRepUML.h:82
ogdf::PlanRepUML::removeFaceSplitter
void removeFaceSplitter()
Removes all face splitting edges.
Definition: PlanRepUML.h:67
ogdf::PlanRepUML::m_faceSplitter
EdgeArray< bool > m_faceSplitter
Definition: PlanRepUML.h:164
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:135
ogdf::PlanRepUML::alignUpward
bool alignUpward(adjEntry ae)
Definition: PlanRepUML.h:91
ogdf::PlanRepUML::m_mergeEdges
SListPure< edge > m_mergeEdges
Definition: PlanRepUML.h:166
ogdf::Layout
Stores a layout of a graph (coordinates of nodes, bend points of edges).
Definition: Layout.h:46
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:64
OrthoRep.h
Declaration of orthogonal representation of planar graphs.
ogdf::OrthoRep
Orthogonal representation of an embedded graph.
Definition: OrthoRep.h:219
ogdf::Array
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:214
ogdf::SListPure
Singly linked lists.
Definition: SList.h:39
ogdf::PlanRepUML::alignUpward
void alignUpward(adjEntry ae, bool b)
Definition: PlanRepUML.h:93
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::EdgeElement::adjSource
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Definition: Graph_d.h:400
ogdf::PlanRepUML::split
virtual edge split(edge e) override
Splits edge e.
Definition: PlanRepUML.h:119
ogdf::PlanRepUML::~PlanRepUML
~PlanRepUML()
Deconstruction.
Definition: PlanRepUML.h:58
NodeTypePatterns.h
Declaration of node types and patterns for planar representations.
ogdf::EdgeElement::adjTarget
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Definition: Graph_d.h:403
ogdf::UMLGraph
Definition: UMLGraph.h:40
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:397
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:356
ogdf::GridLayoutMapped
Extends GridLayout by a grid mapping mechanism.
Definition: GridLayoutMapped.h:46
ogdf::PlanRepUML::m_incMergers
Array< SList< node > > m_incMergers
Stores all incremental mergers in CC.
Definition: PlanRepUML.h:167
ogdf::PlanRepUML::m_alignUpward
AdjEntryArray< bool > m_alignUpward
Definition: PlanRepUML.h:159
ogdf::PlanRepUML::getUMLGraph
const UMLGraph & getUMLGraph() const
Definition: PlanRepUML.h:97
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::PlanRep::split
virtual edge split(edge e) override
Splits edge e.
EdgeTypePatterns.h
Edge types and patterns for planar representations.
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:709