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 ©)=delete | |
HiddenEdgeSet & | operator= (const HiddenEdgeSet ©)=delete |
Private Attributes | |
internal::GraphList< EdgeElement > | m_edges |
Graph * | m_graph |
ListIterator< HiddenEdgeSet * > | m_it |
Friends | |
class | EdgeElement |
class | Graph |
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.
|
inlineexplicit |
|
inline |
|
privatedelete |
internal::GraphList<EdgeElement>::iterator ogdf::Graph::HiddenEdgeSet::begin | ( | ) |
Return an iterator to the first hidden edge in this set.
bool ogdf::Graph::HiddenEdgeSet::empty | ( | ) |
Checks whether this set is empty.
internal::GraphList<EdgeElement>::iterator ogdf::Graph::HiddenEdgeSet::end | ( | ) |
Return an iterator one past the last hidden edge in this set.
void ogdf::Graph::HiddenEdgeSet::hide | ( | edge | e | ) |
Hides the given edge.
|
privatedelete |
void ogdf::Graph::HiddenEdgeSet::restore | ( | ) |
Restores all edges contained in this set.
The set will remain valid.
void ogdf::Graph::HiddenEdgeSet::restore | ( | edge | e | ) |
Reveals the given edge.
int ogdf::Graph::HiddenEdgeSet::size | ( | ) |
Returns the number of edges contained in this set.
|
friend |
|
private |
|
private |