Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

ogdf::FaceSet< SupportFastSizeQuery > Class Template Reference

Face sets. More...

#include <ogdf/basic/FaceSet.h>

Public Types

using ListType = typename std::conditional< SupportFastSizeQuery, List< face >, ListPure< face > >::type
 

Public Member Functions

 FaceSet (const CombinatorialEmbedding &E)
 Creates an empty face set associated with combinatorial embedding E. More...
 
template<bool OtherSupportsFastSizeQuery>
 FaceSet (const FaceSet< OtherSupportsFastSizeQuery > &other)
 Copy constructor. More...
 
void clear ()
 Removes all faces from this set-. More...
 
const ConstCombinatorialEmbeddingembeddingOf () const
 Returns the associated combinatorial embedding. More...
 
const ListTypefaces () const
 Returns a reference to the list of faces contained in this set. More...
 
void insert (face f)
 Inserts face f into this set. More...
 
bool isMember (face f) const
 Returns true iff face f is contained in this set. More...
 
template<bool OtherSupportsFastSizeQuery>
FaceSetoperator= (const FaceSet< OtherSupportsFastSizeQuery > &other)
 Assignment operator. More...
 
void remove (face f)
 Removes face f from this set. More...
 
int size () const
 Returns the number of faces in this set. More...
 

Private Attributes

ListType m_faces
 The list of faces contained in this set. More...
 
FaceArray< ListIterator< face > > m_it
 m_it[f] contains the list iterator pointing to f if f is contained in S, or an invalid list iterator otherwise. More...
 

Detailed Description

template<bool SupportFastSizeQuery = true>
class ogdf::FaceSet< SupportFastSizeQuery >

Face sets.

Maintains a subset of faces contained in an associated combinatorial embedding. Provides efficient operations for testing membership, iteration, insertion and deletion of elements, as well as clearing the set.

Template Parameters
SupportFastSizeQueryWhether this set supports querying it's size in constant instead of linear time (in the size).
See also
NodeSet

Definition at line 53 of file FaceSet.h.

Member Typedef Documentation

◆ ListType

template<bool SupportFastSizeQuery = true>
using ogdf::FaceSet< SupportFastSizeQuery >::ListType = typename std::conditional<SupportFastSizeQuery, List<face>, ListPure<face> >::type

Definition at line 55 of file FaceSet.h.

Constructor & Destructor Documentation

◆ FaceSet() [1/2]

template<bool SupportFastSizeQuery = true>
ogdf::FaceSet< SupportFastSizeQuery >::FaceSet ( const CombinatorialEmbedding E)
inlineexplicit

Creates an empty face set associated with combinatorial embedding E.

Definition at line 58 of file FaceSet.h.

◆ FaceSet() [2/2]

template<bool SupportFastSizeQuery = true>
template<bool OtherSupportsFastSizeQuery>
ogdf::FaceSet< SupportFastSizeQuery >::FaceSet ( const FaceSet< OtherSupportsFastSizeQuery > &  other)
inline

Copy constructor.

Definition at line 134 of file FaceSet.h.

Member Function Documentation

◆ clear()

template<bool SupportFastSizeQuery = true>
void ogdf::FaceSet< SupportFastSizeQuery >::clear ( )
inline

Removes all faces from this set-.

After this operation, this set is empty and still associated with the same combinatorial embedding. The runtime of this operations is linear in the size().

Definition at line 98 of file FaceSet.h.

◆ embeddingOf()

template<bool SupportFastSizeQuery = true>
const ConstCombinatorialEmbedding& ogdf::FaceSet< SupportFastSizeQuery >::embeddingOf ( ) const
inline

Returns the associated combinatorial embedding.

Definition at line 120 of file FaceSet.h.

◆ faces()

template<bool SupportFastSizeQuery = true>
const ListType& ogdf::FaceSet< SupportFastSizeQuery >::faces ( ) const
inline

Returns a reference to the list of faces contained in this set.

Definition at line 115 of file FaceSet.h.

◆ insert()

template<bool SupportFastSizeQuery = true>
void ogdf::FaceSet< SupportFastSizeQuery >::insert ( face  f)
inline

Inserts face f into this set.

This operation has constant runtime. If the face is already contained in this set, nothing happens.

Precondition
f is a face in the associated combinatorial embedding.

Definition at line 67 of file FaceSet.h.

◆ isMember()

template<bool SupportFastSizeQuery = true>
bool ogdf::FaceSet< SupportFastSizeQuery >::isMember ( face  f) const
inline

Returns true iff face f is contained in this set.

This operation has constant runtime.

Precondition
f is a face in the associated combinatorial embedding.

Definition at line 109 of file FaceSet.h.

◆ operator=()

template<bool SupportFastSizeQuery = true>
template<bool OtherSupportsFastSizeQuery>
FaceSet& ogdf::FaceSet< SupportFastSizeQuery >::operator= ( const FaceSet< OtherSupportsFastSizeQuery > &  other)
inline

Assignment operator.

Definition at line 140 of file FaceSet.h.

◆ remove()

template<bool SupportFastSizeQuery = true>
void ogdf::FaceSet< SupportFastSizeQuery >::remove ( face  f)
inline

Removes face f from this set.

This operation has constant runtime. If the face is not contained in this set, nothing happens.

Precondition
f is a face in the associated combinatorial embedding.

Definition at line 83 of file FaceSet.h.

◆ size()

template<bool SupportFastSizeQuery = true>
int ogdf::FaceSet< SupportFastSizeQuery >::size ( ) const
inline

Returns the number of faces in this set.

This operation has either linear or constant runtime, depending on SupportFastSizeQuery.

Definition at line 128 of file FaceSet.h.

Member Data Documentation

◆ m_faces

template<bool SupportFastSizeQuery = true>
ListType ogdf::FaceSet< SupportFastSizeQuery >::m_faces
private

The list of faces contained in this set.

Definition at line 154 of file FaceSet.h.

◆ m_it

template<bool SupportFastSizeQuery = true>
FaceArray<ListIterator<face> > ogdf::FaceSet< SupportFastSizeQuery >::m_it
private

m_it[f] contains the list iterator pointing to f if f is contained in S, or an invalid list iterator otherwise.

Definition at line 151 of file FaceSet.h.


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