Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::Graph::HiddenEdgeSet Class Reference

Functionality for temporarily hiding edges in constant time. More...

#include <ogdf/basic/Graph_d.h>

Public Member Functions

 HiddenEdgeSet (Graph &graph)
 Creates a new set of hidden edges.
 
 ~HiddenEdgeSet ()
 Restores all hidden edges.
 
void hide (edge e)
 Hides the given edge.
 
void restore ()
 Restores all edges contained in this set.
 
void restore (edge e)
 Reveals the given edge.
 
int size ()
 Returns the number of edges contained in this set.
 

Private Member Functions

 HiddenEdgeSet (const HiddenEdgeSet &)
 
HiddenEdgeSetoperator= (const HiddenEdgeSet &)
 

Private Attributes

internal::GraphList< EdgeElementm_edges
 
Graphm_graph
 
ListIterator< HiddenEdgeSet * > m_it
 

Friends

class EdgeElement
 
class Graph
 

Detailed Description

Functionality for temporarily hiding edges in constant time.

Hidden edges are removed from the list of all edges and their corresponding adjacency entries from the repsective adjacency lists, but the edge objects themselves are not destroyed. Hidden edges can later be reactivated using restore(). Restoring edges will not preserve the adjacency order.

Hiding or restoring an edge takes constant time. Thus, hiding edges may be more performant than creating a ogdf::GraphCopy and modifying it.

Hidden edge sets can be restored as a whole. Alternatively a single edge of a such a set can be restored.

Note that all hidden edges are restored when the set of hidden edges is destroyed.

Do not delete any nodes incident to hidden edges. Do not hide edges while iterating over the edges of a ogdf::Graph. Instead, iterate over a copied list of all edges.

Definition at line 821 of file Graph_d.h.

Constructor & Destructor Documentation

◆ HiddenEdgeSet() [1/2]

ogdf::Graph::HiddenEdgeSet::HiddenEdgeSet ( Graph graph)
inlineexplicit

Creates a new set of hidden edges.

Parameters
graphthe graph to be modified

Definition at line 831 of file Graph_d.h.

◆ ~HiddenEdgeSet()

ogdf::Graph::HiddenEdgeSet::~HiddenEdgeSet ( )
inline

Restores all hidden edges.

Definition at line 838 of file Graph_d.h.

◆ HiddenEdgeSet() [2/2]

ogdf::Graph::HiddenEdgeSet::HiddenEdgeSet ( const HiddenEdgeSet )
private

Member Function Documentation

◆ hide()

void ogdf::Graph::HiddenEdgeSet::hide ( edge  e)

Hides the given edge.

Precondition
the edge is currently not hidden.
the graph associated with this set does still exist.

◆ operator=()

HiddenEdgeSet & ogdf::Graph::HiddenEdgeSet::operator= ( const HiddenEdgeSet )
private

◆ restore() [1/2]

void ogdf::Graph::HiddenEdgeSet::restore ( )

Restores all edges contained in this set.

The set will remain valid.

Precondition
the graph associated with this set does still exist.

◆ restore() [2/2]

void ogdf::Graph::HiddenEdgeSet::restore ( edge  e)

Reveals the given edge.

Precondition
the edge is currently hidden using this set.
the graph associated with this set does still exist.

◆ size()

int ogdf::Graph::HiddenEdgeSet::size ( )

Returns the number of edges contained in this set.

Friends And Related Symbol Documentation

◆ EdgeElement

Definition at line 823 of file Graph_d.h.

◆ Graph

friend class Graph
friend

Definition at line 822 of file Graph_d.h.

Member Data Documentation

◆ m_edges

internal::GraphList<EdgeElement> ogdf::Graph::HiddenEdgeSet::m_edges
private

Definition at line 875 of file Graph_d.h.

◆ m_graph

Graph* ogdf::Graph::HiddenEdgeSet::m_graph
private

Definition at line 877 of file Graph_d.h.

◆ m_it

ListIterator<HiddenEdgeSet*> ogdf::Graph::HiddenEdgeSet::m_it
private

Definition at line 876 of file Graph_d.h.


The documentation for this class was generated from the following file: