DGtal  1.0.0
Public Member Functions
DGtal::CubicalComplex< TKSpace, TCellContainer >::DefaultCellMapIteratorPriority Struct Reference

#include <DGtal/topology/CubicalComplex.h>

Public Member Functions

bool operator() (const CellMapIterator &it1, const CellMapIterator &it2) const
 

Detailed Description

template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
struct DGtal::CubicalComplex< TKSpace, TCellContainer >::DefaultCellMapIteratorPriority

This structure is used to order cells (represented by their iterator in the CubicalComplex container) in a priority queue. By default, it compares the values associated to each cell (the value is the cell data masked by VALUE).

Examples
topology/cubical-complex-collapse.cpp, and topology/cubical-complex-illustrations.cpp.

Definition at line 253 of file CubicalComplex.h.

Member Function Documentation

◆ operator()()

template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::DefaultCellMapIteratorPriority::operator() ( const CellMapIterator it1,
const CellMapIterator it2 
) const
inline

This operator compares two cells specified by their iterators it1 and it2 and returns true whenever it1 has smallest data & VALUE than it2.

Parameters
it1any iterator on a cell of this cubical complex.
it2any iterator on a cell of this cubical complex.
Returns
'true' iff the value part of the data of it1 is smaller than the one of it2.

Definition at line 264 of file CubicalComplex.h.

265  {
266  uint32_t v1 = it1->second.data & VALUE;
267  uint32_t v2 = it2->second.data & VALUE;
268  return ( v1 < v2 )
269  || ( ( v1 == v2 ) && ( it1->first < it2->first ) );
270  }
boost::uint32_t uint32_t
unsigned 32-bit integer.
Definition: BasicTypes.h:63

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