DGtal 1.3.0
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends
DGtal::CubicalComplex< TKSpace, TCellContainer > Class Template Reference

Aim: This class represents an arbitrary cubical complex living in some Khalimsky space. Cubical complexes are sets of cells of different dimensions related together with incidence relations. Two cells in a cubical complex are incident if and only if they are incident in the surrounding Khalimsky space. In other words, cubical complexes are defined here as subsets of Khalimsky spaces. More...

#include <DGtal/topology/CubicalComplex.h>

Inheritance diagram for DGtal::CubicalComplex< TKSpace, TCellContainer >:
DGtal::VoxelComplex< KSpace > DGtal::VoxelComplex< KSpace, FixtureMap > DGtal::VoxelComplex< TKSpace, TCellContainer >

Data Structures

struct  ConstIterator
 
struct  DefaultCellMapIteratorPriority
 
struct  Iterator
 

Public Types

enum  CellType { Maximal , Free , Any }
 Possible cell types within a complex. More...
 
typedef CubicalComplex< TKSpace, TCellContainer > Self
 
typedef TKSpace KSpace
 Type of the cellular grid space. More...
 
typedef TCellContainer CellContainer
 Type for storing cells, an associative container Cell -> Data. More...
 
typedef CellContainer::mapped_type Data
 Type of data associated to each cell. More...
 
typedef KSpace::Integer Integer
 Type for integers in the space. More...
 
typedef KSpace::Cell Cell
 Type for a cell in the space. More...
 
typedef Cell::PreCell PreCell
 Type for a precell in the space. More...
 
typedef KSpace::Cells Cells
 Type for a sequence of cells in the space. More...
 
typedef KSpace::Space Space
 Type of the digital space. More...
 
typedef KSpace::Size Size
 Type for a number of elements. More...
 
typedef KSpace::Point Point
 Type for a point in the digital space. More...
 
typedef KSpace::DirIterator DirIterator
 Type for iterating over cell directions. More...
 
typedef CellContainer CellMap
 Type for storing cells, an associative container Cell -> Data. More...
 
typedef CellMap::const_iterator CellMapConstIterator
 Const iterator for visiting type CellMap. More...
 
typedef CellMap::iterator CellMapIterator
 Iterator for visiting type CellMap. More...
 
typedef ConstIterator const_iterator
 
typedef Iterator iterator
 
typedef Cell value_type
 
typedef Cell const & reference
 
typedef Cell const & const_reference
 
typedef CellContainer::size_type size_type
 
typedef CellContainer::difference_type difference_type
 
typedef Cell const * pointer
 
typedef Cell const * const_pointer
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CCellularGridSpaceND< TKSpace >))
 
 BOOST_STATIC_ASSERT (IsPairAssociativeContainer< TCellContainer >::value)
 
 BOOST_CONCEPT_ASSERT ((concepts::CSTLAssociativeContainer< TCellContainer >))
 
 BOOST_STATIC_ASSERT ((boost::is_base_of< CubicalCellData, Data >::value))
 
 BOOST_STATIC_ASSERT ((boost::is_same< typename TKSpace::Cell, typename CellContainer::key_type >::value))
 
 BOOST_STATIC_CONSTANT (uint32_t, REMOVED=0x10000000)
 Flag Used to indicate in a cell data that this cell has been (virtually) removed. More...
 
 BOOST_STATIC_CONSTANT (uint32_t, COLLAPSIBLE=0x20000000)
 Flag Used to indicate in a cell data that this cell is collapsible. More...
 
 BOOST_STATIC_CONSTANT (uint32_t, FIXED=0x40000000)
 Flag Used to indicate in a cell data that this cell is fixed. More...
 
 BOOST_STATIC_CONSTANT (uint32_t, USER1=0x80000000)
 User flag for a cell. More...
 
 BOOST_STATIC_CONSTANT (uint32_t, VALUE=0x0fffffff)
 Value for a cell. More...
 
 ~CubicalComplex ()
 
 CubicalComplex (ConstAlias< KSpace > aK)
 
 CubicalComplex (const CubicalComplex &other)
 
template<typename TDigitalSet >
void construct (const TDigitalSet &set)
 
CubicalComplexoperator= (const CubicalComplex &other)
 
void clear ()
 
void clear (Dimension d)
 
void fillData (Data data=Data())
 
void fillData (Dimension d, Data data=Data())
 
Dimension dim () const
 
Dimension dim (const Cell &aCell) const
 
Size nbCells (Dimension d) const
 
Integer euler () const
 
const KSpacespace () const
 
const CellMapgetCells (const Dimension d) const
 
CellMapgetCells (const Dimension d)
 
ConstIterator begin () const
 
ConstIterator end () const
 
Iterator begin ()
 
Iterator end ()
 
Size count (const Cell &aCell) const
 
Size size () const
 
Size max_size () const
 
bool empty () const
 
std::pair< ConstIterator, ConstIteratorequal_range (const Cell &aCell) const
 
std::pair< Iterator, Iteratorequal_range (const Cell &aCell)
 
void erase (Iterator position)
 
Size erase (const Cell &aCell)
 
void erase (Iterator first, Iterator last)
 
ConstIterator find (const Cell &aCell) const
 
Iterator find (const Cell &aCell)
 
std::pair< Iterator, bool > insert (const Cell &aCell)
 
Iterator insert (Iterator position, const Cell &aCell)
 
template<class InputIterator >
void insert (InputIterator first, InputIterator last)
 
void swap (CubicalComplex &other)
 
Dataoperator[] (const Cell &aCell)
 
bool operator() (const Cell &aCell) const
 
void insertCell (const Cell &aCell, const Data &data=Data())
 
void insertCell (Dimension d, const Cell &aCell, const Data &data=Data())
 
template<typename CellConstIterator >
void insertCells (CellConstIterator it, CellConstIterator itE, const Data &data=Data())
 
template<typename CellConstIterator >
void insertCells (Dimension d, CellConstIterator it, CellConstIterator itE, const Data &data=Data())
 
bool belongs (const Cell &aCell) const
 
bool belongs (const PreCell &aCell) const
 
