Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
CommonCompactionConstraintGraphBase.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
35#include <ogdf/basic/SList.h>
36#include <ogdf/basic/basic.h>
37
38#include <iosfwd>
39#include <string>
40
41namespace ogdf {
42class OrthoRep;
43class PlanRep;
44enum class OrthoDir;
45template<class E1, class E2>
46class Tuple2;
47
57
60protected:
62 const PlanRep* m_pPR;
63
67
70
72
77
80
82
85
86 virtual string getLengthString(edge e) const = 0;
87
90 int costAssoc);
91
92public:
95 const Graph& getGraph() const { return (const Graph&)*this; }
96
97 Graph& getGraph() { return (Graph&)*this; }
98
101
103 const OrthoRep& getOrthoRep() const { return *m_pOR; }
104
105 const PlanRep& getPlanRep() const { return *m_pPR; }
106
109 const SListPure<node>& nodesIn(node v) const { return m_path[v]; }
110
113 node pathNodeOf(node v) const { return m_pathNode[v]; }
114
117 int cost(edge e) const { return m_cost[e]; }
118
120 node extraRep(node v) const { return m_extraRep[v]; }
121
123 bool onBorder(edge e) const { return m_border[e] > 0; }
124
126 bool fixOnBorder(edge e) const { return m_border[e] == 2; }
127
129
131 void embed();
132
134 edge basicArc(edge e) const { return m_edgeToBasicArc[e]; }
135
138
142
143#ifdef OGDF_DEBUG
144
152 void writeGML(const char* fileName) const;
153 void writeGML(std::ostream& os) const;
154 void writeGML(const char* fileName, const NodeArray<bool>& one) const;
155 void writeGML(std::ostream& os, const NodeArray<bool>& one) const;
157
158#endif
159
165 ConstraintEdgeType typeOf(edge e) const { return m_type[e]; }
166
168 bool extraNode(node v) const { return m_extraNode[v]; }
169};
170
171}
Includes declaration of graph class.
Declaration of singly linked lists and iterators.
Basic declarations, included by all source files.
Base class for ogdf::CompactionConstraintGraphBase.
CommonCompactionConstraintGraphBase(const OrthoRep &OR, const PlanRep &PG, OrthoDir arcDir, int costAssoc)
Build constraint graph with basic arcs.
ConstraintEdgeType typeOf(edge e) const
Returns type of edge e.
bool fixOnBorder(edge e) const
Returns true if edge is subject to length fixation if length < sep.
const Graph & getGraph() const
Returns underlying graph.
virtual string getLengthString(edge e) const =0
void writeGML(const char *fileName) const
Writes GML output (for debugging)
NodeArray< edge > m_originalEdge
save edge for the basic arcs
NodeArray< node > m_pathNode
segment containing a node in PG
void writeGML(const char *fileName, const NodeArray< bool > &one) const
EdgeArray< int > m_border
only used for cage precompaction in flowcompaction computecoords
node pathNodeOf(node v) const
Returns the segment (path node in constraint graph) containing v.
void writeGML(std::ostream &os) const
void computeTopologicalSegmentNum(NodeArray< int > &topNum)
Computes topological numbering on the segments of the constraint graph.
void embed()
Embeds constraint graph such that all sources and sinks lie in a common face.
NodeArray< SListPure< node > > m_path
list of nodes contained in a segment
NodeArray< bool > m_extraNode
Node does not represent drawing node as we dont have positions we save a drawing representant and an ...
EdgeArray< edge > m_edgeToBasicArc
basic arc representing an edge in PG
EdgeArray< ConstraintEdgeType > m_type
constraint type for each edge
node extraRep(node v) const
Returns extraNode existing anchor representant.
const OrthoRep & getOrthoRep() const
Returns underlying OrthoRep.
edge basicArc(edge e) const
Returns constraint arc representing input edge e in constraint graph.
NodeArray< node > m_extraRep
existing representant of extranodes position anchor
void writeGML(std::ostream &os, const NodeArray< bool > &one) const
bool onBorder(edge e) const
Returns true if edge lies on cage border.
const SListPure< node > & nodesIn(node v) const
Returns list of nodes contained in segment v.
void removeRedundantVisibArcs(SListPure< Tuple2< node, node > > &visibArcs)
Removes "arcs" from visibArcs which we already have in the constraint graph (as basic arcs)
Class for the representation of edges.
Definition Graph_d.h:364
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Class for the representation of nodes.
Definition Graph_d.h:241
Orthogonal representation of an embedded graph.
Definition OrthoRep.h:225
Planarized representations (of a connected component) of a graph.
Definition PlanRep.h:68
Singly linked lists (maintaining the length of the list).
Definition SList.h:845
Singly linked lists.
Definition SList.h:191
Tuples of two elements (2-tuples).
Definition tuples.h:49
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
The namespace for all OGDF objects.
ConstraintEdgeType
Types of edges in the constraint graph.
@ ReducibleArc
can be compacted to zero length
@ FixToZeroArc
can be compacted to zero length, can be fixed
@ MedianArc
inserted to replace some reducible in fixzerolength
OrthoDir
Definition OrthoRep.h:56