Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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.
 
template<bool OtherSupportsFastSizeQuery>
 FaceSet (const FaceSet< OtherSupportsFastSizeQuery > &other)
 Copy constructor.
 
void clear ()
 Removes all faces from this set-.
 
const ConstCombinatorialEmbeddingembeddingOf () const
 Returns the associated combinatorial embedding.
 
const ListTypefaces () const
 Returns a reference to the list of faces contained in this set.
 
void insert (face f)
 Inserts face f into this set.
 
bool isMember (face f) const
 Returns true iff face f is contained in this set.
 
template<bool OtherSupportsFastSizeQuery>
FaceSetoperator= (const FaceSet< OtherSupportsFastSizeQuery > &other)
 Assignment operator.
 
void remove (face f)
 Removes face f from this set.
 
int size () const
 Returns the number of faces in this set.
 

Private Attributes

ListType m_faces
 The list of faces contained in this set.
 
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.
 

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 59 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 129 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 99 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 119 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 116 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 68 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 110 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 135 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 84 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 125 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 149 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 146 of file FaceSet.h.


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