Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
SimDraw.h
Go to the documentation of this file.
1
32#pragma once
33
36
37namespace ogdf {
38
40
52 friend class SimDrawCaller;
53 friend class SimDrawColorizer;
54 friend class SimDrawCreator;
56
57public:
59 enum class CompareBy {
60 index,
61 label
62 };
63
64private:
69
70
71public:
73
78
80 const Graph& constGraph() const { return m_G; }
81
83 Graph& constGraph() { return m_G; }
84
86 const GraphAttributes& constGraphAttributes() const { return m_GA; }
87
90
92 void clear() { m_G.clear(); }
93
95 const CompareBy& compareBy() const { return m_compareBy; }
96
98 /*
99 * The usage of comparison by label makes only sense if the
100 * attribute nodeLabel is activated and labels are set properly.
101 */
102 CompareBy& compareBy() { return m_compareBy; }
103
105
109 const bool& isDummy(node v) const { return m_isDummy[v]; }
110
112 bool& isDummy(node v) { return m_isDummy[v]; }
113
115 bool isPhantomDummy(node v) const { return isDummy(v) && !isProperDummy(v); }
116
118 bool isProperDummy(node v) const;
119
121 int numberOfNodes() const { return m_G.numberOfNodes(); }
122
129
130#ifdef OGDF_DEBUG
132 void consistencyCheck() const;
133#endif
134
136
141 int maxSubGraph() const;
142
144
150
152 void readGML(const char* fileName);
154 void writeGML(const char* fileName) const;
155
157 const Graph getBasicGraph(int i) const;
159
165
167
175
177
183 bool addGraph(const Graph& G);
184
186 void addAttribute(long attr) {
187 if (!m_GA.has(attr)) {
188 m_GA.addAttributes(attr);
189 }
190 }
191
192private:
194 bool compareById(node v, node w) const { return v->index() == w->index(); }
195
197
202 bool compareByLabel(const GraphAttributes& vGA, node v, const GraphAttributes& wGA, node w) const {
203 return vGA.label(v) == wGA.label(w);
204 }
205
207
211 bool compare(const GraphAttributes& vGA, node v, const GraphAttributes& wGA, node w) const;
212};
213
214}
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Declaration of graph copy classes.
Stores additional attributes of a graph (like layout information).
void addAttributes(long attr)
Enables attributes specified by attr and allocates required memory.
bool has(long attr) const
Returns true iff all attributes in attr are available.
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:521
int numberOfNodes() const
Returns the number of nodes in the graph.
Definition Graph_d.h:622
virtual void clear()
Removes all nodes and all edges from the graph.
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
Class for the representation of nodes.
Definition Graph_d.h:177
int index() const
Returns the (unique) node index.
Definition Graph_d.h:211
Calls modified algorithms for simdraw instances.
Adds color to a graph.
Creates variety of possible SimDraw creations.
Offers predefined SimDraw creations.
The Base class for simultaneous graph drawing.
Definition SimDraw.h:50
int numberOfProperDummyNodes() const
returns number of proper dummy nodes
void readGML(const char *fileName)
calls GraphAttributes::readGML
int maxSubGraph() const
calculates maximum number of input graphs
CompareBy m_compareBy
compare mode
Definition SimDraw.h:67
CompareBy
Types for node comparison.
Definition SimDraw.h:59
bool addGraph(const Graph &G)
adds the graph g to the instance m_G
void addAttribute(long attr)
gives access to new attribute if not already given
Definition SimDraw.h:186
const Graph & constGraph() const
returns graph
Definition SimDraw.h:80
bool compareByLabel(const GraphAttributes &vGA, node v, const GraphAttributes &wGA, node w) const
compares two nodes v and w by their labels
Definition SimDraw.h:202
bool isProperDummy(node v) const
returns true if node v is a cost greater zero dummy node
void writeGML(const char *fileName) const
calls GraphAttributes::writeGML
bool compareById(node v, node w) const
compares two nodes v and w by their ids
Definition SimDraw.h:194
bool & isDummy(node v)
returns true if node v is marked as dummy
Definition SimDraw.h:112
int numberOfBasicGraphs() const
returns number of BasicGraphs in m_G
CompareBy & compareBy()
returns compare mode
Definition SimDraw.h:102
Graph m_G
the underlying graph
Definition SimDraw.h:65
GraphAttributes & constGraphAttributes()
returns graphattributes
Definition SimDraw.h:89
bool isPhantomDummy(node v) const
returns true if node v is a cost zero dummy node
Definition SimDraw.h:115
const Graph getBasicGraph(int i) const
returns graph consisting of all edges and nodes from SubGraph i
const CompareBy & compareBy() const
returns compare mode
Definition SimDraw.h:95
Graph & constGraph()
returns graph
Definition SimDraw.h:83
const GraphAttributes & constGraphAttributes() const
returns graphattributes
Definition SimDraw.h:86
void getBasicGraphAttributes(int i, GraphAttributes &GA, Graph &G)
returns graphattributes associated with basic graph i
GraphAttributes m_GA
the underlying graphattributes
Definition SimDraw.h:66
const bool & isDummy(node v) const
returns true if node v is marked as dummy
Definition SimDraw.h:109
bool addGraphAttributes(const GraphAttributes &GA)
adds new GraphAttributes to m_G
bool compare(const GraphAttributes &vGA, node v, const GraphAttributes &wGA, node w) const
compares two nodes v and w by compare mode stored in m_compareBy
NodeArray< bool > m_isDummy
dummy nodes may be colored differently
Definition SimDraw.h:68
int numberOfPhantomDummyNodes() const
returns number of phantom dummy nodes
int numberOfNodes() const
returns number of nodes
Definition SimDraw.h:121
SimDraw()
constructs empty simdraw instance
int numberOfDummyNodes() const
returns number of dummy nodes
void clear()
empty graph
Definition SimDraw.h:92
Interface for simdraw manipulators.
#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.