Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

PlanRepUML.h
Go to the documentation of this file.
1 
32 #pragma once
33 
34 #include <ogdf/planarity/PlanRep.h>
35 #include <ogdf/uml/UMLGraph.h>
36 
39 #include <ogdf/basic/Layout.h>
41 
42 namespace ogdf {
43 
44 class GridLayoutMapped;
45 
49 class OGDF_EXPORT PlanRepUML : public PlanRep {
50 public:
51 
54  explicit PlanRepUML(const UMLGraph &umlGraph);
55  explicit PlanRepUML(const GraphAttributes &GA);
57 
60 
61  void initCC(int i);
62 
65  bool faceSplitter(edge e) const{
66  return m_faceSplitter[e];
67  }
68 
71  for(edge e : edges)
72  if (m_faceSplitter[e])
73  delEdge(e);
74  }
75 
78 
80  void setupIncremental(int indexCC, CombinatorialEmbedding &E);
81 
83  const SList<node>& incrementalMergers(int indexCC) const { return m_incMergers[indexCC]; }
84 
88 
89  //the edges that are embedded next to outgoing generalizations if alignment set
90  //attention: this information is NOT updated during graph changes and only
91  //to be used during the embedding phase
92  bool alignUpward(adjEntry ae) {return m_alignUpward[ae];}
93  void alignUpward(adjEntry ae, bool b) {m_alignUpward[ae] = b;}
94 
96 
97  const UMLGraph &getUMLGraph() const {
98  return *m_pUmlGraph;
99  }
100 
103 
106  node insertGenMerger(node v, const SList<edge> &inGens, CombinatorialEmbedding &E);
107 
109  void expand(bool lowDegreeExpand = false) override;
110 
112  void expandLowDegreeVertices(OrthoRep &OR, bool alignSmallDegree = false);
113 
114  void collapseVertices(const OrthoRep &OR, Layout &drawing);
115 
119 
121  virtual edge split(edge e) override {
122  edge eNew = PlanRep::split(e);
123 
124  //check this
125  if (m_alignUpward[e->adjSource()]) m_alignUpward[eNew->adjSource()] = true;
126  if (m_alignUpward[e->adjTarget()]) m_alignUpward[eNew->adjTarget()] = true;
127 
128  return eNew;
129  }
130 
133  void writeGML(const char *fileName, const Layout &drawing);
134  void writeGML(const char *fileName);
135  void writeGML(const char *fileName, GraphAttributes &AG);
137 
140  void writeGML(std::ostream &os, const Layout &drawing);
141  void writeGML(const char *fileName, const OrthoRep &OR, const Layout &drawing);
142  void writeGML(std::ostream &os, const OrthoRep &OR, const Layout &drawing);
143  void writeGML(const char *fileName, const OrthoRep &OR, const GridLayoutMapped &drawing);
144  void writeGML(std::ostream &os, const OrthoRep &OR, const GridLayoutMapped &drawing);
146 
148 
149 protected:
150  //insert mergers of generalizations in copy
151  void prepareIncrementalMergers(int indexCC, CombinatorialEmbedding &E);
152 
153 protected:
154  //still some AdjEntry type: used by alignment procedures
155  //attention: this information is NOT updated during graph changes and only
156  //to be used during the embedding phase
158 
159 private:
161 
163 
166 };
167 
168 }
const SList< node > & incrementalMergers(int indexCC) const
Returns the list of inserted incremental mergers.
Definition: PlanRepUML.h:83
The parameterized class Array implements dynamic arrays of type E.
Definition: Array.h:200
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
Declaration of orthogonal representation of planar graphs.
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Definition: Graph_d.h:333
Extends GridLayout by a grid mapping mechanism.
Singly linked lists.
Definition: SList.h:38
Orthogonal representation of an embedded graph.
Definition: OrthoRep.h:236
Declaration of a base class for planar representations of graphs and cluster graphs.
Declaration of class UMLGraph.
Singly linked lists (maintaining the length of the list).
Definition: SList.h:773
Declaration of node types and patterns for planar representations.
virtual edge split(edge e) override
Splits edge e.
Definition: PlanRepUML.h:121
Declaration of class Layout.
AdjEntryArray< bool > m_alignUpward
Definition: PlanRepUML.h:157
EdgeArray< bool > m_faceSplitter
Definition: PlanRepUML.h:162
Stores additional attributes of a graph (like layout information).
Planarized representation (of a connected component) of a UMLGraph; allows special handling of hierar...
Definition: PlanRepUML.h:49
Class for the representation of edges.
Definition: Graph_d.h:292
Array< SList< node > > m_incMergers
Stores all incremental mergers in CC.
Definition: PlanRepUML.h:165
Class for the representation of nodes.
Definition: Graph_d.h:169
SListPure< edge > m_mergeEdges
Definition: PlanRepUML.h:164
Edge types and patterns for planar representations.
virtual edge split(edge e) override
Splits edge e.
bool alignUpward(adjEntry ae)
Definition: PlanRepUML.h:92
~PlanRepUML()
Deconstruction.
Definition: PlanRepUML.h:59
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:65
The namespace for all OGDF objects.
Combinatorial embeddings of planar graphs with modification functionality.
const UMLGraph & getUMLGraph() const
Definition: PlanRepUML.h:97
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Definition: Graph_d.h:335
Class for adjacency list elements.
Definition: Graph_d.h:79
const UMLGraph * m_pUmlGraph
Definition: PlanRepUML.h:160
void alignUpward(adjEntry ae, bool b)
Definition: PlanRepUML.h:93
void removeFaceSplitter()
Removes all face splitting edges.
Definition: PlanRepUML.h:70
Planarized representations (of a connected component) of a graph.
Definition: PlanRep.h:59
Stores a layout of a graph (coordinates of nodes, bend points of edges).
Definition: Layout.h:46