DGtal  0.9.3beta
Data Structures | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | Friends
DGtal::CubicalComplex< TKSpace, TCellContainer > Class Template Reference

#include <DGtal/topology/CubicalComplex.h>

Collaboration diagram for DGtal::CubicalComplex< TKSpace, TCellContainer >:
[legend]

Data Structures

struct  ConstIterator
 
struct  DefaultCellMapIteratorPriority
 
struct  Iterator
 

Public Types

enum  CellType { Maximal, Free, Any }
 
typedef CubicalComplex< TKSpace, TCellContainer > Self
 
typedef TKSpace KSpace
 
typedef TCellContainer CellContainer
 
typedef CellContainer::mapped_type Data
 
typedef KSpace::Integer Integer
 
typedef KSpace::Cell Cell
 
typedef KSpace::Cells Cells
 
typedef KSpace::Space Space
 
typedef KSpace::Size Size
 
typedef KSpace::Point Point
 
typedef KSpace::DirIterator DirIterator
 
typedef CellContainer CellMap
 
typedef CellMap::const_iterator CellMapConstIterator
 
typedef CellMap::iterator CellMapIterator
 
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)
 
 BOOST_STATIC_CONSTANT (uint32_t, COLLAPSIBLE=0x20000000)
 
 BOOST_STATIC_CONSTANT (uint32_t, FIXED=0x40000000)
 
 BOOST_STATIC_CONSTANT (uint32_t, USER1=0x80000000)
 
 BOOST_STATIC_CONSTANT (uint32_t, VALUE=0x0fffffff)
 
 ~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
 
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 (Dimension d, const Cell &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
 

Protected Member Functions

 CubicalComplex ()
 

Protected Attributes

const KSpacemyKSpace
 

Private Attributes

std::vector< CellMapmyCells
 

Friends

SelfDGtal::functions::operator|= (Self &, const Self &)
 
SelfDGtal::functions::operator&= (Self &, const Self &)
 
SelfDGtal::functions::operator^= (Self &, const Self &)
 
SelfDGtal::functions::operator-= (Self &, const Self &)
 
Self DGtal::functions::operator| (const Self &, const Self &)
 
Self DGtal::functions::operator& (const Self &, const Self &)
 
Self DGtal::functions::operator^ (const Self &, const Self &)
 
Self DGtal::functions::operator- (const Self &, const Self &)
 
Self DGtal::functions::operator~ (const Self &)
 
Self DGtal::functions::operator* (const Self &)
 
bool DGtal::functions::operator== (const Self &, const Self &)
 
bool DGtal::functions::operator!= (const Self &, const Self &)
 
bool DGtal::functions::operator<= (const Self &, const Self &)
 
bool DGtal::functions::operator>= (const Self &, const Self &)
 

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 84 of file CubicalComplex.h.

Member Typedef Documentation

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 218 of file CubicalComplex.h.

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 208 of file CubicalComplex.h.

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 224 of file CubicalComplex.h.

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 225 of file CubicalComplex.h.

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 226 of file CubicalComplex.h.

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 219 of file CubicalComplex.h.

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

Definition at line 487 of file CubicalComplex.h.

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

Definition at line 495 of file CubicalComplex.h.

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

Definition at line 491 of file CubicalComplex.h.

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 209 of file CubicalComplex.h.

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

Definition at line 493 of file CubicalComplex.h.

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 223 of file CubicalComplex.h.

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 217 of file CubicalComplex.h.

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

Definition at line 488 of file CubicalComplex.h.

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 207 of file CubicalComplex.h.

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 222 of file CubicalComplex.h.

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

Definition at line 494 of file CubicalComplex.h.

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

Definition at line 490 of file CubicalComplex.h.

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

Definition at line 181 of file CubicalComplex.h.

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 221 of file CubicalComplex.h.

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

Definition at line 492 of file CubicalComplex.h.

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 220 of file CubicalComplex.h.

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

Definition at line 489 of file CubicalComplex.h.

Member Enumeration Documentation

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 230 of file CubicalComplex.h.

Constructor & Destructor Documentation

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

Destructor.

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.

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.
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. Forbidden by default.

Member Function Documentation

template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
ConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::begin ( ) const
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).
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.
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.
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.
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.
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CCellularGridSpaceND< TKSpace >)  )
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_CONCEPT_ASSERT ( (concepts::CSTLAssociativeContainer< TCellContainer >)  )
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_ASSERT ( IsPairAssociativeContainer< TCellContainer >::value  )
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)  )
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)  )
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.

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.

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.

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.

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.

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.
Examples:
topology/cubical-complex-illustrations.cpp.
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.
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.
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.
Examples:
topology/cubical-complex-illustrations.cpp.
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::clear ( )

Clears the cubical complex, which becomes empty.

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.
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::close ( )

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

Examples:
topology/cubical-complex-illustrations.cpp.

Referenced by DGtal::functions::operator~().

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.
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.
Examples:
topology/cubical-complex-illustrations.cpp.
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.
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.
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
template<typename TDigitalSet >
void DGtal::CubicalComplex< TKSpace, TCellContainer >::construct ( const TDigitalSet &  set)

Constructor a complex from a digital set.

Parameters
set- a digital set from which to create a complex. Set has to be of the same dimension as a Khalimsky space.
Examples:
topology/digitalSetToCubicalComplexes2D.cpp.
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).
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.
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.
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.
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.
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.
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.
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.
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
ConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::end ( ) const
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).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 ) - ...
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.
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.
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.
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.
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.
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 ) )
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 )
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 ) )
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 )
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.
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.
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.
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.
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.
Examples:
topology/cubical-complex-illustrations.cpp.
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.
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.
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.
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.
Examples:
topology/cubical-complex-illustrations.cpp.
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.
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.
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.
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.
Examples:
topology/cubical-complex-illustrations.cpp.
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).
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.
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
void DGtal::CubicalComplex< TKSpace, TCellContainer >::open ( )

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

Referenced by DGtal::functions::operator*().

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.
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.
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'. Forbidden by default.
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.
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.
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.
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::functions::operator!=(), DGtal::functions::operator==(), and DGtal::functions::operator>=().

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.
Examples:
topology/cubical-complex-illustrations.cpp.
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

template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::functions::operator!= ( const Self ,
const Self  
)
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Self DGtal::functions::operator& ( const Self ,
const Self  
)
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Self& DGtal::functions::operator&= ( Self ,
const Self  
)
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Self DGtal::functions::operator* ( const Self )
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Self DGtal::functions::operator- ( const Self ,
const Self  
)
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Self& DGtal::functions::operator-= ( Self ,
const Self  
)
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::functions::operator<= ( const Self ,
const Self  
)
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::functions::operator== ( const Self ,
const Self  
)
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
bool DGtal::functions::operator>= ( const Self ,
const Self  
)
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Self DGtal::functions::operator^ ( const Self ,
const Self  
)
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Self& DGtal::functions::operator^= ( Self ,
const Self  
)
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Self DGtal::functions::operator| ( const Self ,
const Self  
)
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Self& DGtal::functions::operator|= ( Self ,
const Self  
)
friend
template<typename TKSpace, typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type>
Self DGtal::functions::operator~ ( const Self )
friend

Field Documentation

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

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 1253 of file CubicalComplex.h.

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

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 1245 of file CubicalComplex.h.


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