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>
43#include <ogdf/uml/PlanRepUML.h>
44#include <ogdf/uml/UMLGraph.h>
45
46namespace ogdf {
47
55public:
57 explicit PlanRepInc(const UMLGraph& UG);
58
61 PlanRepInc(const UMLGraph& UG, const NodeArray<bool>& fixed);
62
64 void initActiveCC(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
82
85
86 // TODO: deactivate, too
87
94
97 void deleteTreeConnection(int i, int j);
100
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
157protected:
158 void initMembers(const UMLGraph& UG);
159
162
163private:
169};
170
171}
Declaration and implementation of class Array2D which implements dynamic two dimensional arrays.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Abstract base class for structures on graphs, that need to be informed about graph changes (e....
Declaration of a base class for planar representations of graphs and cluster graphs.
Declaration of class PlanRepUML.
Declaration of class UMLGraph.
Class for adjacency list elements.
Definition Graph_d.h:79
The parameterized class Array2D implements dynamic two-dimensional arrays.
Definition Array2D.h:47
Combinatorial embeddings of planar graphs with modification functionality.
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
Class for the representation of edges.
Definition Graph_d.h:300
Stores additional attributes of a graph (like layout information).
Copies of graphs supporting edge splitting.
Definition GraphCopy.h:254
Abstract Base class for graph observers.
Doubly linked lists (maintaining the length of the list).
Definition List.h:1435
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
Class for the representation of nodes.
Definition Graph_d.h:177
This class is only an adaption of PlanRep for the special incremental drawing case.
Definition PlanRepInc.h:54
int & componentNumber(node v)
Component number.
Definition PlanRepInc.h:107
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:109
Array2D< edge > m_eTreeArray
used for treeConnection
Definition PlanRepInc.h:167
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:126
void activateEdge(edge e)
Sets activity status to true and updates the structures.
virtual void nodeAdded(node v) override
Called by watched graph when a node is added Has to be implemented by derived classes.
virtual void cleared() override
Called by watched graph when its clear function is called Has to be implemented by derived classes.
edge treeEdge(int i, int j) const
Definition PlanRepInc.h:112
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:166
void initActiveCC(int i)
Inits a CC only with active elements.
adjEntry getExtAdj(GraphCopy &GC, CombinatorialEmbedding &E)
bool m_treeInit
check if the tree edge Array2D was initialized
Definition PlanRepInc.h:168
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 when an edge is added Has to be implemented by derived classes.
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:164
PlanRepInc(const UMLGraph &UG)
Constructor for interactive updates (parts added step by step)
virtual void edgeDeleted(edge e) override
Called by watched graph when an edge is deleted Has to be implemented by derived classes.
EdgeArray< bool > m_treeEdge
edge inserted for connnectivity
Definition PlanRepInc.h:165
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:48
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.