 |
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
47 class CombinatorialEmbedding;
52 const Graph* m_pGraph =
nullptr;
56 bool m_linkCopiesOnInsert =
90 void createEmpty(const
Graph& G) { setOriginalGraph(&G); }
93 virtual void setOriginalGraph(
const Graph* G) = 0;
101 void clear()
override = 0;
195 m_vCopy[m_vOrig[v] = vOrig] = v;
207 node vOrig = m_vOrig[v];
209 if (vOrig !=
nullptr) {
210 m_vCopy[vOrig] =
nullptr;
219 virtual void setOriginalEmbedding() = 0;
234 m_linkCopiesOnInsert = linkCopiesOnInsert;
238 void* preInsert(
bool copyEmbedding,
bool copyIDs,
bool notifyObservers,
bool edgeFilter,
240 int* newEdges)
override;
242 void nodeInserted(
void* userData,
node original,
node copy)
override;
281 void setOriginalGraph(
const Graph* G)
override;
284 void clear()
override;
325 m_eCopy[m_eOrig[e] = eOrig] = e;
337 void delEdge(
edge e)
override;
339 void setOriginalEmbedding()
override;
348 void copyEmbeddingToOriginal(
Graph& orig)
const;
351 void edgeInserted(
void* userData,
edge original,
edge copy)
override;
438 void setOriginalGraph(
const Graph* G)
override;
441 void clear()
override;
463 edge copy(
edge e)
const override {
return m_eCopy[e].empty() ? nullptr : m_eCopy[e].front(); }
476 auto& el = m_eCopy[adj->
theEdge()];
480 return el.front()->adjSource();
482 return el.back()->adjTarget();
498 bool isReversedCopyEdge(
edge e)
const;
512 void delEdge(
edge e)
override;
529 void unsplit(
edge eIn,
edge eOut)
override;
541 void setEdge(
edge eOrig,
edge eCopy);
543 void setOriginalEmbedding()
override;
546 void removePseudoCrossings();
550 bool hasSameEdgesCrossings()
const;
554 bool hasAdjacentEdgesCrossings()
const;
566 return hasAdjacentEdgesCrossings() || hasSameEdgesCrossings();
594 m_pGraph->allEdges(edgesToCheck);
595 removeNonSimpleCrossings(edgesToCheck, dualGraph);
614 removeNonSimpleCrossings(edgesToCheck, dualGraph);
636 void removeEdgePath(
edge eOrig);
655 edge insertCrossing(
edge& crossingEdge,
edge crossedEdge,
bool rightToLeft);
728 void consistencyCheck()
const;
735 void edgeInserted(
void* userData,
edge original,
edge copy)
override;
769 void removeSameEdgesCrossing(
adjEntry adjFirstCrossing1,
adjEntry adjFirstCrossing2,
789 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 dynamic library (shared object / 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.