Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
PlanRepInc.h
Go to the documentation of this file.
1
37#pragma once
38
39#include <ogdf/basic/Array2D.h>
40#include <ogdf/basic/Graph.h>
41#include <ogdf/basic/basic.h>
42#include <ogdf/uml/PlanRepUML.h>
43#include <ogdf/uml/UMLGraph.h>
44
45#include <fstream>
46
47namespace ogdf {
48class CombinatorialEmbedding;
49class GraphAttributes;
50class GraphCopy;
51class Layout;
52template<class E>
53class List;
54
62public:
64 explicit PlanRepInc(const UMLGraph& UG);
65
68 PlanRepInc(const UMLGraph& UG, const NodeArray<bool>& fixed);
69
71 void initActiveCC(int i);
75
79 virtual void nodeDeleted(node v) override;
80 virtual void nodeAdded(node v) override;
81 virtual void edgeDeleted(edge e) override;
82 virtual void edgeAdded(edge e) override;
83 virtual void cleared() override; //Graph cleared
85
89
92
93 // TODO: deactivate, too
94
100 bool makeTreeConnected(adjEntry adjExternal);
101
104 void deleteTreeConnection(int i, int j);
107
112
114 int& componentNumber(node v) { return m_component[v]; }
115
116 bool& treeEdge(edge e) { return m_treeEdge[e]; }
117
118 //only valid if m_eTreeArray initialized, should be replaced later
119 edge treeEdge(int i, int j) const {
120 if (m_treeInit) {
121 return m_eTreeArray(i, j);
122 }
123 return nullptr;
124 }
125
126 bool treeInit() { return m_treeInit; }
127
130
133 virtual edge split(edge e) override {
134 edge eNew = PlanRepUML::split(e);
135 if (m_treeEdge[e]) {
136 m_treeEdge[eNew] = true;
137 }
138
139 return eNew;
140 }
141
142 //debug output
143#ifdef OGDF_DEBUG
144 void writeGML(const char* fileName) {
145 const GraphAttributes& AG = getUMLGraph();
146 std::ofstream os(fileName);
147 writeGML(os, AG); //getUMLGraph());//l);
148 }
149
150 void writeGML(const char* fileName, const Layout& drawing) {
151 std::ofstream os(fileName);
152 writeGML(os, drawing);
153 }
154
155 void writeGML(std::ostream& os, const GraphAttributes& AG);
156 void writeGML(std::ostream& os, const Layout& drawing, bool colorEmbed = true);
157
158 //outputs a drawing if genus != 0
159 int genusLayout(Layout& drawing) const;
160#endif
161
163
164protected:
165 void initMembers(const UMLGraph& UG);
166
168 node initActiveCCGen(int i, bool minNode);
169
170private:
176};
177
178}
Declaration and implementation of class Array2D which implements dynamic two dimensional arrays.
Includes declaration of graph class.
Declaration of class PlanRepUML.
Declaration of class UMLGraph.
Basic declarations, included by all source files.
Class for adjacency list elements.
Definition Graph_d.h:143
The parameterized class Array2D implements dynamic two-dimensional arrays.
Definition Array2D.h:53
Combinatorial embeddings of planar graphs with modification functionality.
Class for the representation of edges.
Definition Graph_d.h:364
Stores additional attributes of a graph (like layout information).
Copies of graphs supporting edge splitting.
Definition GraphCopy.h:390
Abstract Base class for graph observers.
Definition Graph_d.h:775
Stores a layout of a graph (coordinates of nodes, bend points of edges).
Definition Layout.h:49
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Class for the representation of nodes.
Definition Graph_d.h:241
This class is only an adaption of PlanRep for the special incremental drawing case.
Definition PlanRepInc.h:61
int & componentNumber(node v)
Component number.
Definition PlanRepInc.h:114
node initMinActiveCC(int i)
Inits a CC with at least one active node, makes a node active if necessary and returns it....
bool & treeEdge(edge e)
Definition PlanRepInc.h:116
Array2D< edge > m_eTreeArray
used for treeConnection
Definition PlanRepInc.h:174
bool makeTreeConnected(adjEntry adjExternal)
Handles copies of original CCs that are split into unconnected parts of active nodes by connecting th...
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:133
void activateEdge(edge e)
Sets activity status to true and updates the structures.
virtual void nodeAdded(node v) override
Called by watched graph after a node has been added.
void writeGML(std::ostream &os, const GraphAttributes &AG)
virtual void cleared() override
Called by watched graph when its clear function is called, just before things are removed.
int genusLayout(Layout &drawing) const
edge treeEdge(int i, int j) const
Definition PlanRepInc.h:119
node initActiveCCGen(int i, bool minNode)
Initializes CC with active nodes (minNode ? at least one node)
NodeArray< int > m_component
number of partial component in current CC used for treeConnection
Definition PlanRepInc.h:173
void initActiveCC(int i)
Inits a CC only with active elements.
adjEntry getExtAdj(GraphCopy &GC, CombinatorialEmbedding &E)
void writeGML(const char *fileName)
Definition PlanRepInc.h:144
bool m_treeInit
check if the tree edge Array2D was initialized
Definition PlanRepInc.h:175
void writeGML(std::ostream &os, const Layout &drawing, bool colorEmbed=true)
void writeGML(const char *fileName, const Layout &drawing)
Definition PlanRepInc.h:150
virtual void nodeDeleted(node v) override
In the case that the underlying incremental structure changes, we update this copy.
void initMembers(const UMLGraph &UG)
virtual void edgeAdded(edge e) override
Called by watched graph after an edge has been added.
PlanRepInc(const UMLGraph &UG, const NodeArray< bool > &fixed)
Constructor for incremental updates (whole graph already given). The part to stay fixed has fixed val...
void deleteTreeConnection(int i, int j)
Deletes an edge again.
NodeArray< bool > m_activeNodes
stores the status of the nodes
Definition PlanRepInc.h:171
PlanRepInc(const UMLGraph &UG)
Constructor for interactive updates (parts added step by step)
virtual void edgeDeleted(edge e) override
Called by watched graph just before an edge is deleted.
EdgeArray< bool > m_treeEdge
edge inserted for connnectivity
Definition PlanRepInc.h:172
void getExtAdjs(List< adjEntry > &extAdjs)
Sets a list of adjentries on "external" faces of unconnected active parts of the current CC.
void activateNode(node v)
Sets activity status to true and updates the structures. Node activation activates all adjacent edges...
void deleteTreeConnection(int i, int j, CombinatorialEmbedding &E)
Planarized representation (of a connected component) of a UMLGraph; allows special handling of hierar...
Definition PlanRepUML.h:55
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Definition Graph_d.h:717
RegisteredArray for nodes, edges and adjEntries of a graph.
Definition Graph_d.h:659
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.