Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

PlanRepInc.h
Go to the documentation of this file.
1 
37 #pragma once
38 
39 #include <ogdf/basic/Array2D.h>
42 #include <ogdf/planarity/PlanRep.h>
43 #include <ogdf/uml/PlanRepUML.h>
44 #include <ogdf/uml/UMLGraph.h>
45 
46 namespace ogdf {
47 
55 public:
57  explicit PlanRepInc(const UMLGraph& UG);
58 
61  PlanRepInc(const UMLGraph& UG, const NodeArray<bool>& fixed);
62 
64  void initActiveCC(int i);
67  node initMinActiveCC(int i);
68 
72  virtual void nodeDeleted(node v) override;
73  virtual void nodeAdded(node v) override;
74  virtual void edgeDeleted(edge e) override;
75  virtual void edgeAdded(edge e) override;
76  virtual void cleared() override; //Graph cleared
78 
81  void activateNode(node v);
82 
84  void activateEdge(edge e);
85 
86  // TODO: deactivate, too
87 
93  bool makeTreeConnected(adjEntry adjExternal);
94 
97  void deleteTreeConnection(int i, int j);
98  void deleteTreeConnection(int i, int j, CombinatorialEmbedding& E);
100 
103  void getExtAdjs(List<adjEntry>& extAdjs);
104  adjEntry getExtAdj(GraphCopy& GC, CombinatorialEmbedding& E);
105 
107  int& componentNumber(node v) { return m_component[v]; }
108 
109  bool& treeEdge(edge e) { return m_treeEdge[e]; }
110 
111  //only valid if m_eTreeArray initialized, should be replaced later
112  edge treeEdge(int i, int j) const {
113  if (m_treeInit) {
114  return m_eTreeArray(i, j);
115  }
116  return nullptr;
117  }
118 
119  bool treeInit() { return m_treeInit; }
120 
123 
126  virtual edge split(edge e) override {
127  edge eNew = PlanRepUML::split(e);
128  if (m_treeEdge[e]) {
129  m_treeEdge[eNew] = true;
130  }
131 
132  return eNew;
133  }
134 
135  //debug output
136 #ifdef OGDF_DEBUG
137  void writeGML(const char* fileName) {
138  const GraphAttributes& AG = getUMLGraph();
139  std::ofstream os(fileName);
140  writeGML(os, AG); //getUMLGraph());//l);
141  }
142 
143  void writeGML(const char* fileName, const Layout& drawing) {
144  std::ofstream os(fileName);
145  writeGML(os, drawing);
146  }
147 
148  void writeGML(std::ostream& os, const GraphAttributes& AG);
149  void writeGML(std::ostream& os, const Layout& drawing, bool colorEmbed = true);
150 
151  //outputs a drawing if genus != 0
152  int genusLayout(Layout& drawing) const;
153 #endif
154 
156 
157 protected:
158  void initMembers(const UMLGraph& UG);
159 
161  node initActiveCCGen(int i, bool minNode);
162 
163 private:
168  bool m_treeInit;
169 };
170 
171 }
ogdf::PlanRepInc::m_eTreeArray
Array2D< edge > m_eTreeArray
used for treeConnection
Definition: PlanRepInc.h:167
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
GraphAttributes.h
Declaration of class GraphAttributes which extends a Graph by additional attributes.
ogdf::PlanRepInc::treeEdge
edge treeEdge(int i, int j) const
Definition: PlanRepInc.h:112
ogdf::PlanRepInc::writeGML
void writeGML(const char *fileName)
Definition: PlanRepInc.h:137
ogdf::PlanRepUML
Planarized representation (of a connected component) of a UMLGraph; allows special handling of hierar...
Definition: PlanRepUML.h:48
PlanRepUML.h
Declaration of class PlanRepUML.
ogdf::PlanRepInc::split
virtual edge split(edge e) override
Splits edge e, can be removed when edge status in edgetype m_treedge can be removed afterwards.
Definition: PlanRepInc.h:126
UMLGraph.h
Declaration of class UMLGraph.
ogdf::GraphCopy
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:384
ogdf::Array2D
The parameterized class Array2D implements dynamic two-dimensional arrays.
Definition: Array2D.h:47
ogdf::PlanRepInc::m_treeInit
bool m_treeInit
check if the tree edge Array2D was initialized
Definition: PlanRepInc.h:168
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::PlanRepInc::treeEdge
bool & treeEdge(edge e)
Definition: PlanRepInc.h:109
ogdf::Layout
Stores a layout of a graph (coordinates of nodes, bend points of edges).
Definition: Layout.h:46
ogdf::GraphObserver
Abstract Base class for graph observers.
Definition: Graph_d.h:770
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:42
ogdf::internal::GraphRegisteredArray
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition: Graph_d.h:651
ogdf::PlanRepUML::split
virtual edge split(edge e) override
Splits edge e.
Definition: PlanRepUML.h:119
ogdf::PlanRepInc::componentNumber
int & componentNumber(node v)
Component number.
Definition: PlanRepInc.h:107
ogdf::PlanRepInc
This class is only an adaption of PlanRep for the special incremental drawing case.
Definition: PlanRepInc.h:54
GraphObserver.h
Abstract base class for structures on graphs, that need to be informed about graph changes (e....
ogdf::UMLGraph
Definition: UMLGraph.h:40
ogdf::PlanRepInc::m_treeEdge
EdgeArray< bool > m_treeEdge
edge inserted for connnectivity
Definition: PlanRepInc.h:165
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::PlanRepInc::m_component
NodeArray< int > m_component
number of partial component in current CC used for treeConnection
Definition: PlanRepInc.h:166
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:356
ogdf::PlanRepInc::treeInit
bool treeInit()
Definition: PlanRepInc.h:119
ogdf::PlanRepInc::writeGML
void writeGML(const char *fileName, const Layout &drawing)
Definition: PlanRepInc.h:143
Array2D.h
Declaration and implementation of class Array2D which implements dynamic two dimensional arrays.
ogdf::NodeElement
Class for the representation of nodes.
Definition: Graph_d.h:233
ogdf::PlanRepInc::m_activeNodes
NodeArray< bool > m_activeNodes
stores the status of the nodes
Definition: PlanRepInc.h:164
ogdf::internal::EdgeArrayBase2
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition: Graph_d.h:709