bool belongs (Dimension d, const Cell &aCell) const
 
bool belongs (Dimension d, const PreCell &aCell) const
 
Size eraseCell (const Cell &aCell)
 
Size eraseCell (Dimension d, const Cell &aCell)
 
void eraseCell (CellMapIterator it)
 
void eraseCells (CellMapIterator it, CellMapIterator itE)
 
template<typename CellConstIterator >
Size eraseCells (CellConstIterator it, CellConstIterator itE)
 
template<typename CellConstIterator >
Size eraseCells (Dimension d, CellConstIterator it, CellConstIterator itE)
 
template<typename CellOutputIterator >
void faces (CellOutputIterator &outIt, const Cell &aCell, bool hintClosed=false) const
 
template<typename CellOutputIterator >
void directFaces (CellOutputIterator &outIt, const Cell &aCell, bool hintClosed=false) const
 
template<typename CellMapIteratorOutputIterator >
void directFacesIterators (CellMapIteratorOutputIterator &outIt, const Cell &aCell)
 
template<typename CellOutputIterator >
void coFaces (CellOutputIterator &outIt, const Cell &aCell, bool hintOpen=false) const
 
template<typename CellOutputIterator >
void directCoFaces (CellOutputIterator &outIt, const Cell &aCell, bool hintOpen=false) const
 
template<typename CellMapIteratorOutputIterator >
void directCoFacesIterators (CellMapIteratorOutputIterator &outIt, const Cell &aCell)
 
CellMapConstIterator begin (Dimension d) const
 
CellMapConstIterator end (Dimension d) const
 
CellMapIterator begin (Dimension d)
 
CellMapIterator end (Dimension d)
 
CellMapConstIterator findCell (const Cell &aCell) const
 
CellMapConstIterator findCell (Dimension d, const Cell &aCell) const
 
CellMapIterator findCell (const Cell &aCell)
 
CellMapIterator findCell (Dimension d, const Cell &aCell)
 
Cells cellBoundary (const Cell &aCell, bool hintClosed=false) const
 
Cells cellCoBoundary (const Cell &aCell, bool hintOpen=false) const
 
bool isCellInterior (const Cell &aCell) const
 
bool isCellBoundary (const Cell &aCell) const
 
CellType computeCellType (const Cell &c, CellMapIterator &it_cell_up, Dimension n=dimension)
 
CubicalComplex interior () const
 
CubicalComplex boundary (bool hintClosed=false) const
 
void getInteriorAndBoundary (CubicalComplex &intcc, CubicalComplex &bdcc, bool hintClosed=false) const
 
CubicalComplex closure (const CubicalComplex &S, bool hintClosed=false) const
 
CubicalComplex star (const CubicalComplex &S, bool hintOpen=false) const
 
CubicalComplex link (const CubicalComplex &S, bool hintClosed=false, bool hintOpen=false) const
 
void close ()
 
void close (Dimension k)
 
void open ()
 
void open (Dimension k)
 
void selfDisplay (std::ostream &out) const
 
bool isValid () const
 
std::string className () const
 

Static Public Attributes

static const Dimension dimension = KSpace::dimension
 The dimension of the embedding space. More...
 

Protected Member Functions

 CubicalComplex ()
 

Protected Attributes

const KSpacemyKSpace
 The Khalimsky space in which lives the cubical complex. More...
 
std::vector< CellMapmyCells
 

Friends

template<typename K , typename C >
CubicalComplex< K, C > & DGtal::operator|= (CubicalComplex< K, C > &, const CubicalComplex< K, C > &)
 
template<typename K , typename C >
CubicalComplex< K, C > & DGtal::operator&= (CubicalComplex< K, C > &, const CubicalComplex< K, C > &)
 
template<typename K , typename C >
CubicalComplex< K, C > & DGtal::operator^= (CubicalComplex< K, C > &, const CubicalComplex< K, C > &)
 
template<typename K , typename C >
CubicalComplex< K, C > & DGtal::operator-= (CubicalComplex< K, C > &, const CubicalComplex< K, C > &)
 
template<typename K , typename C >
CubicalComplex< K, C > DGtal::operator| (const CubicalComplex< K, C > &, const CubicalComplex< K, C > &)
 
template<typename K , typename C >
CubicalComplex< K, C > DGtal::operator& (const CubicalComplex< K, C > &, const CubicalComplex< K, C > &)
 
template<typename K , typename C >
CubicalComplex< K, C > DGtal::operator^ (const CubicalComplex< K, C > &, const CubicalComplex< K, C > &)
 
template<typename K , typename C >
CubicalComplex< K, C > DGtal::operator- (const CubicalComplex< K, C > &, const CubicalComplex< K, C > &)
 
template<typename K , typename C >
CubicalComplex< K, C > DGtal::operator~ (const CubicalComplex< K, C > &)
 
template<typename K , typename C >
CubicalComplex< K, C > DGtal::operator* (const CubicalComplex< K, C > &)
 
template<typename K , typename C >
bool DGtal::operator== (const CubicalComplex< K, C > &, const CubicalComplex< K, C > &)
 
template<typename K , typename C >
bool DGtal::operator!= (const CubicalComplex< K, C > &, const CubicalComplex< K, C > &)
 
template<typename K , typename C >
bool DGtal::operator<= (const CubicalComplex< K, C > &, const CubicalComplex< K, C > &)
 
template<typename K , typename C >
bool DGtal::operator>= (const CubicalComplex< K, C > &, const CubicalComplex< K, C > &)
 

Detailed Description

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

Aim: This class represents an arbitrary cubical complex living in some Khalimsky space. Cubical complexes are sets of cells of different dimensions related together with incidence relations. Two cells in a cubical complex are incident if and only if they are incident in the surrounding Khalimsky space. In other words, cubical complexes are defined here as subsets of Khalimsky spaces.

Description of template class 'CubicalComplex'

A cubical complex is a (immutable) model of boost::Container and offers forward iterators to enumerate elements. It is close from being an AssociativeContainer, but values are not sorted (they are sorted per dimension), and are not modifiable. It is not exactly a container in the usual sense because it cannot be constructed by default, and because iterators may not modified values.

