|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
47 class CombinatorialEmbedding;
53 const Graph* m_pGraph =
nullptr;
57 bool m_linkCopiesOnInsert =
91 void createEmpty(const
Graph& G) { setOriginalGraph(&G); }
94 virtual void setOriginalGraph(
const Graph* G) = 0;
102 void clear()
override = 0;
196 m_vCopy[m_vOrig[v] = vOrig] = v;
208 node vOrig = m_vOrig[v];
210 if (vOrig !=
nullptr) {
211 m_vCopy[vOrig] =
nullptr;
220 virtual void setOriginalEmbedding() = 0;
235 m_linkCopiesOnInsert = linkCopiesOnInsert;
239 void* preInsert(
bool copyEmbedding,
bool copyIDs,
bool notifyObservers,
bool edgeFilter,
241 int* newEdges)
override;
243 void nodeInserted(
void* userData,
node original,
node copy)
override;
282 void setOriginalGraph(
const Graph* G)
override;
285 void clear()
override;
326 m_eCopy[m_eOrig[e] = eOrig] = e;
338 void delEdge(
edge e)
override;
340 void setOriginalEmbedding()
override;
349 void copyEmbeddingToOriginal(
Graph& orig)
const;
352 void edgeInserted(
void* userData,
edge original,
edge copy)
override;
439 void setOriginalGraph(
const Graph* G)
override;
442 void clear()
override;
464 edge copy(
edge e)
const override {
return m_eCopy[e].empty() ? nullptr : m_eCopy[e].front(); }
477 auto& el = m_eCopy[adj->
theEdge()];
481 return el.front()->adjSource();
483 return el.back()->adjTarget();
499 bool isReversedCopyEdge(
edge e)
const;
513 void delEdge(
edge e)
override;
530 void unsplit(
edge eIn,
edge eOut)
override;
542 void setEdge(
edge eOrig,
edge eCopy);
544 void setOriginalEmbedding()
override;
547 void removePseudoCrossings();
551 bool hasSameEdgesCrossings()
const;
555 bool hasAdjacentEdgesCrossings()
const;
567 return hasAdjacentEdgesCrossings() || hasSameEdgesCrossings();
595 m_pGraph->allEdges(edgesToCheck);
596 removeNonSimpleCrossings(edgesToCheck, dualGraph);
615 removeNonSimpleCrossings(edgesToCheck, dualGraph);
637 void removeEdgePath(
edge eOrig);
656 edge insertCrossing(
edge& crossingEdge,
edge crossedEdge,
bool rightToLeft);
729 void consistencyCheck()
const;
736 void edgeInserted(
void* userData,
edge original,
edge copy)
override;
770 void removeSameEdgesCrossing(
adjEntry adjFirstCrossing1,
adjEntry adjFirstCrossing2,
790 void swapOriginalEdgesBetweenCrossings(
adjEntry adjFirstCrossing1,
adjEntry adjFirstCrossing2,
void removeNonSimpleCrossings(DynamicDualGraph *dualGraph=nullptr)
Removes all non-simple cossings (see hasNonSimpleCrossings() for a definition of non-simple crossings...
The namespace for all OGDF objects.
node original(node v) const
Returns the node in the original graph corresponding to v.
const Graph * getOriginalGraph() const
Includes declaration of graph class.
edge original(edge e) const
Returns the edge in the original graph corresponding to e.
edge copy(edge e) const override
Returns the edge in the graph copy corresponding to e.
bool isReversed(edge e) const
Returns true iff edge e has been reversed.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
virtual void delNode(node v)
Removes node v and all incident edges from the graph.
NodeArray< node > m_vOrig
The corresponding node in the original graph.
#define OGDF_DEPRECATED(reason)
Mark a class / member / function as deprecated.
A dual graph including its combinatorial embedding of an embedded graph.
GraphCopySimple(const Graph &G)
bool hasNonSimpleCrossings() const
Returns whether the GraphCopy contains crossings that will result in a non-simple drawing.
bool isDummy(node v) const
Returns true iff v has no corresponding node in the original graph.
std::pair< node, node > split(Graph &G, sync_plan::PipeBij &bij, const EdgeArray< edge > *new_edges=nullptr, const EdgeArray< bool > *reverse_edges=nullptr, node src=nullptr, node tgt=nullptr)
Singly linked lists (maintaining the length of the list).
Copies of graphs supporting edge splitting.
virtual void setOriginalGraph(const Graph *G)=0
Re-initializes the copy using G (which might be null), but does not create any nodes or edges.
Copies of graphs with mapping between nodes and edges.
bool isDummy(adjEntry adj) const
Returns true iff adj->theEdge() has no corresponding edge in the original graph.
adjEntry copy(adjEntry adj) const override
Returns the adjacency entry in the graph copy corresponding to adj.
AdjElement * adjEntry
The type of adjacency entries.
Class for adjacency list elements.
bool isSource() const
Returns true iff this is the source adjacency entry of the corresponding edge.
bool getLinkCopiesOnInsert() const
adjEntry copy(adjEntry adj) const override
Returns the adjacency entry in the copy graph corresponding to adj.
NodeArray< node > m_vCopy
The corresponding node in the graph copy.
GraphCopy(const GraphCopy &other)
void init(const Graph &G)
Re-initializes the copy using G, creating copies for all nodes and edges in G.
adjEntry original(adjEntry adj) const
Returns the adjacency entry in the original graph corresponding to adj.
edge theEdge() const
Returns the edge associated with this adjacency entry.
virtual void clear()
Removes all nodes and all edges from the graph.
void removeNonSimpleCrossings(node origNode, DynamicDualGraph *dualGraph=nullptr)
Removes all non-simple cossings involving edges incident to origNode (see hasNonSimpleCrossings() for...
static void copy(const T &from, T &to)
const Graph * graphOf() const
Returns the graph containing this node (debug only).
void setLinkCopiesOnInsert(bool linkCopiesOnInsert)
Whether insert(getOriginalGraph()) will automatically set copy and original.
Declaration of singly linked lists and iterators.
Decralation of GraphElement and GraphList classes.
GraphCopy(const Graph &G)
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
const List< edge > & chain(edge e) const
Returns the list of edges coresponding to edge e.
Includes declaration of dual graph class.
node source() const
Returns the source node of the edge.
node newNode(node vOrig)
Creates a new node in the graph copy with original node vOrig.
RegisteredArray for nodes, edges and adjEntries of a graph.
void init(const Graph *G)
Re-initializes the copy using G (which might be null), creating copies for all nodes and edges in G.
EdgeArray< List< edge > > m_eCopy
The corresponding list of edges in the graph copy.
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
void delNode(node v) override
Removes node v.
Data type for general directed graphs (adjacency list representation).
edge copy(edge e) const override
Returns the first edge in the list of edges corresponding to edge e.
Decralation of graph iterators.
GraphCopySimple(const Graph *G)
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
Basic declarations, included by all source files.
bool isDummy(edge e) const
Returns true iff e has no corresponding edge in the original graph.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
void setOriginalGraph(const Graph &G)
Re-initializes the copy using G, but does not create any nodes or edges.
node newNode(int index=-1)
Creates a new node and returns it.
Combinatorial embeddings of planar graphs with modification functionality.
Class for the representation of edges.
Declaration of doubly linked lists and iterators.
const Graph * graphOf() const
Returns the graph containing this node (debug only).
EdgeArray< edge > m_eCopy
The corresponding edge in the graph copy.
iterator pushBack(const E &x)
Adds element x at the end of the list.
EdgeArray< ListIterator< edge > > m_eIterator
The position of copy edge in the list.
node target() const
Returns the target node of the edge.
GraphCopySimple(const GraphCopySimple &other)
edge newEdge(node v, node w, int index=-1)
Creates a new edge (v,w) and returns it.
void copyEmbedding(const Graph &from, Graph &to, std::function< adjEntry(adjEntry)> adjMapFromTo)
Class for the representation of nodes.
edge newEdge(edge eOrig)
Creates a new edge in the graph copy with original edge eOrig.
const Graph & original() const
Returns a reference to the original graph.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
GraphCopy(const Graph *G)
node copy(node v) const
Returns the node in the graph copy corresponding to v.
EdgeArray< edge > m_eOrig
The corresponding edge in the original graph.