Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
TopologyModule.h
Go to the documentation of this file.
1
36#pragma once
37
41
42namespace ogdf {
43
44namespace topology_module {
45
47
52class EdgeLeg {
53public:
55
57 : m_xp(DPoint(0.0, 0.0))
59 , m_copyEdge(e)
60 , m_p1(p1)
61 , m_p2(p2)
62 , m_number(number) { }
63
64 DPoint& start() { return m_p1; }
65
66 DPoint& end() { return m_p2; }
67
68 int& number() { return m_number; }
69
70 edge& copyEdge() { return m_copyEdge; }
71
79
83
84private:
88};
89
90}
91
93
102public:
104
108 enum class Options {
110 DegOneCrossings = 0x0001,
112 GenToAss = 0x0002,
115 CrossFlip = 0x0004,
117 FlipUML = 0x0010,
120 Loop = 0x0008,
121 };
122
123private:
124 friend int operator|(int, TopologyModule::Options);
126
127public:
129 : m_options(Options::DegOneCrossings | Options::GenToAss | Options::CrossFlip
130 | Options::Loop | Options::FlipUML) { }
131
132 virtual ~TopologyModule() { }
133
134 void setOptions(int i) { m_options = i; }
135
136 void addOption(TopologyModule::Options o) { m_options = m_options | o; }
137
139
155 bool setExternal = true, bool reuseGAEmbedding = false);
156
158
165
167
169
170protected:
171 //compute a planarization, i.e. insert crossing vertices,
172 //corresponding to the AG layout
174 //compute crossing point and return if existing
176 //check if node v is a crossing of two edges with a common
177 //endpoint adjacent to v, crossing is removed if flip is set
178 bool checkFlipCrossing(PlanRep& PG, node v, bool flip = true);
179
183
184private:
185 //compare vectors for sorting
186 int compare_vectors(const double& x1, const double& y1, const double& x2, const double& y2);
187 //compute and return the angle defined by p-q,p-r
189 //we have to save the position of the inserted crossing vertices
190 //in order to compute the external face
192
193 //we save a list of EdgeLegs for all original edges in
194 //AG
196
197 //option settings as bits
199};
200
201inline int operator&(int i, TopologyModule::Options b) { return i & static_cast<int>(b); }
202
204 return static_cast<int>(a) | static_cast<int>(b);
205}
206
207inline int operator|(int i, TopologyModule::Options b) { return i | static_cast<int>(b); }
208
209}
Declares EdgeComparer class.
Declaration of class GraphAttributes which extends a Graph by additional attributes.
Declaration of a base class for planar representations of graphs and cluster graphs.
Class for adjacency list elements.
Definition Graph_d.h:79
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
Class for the representation of edges.
Definition Graph_d.h:300
Faces in a combinatorial embedding.
Stores additional attributes of a graph (like layout information).
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:521
Encapsulates a pointer to a list element.
Definition List.h:103
Dynamic arrays indexed with nodes.
Definition NodeArray.h:125
Class for the representation of nodes.
Definition Graph_d.h:177
Planarized representations (of a connected component) of a graph.
Definition PlanRep.h:57
Constructs embeddings from given layout.
bool skipable(topology_module::EdgeLeg *legA, topology_module::EdgeLeg *legB)
void addOption(TopologyModule::Options o)
Options
The (pre/post)processing options.
double faceSum(PlanRep &PG, const GraphAttributes &AG, face f)
bool checkFlipCrossing(PlanRep &PG, node v, bool flip=true)
double angle(DPoint p, DPoint q, DPoint r)
face getExternalFace(PlanRep &PG, const GraphAttributes &AG)
bool setEmbeddingFromGraph(PlanRep &PG, GraphAttributes &GA, adjEntry &adjExternal, bool setExternal=true, bool reuseGAEmbedding=false)
Uses the layout GA to determine an embedding for PG.
void sortEdgesFromLayout(Graph &G, GraphAttributes &GA)
Sorts the edges around all nodes of GA corresponding to the layout given in GA.
void postProcess(PlanRep &PG)
void planarizeFromLayout(PlanRep &PG, GraphAttributes &AG)
void handleImprecision(PlanRep &PG)
EdgeArray< List< topology_module::EdgeLeg * > > m_eLegs
int compare_vectors(const double &x1, const double &y1, const double &x2, const double &y2)
NodeArray< DPoint > m_crossPosition
bool hasCrossing(topology_module::EdgeLeg *legA, topology_module::EdgeLeg *legB, DPoint &xp)
Helper class for the computation of crossings.
ListIterator< EdgeLeg * > m_eIterator
each edgeLeg holds an entry with a ListIterator pointing to its entry in a <edgeLeg*> List for an ori...
EdgeLeg(edge e, int number, DPoint p1, DPoint p2)
int m_number
the order nuumber on the edge, starting at 0
edge m_copyEdge
the edge in the PlanRep copy corresponding to the EdgeLeg
DPoint m_p2
"Starting" and "End" point of the EdgeLeg
bool m_topDown
we store the direction of the crossed EdgeLeg, too if crossingEdgeLeg is horizontally left to right
DPoint m_xp
to avoid sorting both edgelegs and crossing points, do not store a pair of them, but allow the xp to ...
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
int r[]
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
int operator|(int lhs, UMLOpt rhs)
Definition OrthoRep.h:55
int operator&(int lhs, UMLOpt rhs)
Definition OrthoRep.h:59