Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

PlanRepInc.h
Go to the documentation of this file.
1 
37 #pragma once
38 
39 #include <ogdf/planarity/PlanRep.h>
40 #include <ogdf/uml/PlanRepUML.h>
41 #include <ogdf/uml/UMLGraph.h>
44 #include <ogdf/basic/Array2D.h>
45 
46 
47 namespace ogdf {
48 
56 {
57 public:
59  explicit PlanRepInc(const UMLGraph& UG);
60 
63  PlanRepInc(const UMLGraph& UG, const NodeArray<bool> &fixed);
64 
66  void initActiveCC(int i);
69  node initMinActiveCC(int i);
70 
74  virtual void nodeDeleted(node v) override;
75  virtual void nodeAdded(node v) override;
76  virtual void edgeDeleted(edge e) override;
77  virtual void edgeAdded(edge e) override;
78  virtual void reInit() override;
79  virtual void cleared() override;//Graph cleared
81 
84  void activateNode(node v);
85 
87  void activateEdge(edge e);
88 
89  // TODO: deactivate, too
90 
96  bool makeTreeConnected(adjEntry adjExternal);
97 
100  void deleteTreeConnection(int i, int j);
101  void deleteTreeConnection(int i, int j, CombinatorialEmbedding &E);
103 
106  void getExtAdjs(List<adjEntry> &extAdjs);
107  adjEntry getExtAdj(GraphCopy &GC, CombinatorialEmbedding &E);
108 
110  int& componentNumber(node v) {return m_component[v];}
111 
112  bool& treeEdge(edge e) {return m_treeEdge[e];}
113  //only valid if m_eTreeArray initialized, should be replaced later
114  edge treeEdge(int i, int j) const
115  {
116  if (m_treeInit) {
117  return m_eTreeArray(i, j);
118  }
119  return nullptr;
120  }
121  bool treeInit() {return m_treeInit;}
122 
125 
128  virtual edge split(edge e) override {
129 
130  edge eNew = PlanRepUML::split(e);
131  if (m_treeEdge[e]) m_treeEdge[eNew] = true;
132 
133  return eNew;
134 
135  }
136 
137  //debug output
138 #ifdef OGDF_DEBUG
139  void writeGML(const char *fileName)
140  {
141  const GraphAttributes &AG = getUMLGraph();
142  std::ofstream os(fileName);
143  writeGML(os, AG);//getUMLGraph());//l);
144  }
145  void writeGML(const char *fileName, const Layout &drawing)
146  {
147  std::ofstream os(fileName);
148  writeGML(os, drawing);
149  }
150 
151  void writeGML(std::ostream &os, const GraphAttributes &AG);
152  void writeGML(std::ostream &os, const Layout &drawing, bool colorEmbed = true);
153 
154  //outputs a drawing if genus != 0
155  int genusLayout(Layout &drawing) const;
156 #endif
157 
159 
160 protected:
161  void initMembers(const UMLGraph &UG);
162 
164  node initActiveCCGen(int i, bool minNode);
165 
166 private:
171  bool m_treeInit;
172 };
173 
174 }
ogdf::PlanRepInc::m_eTreeArray
Array2D< edge > m_eTreeArray
used for treeConnection
Definition: PlanRepInc.h: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:67
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:114
ogdf::PlanRepUML
Planarized representation (of a connected component) of a UMLGraph; allows special handling of hierar...
Definition: PlanRepUML.h:49
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:128
UMLGraph.h
Declaration of class UMLGraph.
ogdf::GraphCopy
Copies of graphs supporting edge splitting.
Definition: GraphCopy.h:255
ogdf::Array2D
The parameterized class Array2D implements dynamic two-dimensional arrays.
Definition: Array2D.h:46
ogdf::PlanRepInc::m_treeInit
bool m_treeInit
check if the tree edge Array2D was initialized
Definition: PlanRepInc.h:171
ogdf::NodeArray< bool >
ogdf::EdgeArray< bool >
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:79
ogdf::PlanRepInc::treeEdge
bool & treeEdge(edge e)
Definition: PlanRepInc.h:112
ogdf::node
NodeElement * node
The type of nodes.
Definition: Graph_d.h:63
ogdf::GraphObserver
Abstract Base class for graph observers.
Definition: GraphObserver.h:57
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: List.h:40
ogdf::PlanRepUML::split
virtual edge split(edge e) override
Splits edge e.
Definition: PlanRepUML.h:121
ogdf::PlanRepInc::componentNumber
int & componentNumber(node v)
Component number.
Definition: PlanRepInc.h:110
ogdf::PlanRepInc
This class is only an adaption of PlanRep for the special incremental drawing case.
Definition: PlanRepInc.h:55
GraphObserver.h
Abstract base class for structures on graphs, that need to be informed about graph changes (e....
ogdf::UMLGraph
Definition: UMLGraph.h:41
ogdf::PlanRepInc::m_treeEdge
EdgeArray< bool > m_treeEdge
edge inserted for connnectivity
Definition: PlanRepInc.h:168
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:99
ogdf::CombinatorialEmbedding
Combinatorial embeddings of planar graphs with modification functionality.
Definition: CombinatorialEmbedding.h:409
ogdf::PlanRepInc::m_component
NodeArray< int > m_component
number of partial component in current CC used for treeConnection
Definition: PlanRepInc.h:169
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:292
ogdf::PlanRepInc::treeInit
bool treeInit()
Definition: PlanRepInc.h:121
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:169
ogdf::PlanRepInc::m_activeNodes
NodeArray< bool > m_activeNodes
stores the status of the nodes
Definition: PlanRepInc.h:167