Template Parameters
TKSpaceany model of concepts::CCellularGridSpaceND, i.e. a type that models a Khalimsky space.
TCellContainerany model of associative container, mapping a KSpace::Cell to a CubicalCellData or any type deriving from it. It could be for instance a std::map or a std::unordered_map. Note that unfortunately, unordered_map are (strangely) not models of boost::AssociativeContainer, hence we cannot check concepts here.
Examples
topology/cubical-complex-collapse.cpp, topology/cubical-complex-illustrations.cpp, and topology/digitalSetToCubicalComplexes2D.cpp.

Definition at line 175 of file CubicalComplex.h.

Member Typedef Documentation

◆ Cell

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef KSpace::Cell DGtal::CubicalComplex< TKSpace, TCellContainer >::Cell

Type for a cell in the space.

Definition at line 244 of file CubicalComplex.h.

◆ CellContainer

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef TCellContainer DGtal::CubicalComplex< TKSpace, TCellContainer >::CellContainer

Type for storing cells, an associative container Cell -> Data.

Definition at line 234 of file CubicalComplex.h.

◆ CellMap

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef CellContainer DGtal::CubicalComplex< TKSpace, TCellContainer >::CellMap

Type for storing cells, an associative container Cell -> Data.

Definition at line 251 of file CubicalComplex.h.

◆ CellMapConstIterator

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef CellMap::const_iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::CellMapConstIterator

Const iterator for visiting type CellMap.

Definition at line 252 of file CubicalComplex.h.

◆ CellMapIterator

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef CellMap::iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::CellMapIterator

Iterator for visiting type CellMap.

Definition at line 253 of file CubicalComplex.h.

◆ Cells

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef KSpace::Cells DGtal::CubicalComplex< TKSpace, TCellContainer >::Cells

Type for a sequence of cells in the space.

Definition at line 246 of file CubicalComplex.h.

◆ const_iterator

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef ConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::const_iterator

Definition at line 514 of file CubicalComplex.h.

◆ const_pointer

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef Cell const* DGtal::CubicalComplex< TKSpace, TCellContainer >::const_pointer

Definition at line 522 of file CubicalComplex.h.

◆ const_reference

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef Cell const& DGtal::CubicalComplex< TKSpace, TCellContainer >::const_reference

Definition at line 518 of file CubicalComplex.h.

◆ Data

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef CellContainer::mapped_type DGtal::CubicalComplex< TKSpace, TCellContainer >::Data

Type of data associated to each cell.

Definition at line 235 of file CubicalComplex.h.

◆ difference_type

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef CellContainer::difference_type DGtal::CubicalComplex< TKSpace, TCellContainer >::difference_type

Definition at line 520 of file CubicalComplex.h.

◆ DirIterator

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef KSpace::DirIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::DirIterator

Type for iterating over cell directions.

Definition at line 250 of file CubicalComplex.h.

◆ Integer

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef KSpace::Integer DGtal::CubicalComplex< TKSpace, TCellContainer >::Integer

Type for integers in the space.

Definition at line 243 of file CubicalComplex.h.

◆ iterator

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef Iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::iterator

Definition at line 515 of file CubicalComplex.h.

◆ KSpace

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef TKSpace DGtal::CubicalComplex< TKSpace, TCellContainer >::KSpace

Type of the cellular grid space.

Definition at line 233 of file CubicalComplex.h.

◆ Point

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef KSpace::Point DGtal::CubicalComplex< TKSpace, TCellContainer >::Point

Type for a point in the digital space.

Definition at line 249 of file CubicalComplex.h.

◆ pointer

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef Cell const* DGtal::CubicalComplex< TKSpace, TCellContainer >::pointer

Definition at line 521 of file CubicalComplex.h.

◆ PreCell

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef Cell::PreCell DGtal::CubicalComplex< TKSpace, TCellContainer >::PreCell

Type for a precell in the space.

Definition at line 245 of file CubicalComplex.h.

◆ reference

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef Cell const& DGtal::CubicalComplex< TKSpace, TCellContainer >::reference

Definition at line 517 of file CubicalComplex.h.

◆ Self

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef CubicalComplex< TKSpace, TCellContainer > DGtal::CubicalComplex< TKSpace, TCellContainer >::Self

Definition at line 179 of file CubicalComplex.h.

◆ Size

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef KSpace::Size DGtal::CubicalComplex< TKSpace, TCellContainer >::Size

Type for a number of elements.

Definition at line 248 of file CubicalComplex.h.

◆ size_type

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef CellContainer::size_type DGtal::CubicalComplex< TKSpace, TCellContainer >::size_type

Definition at line 519 of file CubicalComplex.h.

◆ Space

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef KSpace::Space DGtal::CubicalComplex< TKSpace, TCellContainer >::Space

Type of the digital space.

Definition at line 247 of file CubicalComplex.h.

◆ value_type

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
typedef Cell DGtal::CubicalComplex< TKSpace, TCellContainer >::value_type

Definition at line 516 of file CubicalComplex.h.

Member Enumeration Documentation

◆ CellType

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
enum DGtal::CubicalComplex::CellType

Possible cell types within a complex.

Enumerator
Maximal 

The cell has no proper coface

Free 

The cell has 1 proper coface

Any 

The cell has strictly more than 2 proper cofaces.

Definition at line 257 of file CubicalComplex.h.

Constructor & Destructor Documentation

◆ ~CubicalComplex()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::~CubicalComplex ( )

Destructor.

