 |
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
42 #include <type_traits>
46 template<
bool isConst>
60 template<
bool isConst>
68 const Graph& primalGraph = CE.getGraph();
70 Graph& dualGraph = getGraph();
84 for (
face f : CE.faces) {
95 edge eDual = dualGraph.
newEdge(vDualSource, vDualTarget);
101 for (
face f : CE.faces) {
113 dualGraph.
sort(vDual, newOrder);
123 if (ePrimal->
source() == v) {
202 face oldDualFace {rightFace(oldDualEdge->adjSource())};
207 node newPrimalNode {newPrimalEdge->source()};
211 oldDualEdge->adjSource()->faceCycleSucc())};
212 face newDualFace {leftFace(newDualEdge->adjSource())};
224 #ifdef OGDF_HEAVY_DEBUG
228 return newPrimalEdge;
244 #ifdef OGDF_HEAVY_DEBUG
265 face newDualFace {leftFace(newDualEdge->adjSource())};
277 #ifdef OGDF_HEAVY_DEBUG
281 return newPrimalNode;
299 #ifdef OGDF_HEAVY_DEBUG
303 return newPrimalNode;
325 edge newDualEdge {leftAdj->cyclicPred()->theEdge()};
337 #ifdef OGDF_HEAVY_DEBUG
341 return newPrimalEdge;
368 #ifdef OGDF_HEAVY_DEBUG
372 return oldPrimalFace;
395 #ifdef OGDF_HEAVY_DEBUG
406 #ifdef OGDF_HEAVY_DEBUG
414 Embedding::consistencyCheck();
417 const Graph& dualGraph {getGraph()};
418 OGDF_ASSERT(primalGraph.numberOfNodes() == numberOfFaces());
419 OGDF_ASSERT(primalGraph.numberOfEdges() == dualGraph.numberOfEdges());
422 for (
node vDual : dualGraph.nodes) {
425 for (
edge eDual : dualGraph.edges) {
432 for (
face fDual : Embedding::faces) {
464 OGDF_ASSERT(dualAdjEntry->theNode() == oldDualNode);
466 face newDualFace {leftFace(newDualEdge->adjSource())};
486 #ifdef OGDF_HEAVY_DEBUG
490 return newPrimalEdge;
edge addEdgeToIsolatedNodePrimal(node v, adjEntry adjTgt)
Inserts a new edge similarly to #splitFace without having to call #computeFaces again.
The namespace for all OGDF objects.
NodeArray< face > m_dualFace
The corresponding face in embedding of the dual graph.
void removeDeg1Primal(node v)
Removes degree-1 node v.
Includes declaration of graph class.
const node & primalNode(face f) const
Returns the node in the primal graph corresponding to f.
void sort(node v, const ADJ_ENTRY_LIST &newOrder)
Sorts the adjacency list of node v according to newOrder.
typename std::conditional< isConst, const ConstCombinatorialEmbedding, CombinatorialEmbedding >::type Embedding
void reverseEdgePrimal(edge e)
Reverses edges e and updates embedding.
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.
Embedding & m_primalEmbedding
The embedding of the primal graph.
node theNode() const
Returns the node whose adjacency list contains this element.
EdgeArray< edge > m_primalEdge
The corresponding edge in the primal graph.
A dual graph including its combinatorial embedding of an embedded graph.
adjEntry cyclicPred() const
Returns the cyclic predecessor in the adjacency list.
NodeArray< face > m_primalFace
The corresponding facee in the embedding of the primal graph.
internal::FaceAdjContainer entries
Container maintaining the adjacency entries in the face.
void unsplitPrimal(edge eIn, edge eOut)
Undoes a split operation.
~DualGraphBase()
Destructor.
face joinFaces(edge e)
Removes edge e and joins the two faces adjacent to e.
edge splitFace(adjEntry adjSrc, adjEntry adjTgt, bool sourceAfter=false)
Splits a face by inserting a new edge.
node splitNode(adjEntry adjStartLeft, adjEntry adjStartRight)
Splits a node while preserving the order of adjacency entries.
adjEntry faceCyclePred() const
Returns the cyclic predecessor in face.
Class for adjacency list elements.
Reverse< T > reverse(T &container)
Provides iterators for container to make it easily iterable in reverse.
bool isSource() const
Returns true iff this is the source adjacency entry of the corresponding edge.
EdgeElement * edge
The type of edges.
edge theEdge() const
Returns the edge associated with this adjacency entry.
edge splitPrimal(edge e)
Splits edge e=(v,w) into e=(v,u) and e'=(u,w) creating a new node u.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
int degree() const
Returns the degree of the node (indegree + outdegree).
adjEntry dualAdj(adjEntry primalAdj, bool reverse=false)
Returns the corresponding adjEntry of the dual edge of primalAdj (or the opposite adjEntry of the dua...
Decralation of GraphElement and GraphList classes.
EdgeArray< edge > m_dualEdge
The corresponding edge in the dual graph.
void consistencyCheck() const
Asserts that this embedding is consistent.
edge addEdgeToIsolatedNodePrimal(adjEntry adj, node v, bool adjSrc)
Inserts a new edge similarly to #splitFace without having to call #computeFaces again.
node source() const
Returns the source node of the edge.
NodeElement * node
The type of nodes.
const Graph & getPrimalGraph() const
Returns a reference to the primal graph.
Doubly linked lists (maintaining the length of the list).
RegisteredArray for nodes, edges and adjEntries of a graph.
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
Data type for general directed graphs (adjacency list representation).
RegisteredArray for labeling the faces of a CombinatorialEmbedding.
void reverseEdge(edge e)
Reverses edges e and updates embedding.
node contract(edge e, bool keepSelfLoops=false)
Contracts edge e while preserving the order of adjacency entries.
FaceArray< node > m_dualNode
The corresponding node in the dual graph.
Decralation of graph iterators.
face joinFacesPrimal(edge e)
Removes edge e and joins the two faces adjacent to e.
edge splitFacePrimal(adjEntry adjSrc, adjEntry adjTgt, bool sourceAfter=false)
Splits a face by inserting a new edge.
Combinatorial embeddings of planar graphs.
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Embedding & getPrimalEmbedding() const
Returns a reference to the combinatorial embedding of the primal graph.
node contractPrimal(edge e, bool keepSelfLoops=false)
Contracts edge e while preserving the order of adjacency entries.
const edge & dualEdge(edge e) const
Returns the edge in the dual graph corresponding to e.
FaceArray< node > m_primalNode
The corresponding node in the primal graph.
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
Basic declarations, included by all source files.
Declaration of CombinatorialEmbedding and face.
const edge & primalEdge(edge e) const
Returns the edge in the primal graph corresponding to e.
node newNode(int index=-1)
Creates a new node and returns it.
Combinatorial embeddings of planar graphs with modification functionality.
adjEntry firstAdj() const
Returns the first entry in the adjaceny list.
node opposite(node v) const
Returns the adjacent node different from v.
Class for the representation of edges.
Declaration of doubly linked lists and iterators.
node target() const
Returns the target node of the edge.
edge newEdge(node v, node w, int index=-1)
Creates a new edge (v,w) and returns it.
const node & dualNode(face f) const
Returns the node in the dual graph corresponding to f.
Class for the representation of nodes.
edge addEdgeToIsolatedNodePrimal(adjEntry adjSrc, node v)
Inserts a new edge similarly to #splitFace without having to call #computeFaces again.
node splitNodePrimal(adjEntry adjStartLeft, adjEntry adjStartRight)
Splits a node while preserving the order of adjacency entries.
const face & dualFace(node v) const
Returns the face in the embedding of the dual graph corresponding to v.
iterator pushBack(const E &x)
Adds element x at the end of the list.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
DualGraphBase(Embedding &CE)
Constructor; creates dual graph and its combinatorial embedding.
Faces in a combinatorial embedding.