Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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. More...
 
 ~HiddenEdgeSet ()
 Restores all hidden edges. More...
 
internal::GraphList< EdgeElement >::iterator begin ()
 Return an iterator to the first hidden edge in this set. More...
 
bool empty ()
 Checks whether this set is empty. More...
 
internal::GraphList< EdgeElement >::iterator end ()
 Return an iterator one past the last hidden edge in this set. More...
 
void hide (edge e)
 Hides the given edge. More...
 
void restore ()
 Restores all edges contained in this set. More...
 
void restore (edge e)
 Reveals the given edge. More...
 
int size ()
 Returns the number of edges contained in this set. More...
 

Private Member Functions

 HiddenEdgeSet (const HiddenEdgeSet &copy)=delete
 
HiddenEdgeSetoperator= (const HiddenEdgeSet &copy)=delete
 

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 1224 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 1234 of file Graph_d.h.

◆ ~HiddenEdgeSet()

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

Restores all hidden edges.

Definition at line 1241 of file Graph_d.h.

◆ HiddenEdgeSet() [2/2]

ogdf::Graph::HiddenEdgeSet::HiddenEdgeSet ( const HiddenEdgeSet copy)
privatedelete

Member Function Documentation

◆ begin()

internal::GraphList<EdgeElement>::iterator ogdf::Graph::HiddenEdgeSet::begin ( )

Return an iterator to the first hidden edge in this set.

◆ empty()

bool ogdf::Graph::HiddenEdgeSet::empty ( )

Checks whether this set is empty.

◆ end()

internal::GraphList<EdgeElement>::iterator ogdf::Graph::HiddenEdgeSet::end ( )

Return an iterator one past the last hidden edge in this set.

◆ 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 copy)
privatedelete

◆ 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 Function Documentation

◆ EdgeElement

friend class EdgeElement
friend

Definition at line 1226 of file Graph_d.h.

◆ Graph

friend class Graph
friend

Definition at line 1225 of file Graph_d.h.

Member Data Documentation

◆ m_edges

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

Definition at line 1285 of file Graph_d.h.

◆ m_graph

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

Definition at line 1287 of file Graph_d.h.

◆ m_it

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

Definition at line 1286 of file Graph_d.h.


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