◆ CubicalComplex() [1/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::CubicalComplex ( )
protected

Constructor. The cubical complex is not valid. A user may not instantiate an empty CubicalComplex, because it needs the Khalimsky space.

◆ CubicalComplex() [2/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::CubicalComplex ( ConstAlias< KSpace aK)

Constructor of empty complex. Needs a space to represents cubical cells.

Parameters
aKa Khalimsky space.

◆ CubicalComplex() [3/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::CubicalComplex ( const CubicalComplex< TKSpace, TCellContainer > &  other)

Copy constructor.

Parameters
otherthe object to clone.

Member Function Documentation

◆ begin() [1/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::begin ( )
Returns
an iterator pointing on the first cell of this complex (lower dimensional cells come first).

◆ begin() [2/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
ConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::begin ( ) const

◆ begin() [3/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::begin ( Dimension  d)
Parameters
dany valid dimension.
Returns
an iterator pointing on the first cell of dimension d of this.

◆ begin() [4/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::begin ( Dimension  d) const
Parameters
dany valid dimension.
Returns
a const iterator pointing on the first cell of dimension d of this.

◆ belongs() [1/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::belongs ( const Cell aCell) const
Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
'true' if and only if aCell belongs to this complex.

◆ belongs() [2/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::belongs ( const PreCell aCell) const
Parameters
aCellany pre-cell valid in the Khalimsky space associated to the complex.
Returns
'true' if and only if aCell belongs to this complex.

◆ belongs() [3/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::belongs ( Dimension  d,
const Cell aCell 
) const
Parameters
dthe dimension of cell aCell.
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
'true' if and only if aCell belongs to this complex.

◆ belongs() [4/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::belongs ( Dimension  d,
const PreCell aCell 
) const
Parameters
dthe dimension of cell aCell.
aCellany precell valid in the Khalimsky space associated to the complex.
Returns
'true' if and only if aCell belongs to this complex.

◆ BOOST_CONCEPT_ASSERT() [1/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CCellularGridSpaceND< TKSpace >)  )

◆ BOOST_CONCEPT_ASSERT() [2/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CSTLAssociativeContainer< TCellContainer >)  )

◆ BOOST_STATIC_ASSERT() [1/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_ASSERT ( (boost::is_base_of< CubicalCellData, Data >::value)  )

◆ BOOST_STATIC_ASSERT() [2/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_ASSERT ( (boost::is_same< typename TKSpace::Cell, typename CellContainer::key_type >::value)  )

◆ BOOST_STATIC_ASSERT() [3/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_ASSERT ( IsPairAssociativeContainer< TCellContainer >::value  )

◆ BOOST_STATIC_CONSTANT() [1/5]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_CONSTANT ( uint32_t  ,
COLLAPSIBLE  = 0x20000000 
)

Flag Used to indicate in a cell data that this cell is collapsible.

◆ BOOST_STATIC_CONSTANT() [2/5]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_CONSTANT ( uint32_t  ,
FIXED  = 0x40000000 
)

Flag Used to indicate in a cell data that this cell is fixed.

◆ BOOST_STATIC_CONSTANT() [3/5]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_CONSTANT ( uint32_t  ,
REMOVED  = 0x10000000 
)

Flag Used to indicate in a cell data that this cell has been (virtually) removed.

◆ BOOST_STATIC_CONSTANT() [4/5]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_CONSTANT ( uint32_t  ,
USER1  = 0x80000000 
)

User flag for a cell.

◆ BOOST_STATIC_CONSTANT() [5/5]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_CONSTANT ( uint32_t  ,
VALUE  = 0x0fffffff 
)

Value for a cell.

◆ boundary()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CubicalComplex DGtal::CubicalComplex< TKSpace, TCellContainer >::boundary ( bool  hintClosed = false) const

Computes the (topological) boundary of this complex (say X), hence it may not be a subcomplex of X, but it is a subcomplex of Cl(X).

Parameters
hintClosedwhen 'true', this hint tells that the complex is closed, so this speeds up this method, otherwise, the complex may be arbitrary.
Returns
the subcomplex of this composed of its boundary cells.

Referenced by main(), and SCENARIO().

◆ cellBoundary()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Cells DGtal::CubicalComplex< TKSpace, TCellContainer >::cellBoundary ( const Cell aCell,
bool  hintClosed = false 
) const

Returns the boundary of the cell aCell as a cell collection, i.e. all the cells that are proper faces of aCell. Generally faster than method faces, which outputs cells with an output iterator.

Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
hintClosedwhen 'true', this hint tells that the complex is (locally) closed, so this speeds up this method, otherwise, the complex may be arbitrary.
Returns
the collection of cells that defines the boundary of aCell, i.e. its proper faces.
Note
all returned cells belong to this complex, while it is not compulsory for aCell to belong to it.

Referenced by GIVEN().

◆ cellCoBoundary()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Cells DGtal::CubicalComplex< TKSpace, TCellContainer >::cellCoBoundary ( const Cell aCell,
bool  hintOpen = false 
) const

Returns the co-boundary of the cell aCell as a cell collection, i.e. all the cells that are proper co-faces of aCell. Generally faster than method coFaces, which outputs cells with an output iterator.

Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
hintOpenwhen 'true', this hint tells that the complex is (locally) open, so this speeds up this method, otherwise, the complex may be arbitrary.
Returns
the collection of cells that defines the co-boundary of aCell, i.e. its proper co-faces.
Note
all returned cells belong to this complex, while it is not compulsory for aCell to belong to it.

◆ className()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
std::string DGtal::CubicalComplex< TKSpace, TCellContainer >::className ( ) const
Returns
the style name used for drawing this object.

Referenced by main().

◆ clear() [1/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::clear ( )

Clears the cubical complex, which becomes empty.

Referenced by getComplex().

◆ clear() [2/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::clear ( Dimension  d)

Clears all cells of dimension d of the cubical complex.

Parameters
dthe dimension of cell aCell.

◆ close() [1/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::close ( )

Close the whole complex (see also DGtal::operator~).

Referenced by GIVEN(), main(), DGtal::operator~(), and SCENARIO().

◆ close() [2/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::close ( Dimension  k)

Close all cells of dimension less or equal to k.

Parameters
kany strictly positive integer.

◆ closure()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CubicalComplex DGtal::CubicalComplex< TKSpace, TCellContainer >::closure ( const CubicalComplex< TKSpace, TCellContainer > &  S,
bool  hintClosed = false 
) const

Returns the closure of the cells in S within this complex, i.e. the smallest subcomplex that contains each cell in S.

Parameters
Sany complex the cells of which belong to this complex.
hintClosedwhen 'true', this hint tells that the complex is (locally around S) closed, so this speeds up this method, otherwise, the complex may be arbitrary.
Returns
the closure of S within this complex as a cubical complex.

Referenced by main().

◆ coFaces()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename CellOutputIterator >
void DGtal::CubicalComplex< TKSpace, TCellContainer >::coFaces ( CellOutputIterator &  outIt,
const Cell aCell,
bool  hintOpen = false 
) const

Outputs all the cells that are proper co-faces of aCell with output iterator it.

Parameters
outItthe output iterator on Cell that is used for outputing faces.
aCellany cell valid in the Khalimsky space associated to the complex.
hintOpenwhen 'true', this hint tells that the complex is open, so this speeds up this method, otherwise, the complex may be arbitrary.
Template Parameters
CellOutputIteratorany model of boost::OutputIterator, with value_type Cell.
Note
all returned cells belong to this complex, while it is not compulsory for aCell to belong to it.

◆ computeCellType()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellType DGtal::CubicalComplex< TKSpace, TCellContainer >::computeCellType ( const Cell c,
CellMapIterator it_cell_up,
Dimension  n = dimension 
)

Given a cell [c], tells if it is a maximal cell in the complex (return 0), or if it is a free face of the cell pointed by [it_cell_up] (return 1) or if it is not a free face.

The complex must be closed. In computing the 1-up-incident cells, this method ignores cell marked as REMOVED. Furthermore, if one 1-up-incident cell is not marked as COLLAPSIBLE, the method returns 2.

Parameters
[in]ca cubical cell (belonging to 'this')
[out]it_cell_up(returns) a pointer on a cell d if c is a free face of d.
[in]nthe maximal dimension of a cell in this complex. Default to dimension, but can be less in some cases: for instance, you know that your subcomplex is a digital surface in Z3, hence you can pass 2 for n.
Returns
CellType::Maximal if the cell is maximal, CellType::Free if the cell is a free face, CellType::Any otherwise.

◆ construct()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename TDigitalSet >
void DGtal::CubicalComplex< TKSpace, TCellContainer >::construct ( const TDigitalSet &  set)

Construct a complex from a digital set.

Template Parameters
TDigitalSeteither kind of DigitalSet
Parameters
set- a digital set from which to create a complex. Set has to be of the same dimension as a Khalimsky space.

Referenced by getComplex(), and main().

◆ count()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::count ( const Cell aCell) const
Parameters
aCellany cell.
Returns
the number of matches for aCell, which is thus zero (not present) or one (present).

◆ dim() [1/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Dimension DGtal::CubicalComplex< TKSpace, TCellContainer >::dim ( ) const
Returns
the maximal dimension of a cell in the complex, 0 if the complex is empty.

◆ dim() [2/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Dimension DGtal::CubicalComplex< TKSpace, TCellContainer >::dim ( const Cell aCell) const
Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
the dimension of the cell aCell.

◆ directCoFaces()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename CellOutputIterator >
void DGtal::CubicalComplex< TKSpace, TCellContainer >::directCoFaces ( CellOutputIterator &  outIt,
const Cell aCell,
bool  hintOpen = false 
) const

Outputs all the cells that are direct co-faces of aCell with output iterator it (direct faces are upper incident cells with a dimension just one above).

Parameters
outItthe output iterator on Cell that is used for outputing faces.
aCellany cell valid in the Khalimsky space associated to the complex.
hintOpenwhen 'true', this hint tells that the complex is open, so this speeds up this method, otherwise, the complex may be arbitrary.
Template Parameters
CellOutputIteratorany model of boost::OutputIterator, with value_type Cell.
Note
all returned cells belong to this complex, while it is not compulsory for aCell to belong to it.

Referenced by GIVEN().

◆ directCoFacesIterators()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename CellMapIteratorOutputIterator >
void DGtal::CubicalComplex< TKSpace, TCellContainer >::directCoFacesIterators ( CellMapIteratorOutputIterator &  outIt,
const Cell aCell 
)

Outputs all the iterators on cells that are direct co-faces of aCell with output iterator it (direct faces are upper incident cells with a dimension just one above).

Parameters
outItthe output iterator on CellMapIterator that is used for outputing face iterators.
aCellany cell valid in the Khalimsky space associated to the complex.
Template Parameters
CellMapIteratorOutputIteratorany model of boost::OutputIterator, with value_type CellMapIterator.
Note
all returned cells belong to this complex, while it is not compulsory for aCell to belong to it.

◆ directFaces()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename CellOutputIterator >
void DGtal::CubicalComplex< TKSpace, TCellContainer >::directFaces ( CellOutputIterator &  outIt,
const Cell aCell,
bool  hintClosed = false 
) const

Outputs all the cells that are direct faces of aCell with output iterator it (direct faces are lower incident cells with a dimension just one below).

Parameters
outItthe output iterator on Cell that is used for outputing faces.
aCellany cell valid in the Khalimsky space associated to the complex.
hintClosedwhen 'true', this hint tells that the complex is closed, so this speeds up this method, otherwise, the complex may be arbitrary.
Template Parameters
CellOutputIteratorany model of boost::OutputIterator, with value_type Cell.
Note
all returned cells belong to this complex, while it is not compulsory for aCell to belong to it.

Referenced by GIVEN().

◆ directFacesIterators()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename CellMapIteratorOutputIterator >
void DGtal::CubicalComplex< TKSpace, TCellContainer >::directFacesIterators ( CellMapIteratorOutputIterator &  outIt,
const Cell aCell 
)

Outputs all the iterators on cells that are direct faces of aCell with output iterator it (direct faces are lower incident cells with a dimension just one below).

Parameters
outItthe output iterator on CellMapIterator that is used for outputing face iterators.
aCellany cell valid in the Khalimsky space associated to the complex.
Template Parameters
CellMapIteratorOutputIteratorany model of boost::OutputIterator, with value_type CellMapIterator.
Note
all returned cells belong to this complex, while it is not compulsory for aCell to belong to it.

◆ empty()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::empty ( ) const
Returns
'true' if and only if the complex does not hold any cell.

◆ end() [1/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::end ( )
Returns
an iterator pointing after the last cell of this complex (upper dimensional cells arrive last).

◆ end() [2/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
ConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::end ( ) const

◆ end() [3/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::end ( Dimension  d)
Parameters
dany valid dimension.
Returns
an iterator pointing after the last cell of dimension d of this.

◆ end() [4/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::end ( Dimension  d) const
Parameters
dany valid dimension.
Returns
a const iterator pointing after the last cell of dimension d of this.

◆ equal_range() [1/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
std::pair< Iterator, Iterator > DGtal::CubicalComplex< TKSpace, TCellContainer >::equal_range ( const Cell aCell)

Get range of equal elements to aCell. Because all elements in a set container are unique, the range returned will contain a single element at most.

Parameters
aCellany cell.
Returns
the bounds of a range that includes all the elements in the container that are equivalent to val.

◆ equal_range() [2/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
std::pair< ConstIterator, ConstIterator > DGtal::CubicalComplex< TKSpace, TCellContainer >::equal_range ( const Cell aCell) const

Get range of equal elements to aCell. Because all elements in a set container are unique, the range returned will contain a single element at most.

Parameters
aCellany cell.
Returns
the bounds of a range that includes all the elements in the container that are equivalent to val.

◆ erase() [1/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::erase ( const Cell aCell)

Erases cell aCell from the complex (STL version, see eraseCell).

Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
the number of cells effectively removed from the cubical complex.

◆ erase() [2/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::erase ( Iterator  first,
Iterator  last 
)

Erases range of cells [first, last ).

Parameters
firstan iterator on the beginning of a range of cells within this complex.
lastan iterator on the end of a range of cells within this complex.

◆ erase() [3/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::erase ( Iterator  position)

Erase element pointed by iterator it.

Parameters
positionany iterator on a valid cell.

◆ eraseCell() [1/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::eraseCell ( CellMapIterator  it)

Erases cell pointed by iterator it.

Parameters
itany valid iterator on a cell of this complex.

◆ eraseCell() [2/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::eraseCell ( const Cell aCell)

Erases cell aCell from the complex.

Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
the number of cells effectively removed from the cubical complex.

◆ eraseCell() [3/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::eraseCell ( Dimension  d,
const Cell aCell 
)

Erases cell aCell from the complex.

Parameters
dthe dimension of cell aCell.
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
the number of cells effectively removed from the cubical complex.

◆ eraseCells() [1/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename CellConstIterator >
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::eraseCells ( CellConstIterator  it,
CellConstIterator  itE 
)

Erases the cells stored in range [it,itE) from the CubicalComplex.

Parameters
itan iterator pointing at the beginning of a range of (arbitrary) cells.
itEan iterator pointing after the end of a range of (arbitrary) cells.
Returns
the number of cells effectively removed from the cubical complex.
Template Parameters
CellConstIteratorany model of a forward const iterator on Cell.

◆ eraseCells() [2/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::eraseCells ( CellMapIterator  it,
CellMapIterator  itE 
)

Erases cells in range [it, itE).

Parameters
itany valid iterator on the first element of range of cells of this complex.
itEany valid iterator after the last element of range of cells of this complex.

◆ eraseCells() [3/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename CellConstIterator >
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::eraseCells ( Dimension  d,
CellConstIterator  it,
CellConstIterator  itE 
)

Erases the cells of dimension d stored in range [it,itE) from the CubicalComplex.

Parameters
dthe dimension of every cell in range [it,itE).
itan iterator pointing at the beginning of a range of (arbitrary) cells.
itEan iterator pointing after the end of a range of (arbitrary) cells.
Returns
the number of cells effectively removed from the cubical complex.
Template Parameters
CellConstIteratorany model of a forward const iterator on Cell.

◆ euler()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Integer DGtal::CubicalComplex< TKSpace, TCellContainer >::euler ( ) const
Note
For instance, all Platonician solids have euler number equal to one, while their surface have euler number equal to two.
Returns
the Euler number of this complex which equals nbCells( 0 ) - nbCells( 1 ) + nbCells( 2 ) - ...

Referenced by SCENARIO(), and TEST_CASE().

◆ faces()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename CellOutputIterator >
void DGtal::CubicalComplex< TKSpace, TCellContainer >::faces ( CellOutputIterator &  outIt,
const Cell aCell,
bool  hintClosed = false 
) const

Outputs all the cells that are proper faces of aCell with output iterator it.

Parameters
outItthe output iterator on Cell that is used for outputing faces.
aCellany cell valid in the Khalimsky space associated to the complex.
hintClosedwhen 'true', this hint tells that the complex is closed, so this speeds up this method, otherwise, the complex may be arbitrary.
Template Parameters
CellOutputIteratorany model of boost::OutputIterator, with value_type Cell.
Note
all returned cells belong to this complex, while it is not compulsory for aCell to belong to it.

Referenced by GIVEN().

◆ fillData() [1/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::fillData ( Data  data = Data())

Fills the data of every cell of this cubical complex, which becomes data. Default value resets the data to zero.

Parameters
dataany data.

◆ fillData() [2/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::fillData ( Dimension  d,
Data  data = Data() 
)

Fills the data of every cell of dimension d this cubical complex, which becomes data. Default value resets the data to zero.

Parameters
dthe dimension of cell aCell.
dataany data.

◆ find() [1/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::find ( const Cell aCell)
Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
an iterator pointing on the cell or end() if not found.

◆ find() [2/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
ConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::find ( const Cell aCell) const
Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
an iterator pointing on the cell or end() if not found.

◆ findCell() [1/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::findCell ( const Cell aCell)
Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
an iterator pointing on the pair (aCell,data) if the cell belongs to the complex, or end( dim( aCell ) )

◆ findCell() [2/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::findCell ( const Cell aCell) const
Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
an iterator pointing on the pair (aCell,data) if the cell belongs to the complex, or end( dim( aCell ) )

Referenced by SCENARIO().

◆ findCell() [3/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::findCell ( Dimension  d,
const Cell aCell 
)
Parameters
dthe dimension of cell aCell.
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
an iterator pointing on the pair (aCell,data) if the cell belongs to the complex, or end( d )

◆ findCell() [4/4]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMapConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::findCell ( Dimension  d,
const Cell aCell 
) const
Parameters
dthe dimension of cell aCell.
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
an iterator pointing on the pair (aCell,data) if the cell belongs to the complex, or end( d )

◆ getCells() [1/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CellMap & DGtal::CubicalComplex< TKSpace, TCellContainer >::getCells ( const Dimension  d)
Parameters
dinput Dimension
Returns
CellContainer associated to cell of dimension d.

◆ getCells() [2/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
const CellMap & DGtal::CubicalComplex< TKSpace, TCellContainer >::getCells ( const Dimension  d) const
Parameters
dinput Dimension
Returns
CellContainer associated to cell of dimension d.

◆ getInteriorAndBoundary()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::getInteriorAndBoundary ( CubicalComplex< TKSpace, TCellContainer > &  intcc,
CubicalComplex< TKSpace, TCellContainer > &  bdcc,
bool  hintClosed = false 
) const

Computes the (topological) interior intcc and the (topological) boundary bdcc of this complex. Note that bdcc is not necessarily a subcomplex.

Parameters
[out]intccreturns the interior subcomplex of this complex.
[out]bdccreturns the boundary of this complex.
hintClosedwhen 'true', this hint tells that the complex is closed, so this speeds up this method, otherwise, the complex may be arbitrary.

◆ insert() [1/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
std::pair< Iterator, bool > DGtal::CubicalComplex< TKSpace, TCellContainer >::insert ( const Cell aCell)

Insert element aCell into the complex.

Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
a pair with an iterator pointing on the inserted element and a boolean that is true whenever this was indeed a new element in the complex.

Referenced by SCENARIO().

◆ insert() [2/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<class InputIterator >
void DGtal::CubicalComplex< TKSpace, TCellContainer >::insert ( InputIterator  first,
InputIterator  last 
)

Insert a range of cells [first, last).

Template Parameters
InputIteratorany model of boost::InputIterator where elements are Cell.
Parameters
firstthe beginning of the range.
lastthe end of the range.

◆ insert() [3/3]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::insert ( Iterator  position,
const Cell aCell 
)

Insert element aCell into the complex with possible hint given by position.

Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
positionan hint for the position where the element can be inserted.
Returns
an iterator pointing on the inserted element.

◆ insertCell() [1/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::insertCell ( const Cell aCell,
const Data data = Data() 
)

Insert cell aCell into CubicalComplex and assign to it the value data.

Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
dataany value.

Referenced by GIVEN(), main(), and SCENARIO().

◆ insertCell() [2/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::insertCell ( Dimension  d,
const Cell aCell,
const Data data = Data() 
)

Insert cell aCell into CubicalComplex and assign to it the value data. Faster than the other insertCell method.

Parameters
dthe dimension of cell aCell.
aCellany cell valid in the Khalimsky space associated to the complex.
dataany value.

◆ insertCells() [1/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename CellConstIterator >
void DGtal::CubicalComplex< TKSpace, TCellContainer >::insertCells ( CellConstIterator  it,
CellConstIterator  itE,
const Data data = Data() 
)

Insert the cells within range [it,itE) into the CubicalComplex. The value associated to each cell is the default.

Parameters
itan iterator pointing at the beginning of a range of (arbitrary) cells.
itEan iterator pointing after the end of a range of (arbitrary) cells.
dataany value.
Template Parameters
CellConstIteratorany model of a forward const iterator on Cell.

◆ insertCells() [2/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename CellConstIterator >
void DGtal::CubicalComplex< TKSpace, TCellContainer >::insertCells ( Dimension  d,
CellConstIterator  it,
CellConstIterator  itE,
const Data data = Data() 
)

Insert the cells within range [it,itE) into the CubicalComplex. The value associated to each cell is the default.

Parameters
dthe dimension of all cells in the range [it,itE).
itan iterator pointing at the beginning of a range of (arbitrary) cells.
itEan iterator pointing after the end of a range of (arbitrary) cells.
dataany value.
Template Parameters
CellConstIteratorany model of a forward const iterator on Cell.

◆ interior()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CubicalComplex DGtal::CubicalComplex< TKSpace, TCellContainer >::interior ( ) const

Computes the (topological) interior to this complex.

Returns
the subcomplex of this composed of its interior cells.

Referenced by main().

◆ isCellBoundary()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::isCellBoundary ( const Cell aCell) const
Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
'true' if and only if aCell is not interior to the complex, which means that it has more co-faces in the Khalimsky space than in this complex.

◆ isCellInterior()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::isCellInterior ( const Cell aCell) const
Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
'true' if and only if aCell is interior to the complex, which means that it has the same co-faces in the Khalimsky space as in this complex.

◆ isValid()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::isValid ( ) const

Checks the validity/consistency of the object.

Returns
'true' if the object is valid, 'false' otherwise.

◆ link()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CubicalComplex DGtal::CubicalComplex< TKSpace, TCellContainer >::link ( const CubicalComplex< TKSpace, TCellContainer > &  S,
bool  hintClosed = false,
bool  hintOpen = false 
) const

Returns the link of the cells in S within this complex, i.e. the closed star of S minus the stars of all faces of S.

Parameters
Sany complex the cells of which belong to this complex.
hintClosedwhen 'true', this hint tells that the complex is (locally around S) closed, so this speeds up this method, otherwise, the complex may be arbitrary.
hintOpenwhen 'true', this hint tells that the complex is (locally around S) open, so this speeds up this method, otherwise, the complex may be arbitrary.
Returns
the link of S within this complex as a cubical complex.

Referenced by main(), and SCENARIO().

◆ max_size()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::max_size ( ) const
Returns
the maximal number of cells in this complex (i.e., the number of cells of the Khalimsky space).

◆ nbCells()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::nbCells ( Dimension  d) const
Parameters
dthe dimension of cells.
Returns
the number of cells of dimension d in this complex.

Referenced by GIVEN(), and SCENARIO().

◆ open() [1/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::open ( )

Open the whole complex (see also DGtal::operator*).

Referenced by DGtal::operator*().

◆ open() [2/2]

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::open ( Dimension  k)

Open all cells of dimension less or or equal to k.

Parameters
kany strictly positive integer.

◆ operator()()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::operator() ( const Cell aCell) const

Makes CubicalComplex a functor Cell -> boolean, which represents the characteristic cell function.

Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
'true' if and only if aCell belongs to this complex.

◆ operator=()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CubicalComplex & DGtal::CubicalComplex< TKSpace, TCellContainer >::operator= ( const CubicalComplex< TKSpace, TCellContainer > &  other)

Assignment.

Parameters
otherthe object to copy.
Returns
a reference on 'this'.

◆ operator[]()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Data & DGtal::CubicalComplex< TKSpace, TCellContainer >::operator[] ( const Cell aCell)

Access or change the data associated to aCell. Note that if aCell was not in this complex, then it is inserted.

Parameters
aCellany cell valid in the Khalimsky space associated to the complex.
Returns
a reference on the data associated with aCell.

◆ selfDisplay()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::selfDisplay ( std::ostream &  out) const

Writes/Displays the object on an output stream.

Parameters
outthe output stream where the object is written.

◆ size()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::size ( ) const
Returns
the total number of cells in this complex.

Referenced by SCENARIO().

◆ space()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
const KSpace & DGtal::CubicalComplex< TKSpace, TCellContainer >::space ( ) const
Returns
a reference to the Khalimsky space associated to this complex.

Referenced by DGtal::operator!=(), DGtal::operator<=(), DGtal::operator==(), and DGtal::operator>=().

◆ star()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
CubicalComplex DGtal::CubicalComplex< TKSpace, TCellContainer >::star ( const CubicalComplex< TKSpace, TCellContainer > &  S,
bool  hintOpen = false 
) const

Returns the star of the cells in S within this complex, i.e. the set of all cells of this complex that have any faces in S.

Parameters
Sany complex the cells of which belong to this complex.
hintOpenwhen 'true', this hint tells that the complex is (locally around S) open, so this speeds up this method, otherwise, the complex may be arbitrary.
Returns
the star of S within this complex as a cubical complex.

Referenced by main().

◆ swap()

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::swap ( CubicalComplex< TKSpace, TCellContainer > &  other)

Swaps complex other with this. Note that complexes must live in the same space. If one complex is invalid then it is initialized with the space of the other.

Parameters
othera complex living in the same space.

Friends And Related Function Documentation

◆ DGtal::operator!=

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
bool DGtal::operator!= ( const CubicalComplex< K, C > &  ,
const CubicalComplex< K, C > &   
)
friend

◆ DGtal::operator&

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
CubicalComplex< K, C > DGtal::operator& ( const CubicalComplex< K, C > &  ,
const CubicalComplex< K, C > &   
)
friend

◆ DGtal::operator&=

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
CubicalComplex< K, C > & DGtal::operator&= ( CubicalComplex< K, C > &  ,
const CubicalComplex< K, C > &   
)
friend

◆ DGtal::operator*

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
CubicalComplex< K, C > DGtal::operator* ( const CubicalComplex< K, C > &  )
friend

◆ DGtal::operator-

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
CubicalComplex< K, C > DGtal::operator- ( const CubicalComplex< K, C > &  ,
const CubicalComplex< K, C > &   
)
friend

◆ DGtal::operator-=

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
CubicalComplex< K, C > & DGtal::operator-= ( CubicalComplex< K, C > &  ,
const CubicalComplex< K, C > &   
)
friend

◆ DGtal::operator<=

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
bool DGtal::operator<= ( const CubicalComplex< K, C > &  ,
const CubicalComplex< K, C > &   
)
friend

◆ DGtal::operator==

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
bool DGtal::operator== ( const CubicalComplex< K, C > &  ,
const CubicalComplex< K, C > &   
)
friend

◆ DGtal::operator>=

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
bool DGtal::operator>= ( const CubicalComplex< K, C > &  ,
const CubicalComplex< K, C > &   
)
friend

◆ DGtal::operator^

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
CubicalComplex< K, C > DGtal::operator^ ( const CubicalComplex< K, C > &  ,
const CubicalComplex< K, C > &   
)
friend

◆ DGtal::operator^=

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
CubicalComplex< K, C > & DGtal::operator^= ( CubicalComplex< K, C > &  ,
const CubicalComplex< K, C > &   
)
friend

◆ DGtal::operator|

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
CubicalComplex< K, C > DGtal::operator| ( const CubicalComplex< K, C > &  ,
const CubicalComplex< K, C > &   
)
friend

◆ DGtal::operator|=

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
CubicalComplex< K, C > & DGtal::operator|= ( CubicalComplex< K, C > &  ,
const CubicalComplex< K, C > &   
)
friend

◆ DGtal::operator~

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename K , typename C >
CubicalComplex< K, C > DGtal::operator~ ( const CubicalComplex< K, C > &  )
friend

Field Documentation

◆ dimension

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
const Dimension DGtal::CubicalComplex< TKSpace, TCellContainer >::dimension = KSpace::dimension
static

◆ myCells

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
std::vector<CellMap> DGtal::CubicalComplex< TKSpace, TCellContainer >::myCells
protected

An array of map Cell -> Data that stores cells dimension per dimension (i.e. cells of dimension 0 are stored in myCells[0], cells of dimension 1 in myCells[1] and so on).

Definition at line 1301 of file CubicalComplex.h.

Referenced by DGtal::operator!=(), DGtal::operator&(), DGtal::operator&=(), DGtal::operator-(), DGtal::operator-=(), DGtal::operator<=(), DGtal::operator==(), DGtal::operator>=(), DGtal::operator^(), DGtal::operator^=(), DGtal::operator|(), and DGtal::operator|=().

◆ myKSpace

template<typename TKSpace , typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
const KSpace* DGtal::CubicalComplex< TKSpace, TCellContainer >::myKSpace
protected

The Khalimsky space in which lives the cubical complex.

Definition at line 1296 of file CubicalComplex.h.


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