|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
42 #include <unordered_map>
50 using PredecessorMap = std::unordered_map<node, std::unique_ptr<NodeArray<edge>>>;
118 edge edgeToChild {
nullptr};
120 while (lastDualNode1 == lastDualNode2) {
122 parentOfLCA = edgeToChild;
126 edgeToChild = preds1[lastDualNode1];
127 if (preds1[lastDualNode1] ==
nullptr || preds2[lastDualNode2] ==
nullptr) {
132 lastDualNode1 = preds1[lastDualNode1]->
opposite(lastDualNode1);
133 lastDualNode2 = preds2[lastDualNode2]->opposite(lastDualNode2);
154 edge parentOfLCA {
nullptr};
165 if (parentOfLCA ==
nullptr) {
169 parentAdj = lcaFace->firstAdj();
174 adjEntry sourceAdj {primalParentOfLCA->adjSource()};
175 adjEntry targetAdj {primalParentOfLCA->adjTarget()};
178 if (embedding.
rightFace(sourceAdj) == lcaFace) {
179 parentAdj = sourceAdj;
182 parentAdj = targetAdj;
188 auto cyclicNextAdj = [&parentAdj](
adjEntry adj) {
190 return nextAdj == parentAdj ? nullptr : nextAdj;
195 for (
adjEntry adj {parentAdj}; adj !=
nullptr; adj = cyclicNextAdj(adj)) {
196 edge primalEdge {adj->theEdge()};
197 node primalNode {adj->theNode()};
201 if (pred1 ==
nullptr && primalNode == w1) {
204 if (pred2 ==
nullptr && primalNode == w2) {
212 if (dualEdge == pred1) {
216 if (dualEdge == pred2) {
261 return (*m_newToOldFace)[m_dual->
primalFace(dualNode)];
406 void updateMemberData(
edge origEdge,
bool startAtSource);
The namespace for all OGDF objects.
Includes declaration of graph class.
const face & primalFace(node v) const
Returns the face in the embedding of the primal graph corresponding to v.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Orders edges such that they do not cross each other when embeddded as insertion paths.
StarInserter()
Creates a StarInserter instance with default settings.
A dual graph including its combinatorial embedding of an embedded graph.
const GraphCopy & m_graphCopy
Planarization.
#define OGDF_AUGMENT_COMPARER(type)
Add this macro to your class to turn it into a full comparer.
const DynamicDualGraph * m_dualGraph
Dual graph of m_graphCopy.
face rightFace(adjEntry adj) const
Returns the face to the right of adj, i.e., the face containing adj.
Singly linked lists (maintaining the length of the list).
Copies of graphs supporting edge splitting.
std::unordered_map< node, std::unique_ptr< NodeArray< edge > >> PredecessorMap
DynamicDualGraph * m_dual
Dual graph of m_combEmbedding.
Class for adjacency list elements.
node m_rootDualNode
Dual node, root of the insertion path tree.
node m_origNode
Common (original) node of compared edges.
~StarInserter()
Destructor.
const PredecessorMap & m_predecessors
Insertion path tree, given by several insertion paths.
face oldPrimalFace(node dualNode)
Returns the primal face of dualNode which existed before any new edges were inserted.
FaceArray< face > * m_newToOldFace
Maps new faces (created after the insertion of edge paths) to old (non-split) faces....
StarInserter(const StarInserter &inserter)
Creates a StarInserter instance with the same settings as inserter.
Includes declaration of dual graph class.
Declaration of graph copy classes.
Doubly linked lists (maintaining the length of the list).
RegisteredArray for nodes, edges and adjEntries of a graph.
RegisteredArray for labeling the faces of a CombinatorialEmbedding.
edge copy(edge e) const override
Returns the first edge in the list of edges corresponding to edge e.
int compare(const edge &e1, const edge &e2) const
Compares two edges as described for EdgeOrderComparer.
Combinatorial embeddings of planar graphs.
EdgeArray< edge > * m_originalEdge
Maps the parts of a chain in m_graphCopy to the respective copy edge contained in m_graphCopy before ...
Embedding & getPrimalEmbedding() const
Returns a reference to the combinatorial embedding of the primal graph.
const edge & dualEdge(edge e) const
Returns the edge in the dual graph corresponding to e.
CombinatorialEmbedding * m_combEmbedding
Embedding of m_graphCopy.
Basic declarations, included by all source files.
Declaration of CombinatorialEmbedding and face.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
const edge & primalEdge(edge e) const
Returns the edge in the primal graph corresponding to e.
Combinatorial embeddings of planar graphs with modification functionality.
node findLCAInInsertionPathTree(node w1, node w2, edge &parentOfLCA) const
Returns the lowest common ancestor of w1 and w2 in the insertion path tree given by m_predecessors.
adjEntry faceCycleSucc() const
Returns the cyclic successor in face.
node opposite(node v) const
Returns the adjacent node different from v.
EdgeArray< edge > * m_edgeInChainToSplit
Maps each edge e originally contained in m_graphCopy to the edge in the same chain which should be sp...
Class for the representation of edges.
EdgeOrderComparer(node origNode, node rootDualNode, const PredecessorMap &predecessors, const GraphCopy &graphCopy, const DynamicDualGraph *dualGraph)
Creates a new EdgeOrderComparer.
GraphCopy * m_graphCopy
Planarization.
Declarations for Comparer objects.
Class for the representation of nodes.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
Faces in a combinatorial embedding.