DGtal 1.3.0
|
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>
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) |
CubicalComplex & | operator= (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 KSpace & | space () const |
const CellMap & | getCells (const Dimension d) const |
CellMap & | getCells (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, ConstIterator > | equal_range (const Cell &aCell) const |
std::pair< Iterator, Iterator > | equal_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) |
Data & | operator[] (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 KSpace * | myKSpace |
The Khalimsky space in which lives the cubical complex. More... | |
std::vector< CellMap > | myCells |
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 > &) |
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.
TKSpace | any model of concepts::CCellularGridSpaceND, i.e. a type that models a Khalimsky space. |
TCellContainer | any 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. |
Definition at line 175 of file CubicalComplex.h.
typedef KSpace::Cell DGtal::CubicalComplex< TKSpace, TCellContainer >::Cell |
Type for a cell in the space.
Definition at line 244 of file CubicalComplex.h.
typedef TCellContainer DGtal::CubicalComplex< TKSpace, TCellContainer >::CellContainer |
Type for storing cells, an associative container Cell -> Data.
Definition at line 234 of file CubicalComplex.h.
typedef CellContainer DGtal::CubicalComplex< TKSpace, TCellContainer >::CellMap |
Type for storing cells, an associative container Cell -> Data.
Definition at line 251 of file CubicalComplex.h.
typedef CellMap::const_iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::CellMapConstIterator |
Const iterator for visiting type CellMap.
Definition at line 252 of file CubicalComplex.h.
typedef CellMap::iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::CellMapIterator |
Iterator for visiting type CellMap.
Definition at line 253 of file CubicalComplex.h.
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.
typedef ConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::const_iterator |
Definition at line 514 of file CubicalComplex.h.
typedef Cell const* DGtal::CubicalComplex< TKSpace, TCellContainer >::const_pointer |
Definition at line 522 of file CubicalComplex.h.
typedef Cell const& DGtal::CubicalComplex< TKSpace, TCellContainer >::const_reference |
Definition at line 518 of file CubicalComplex.h.
typedef CellContainer::mapped_type DGtal::CubicalComplex< TKSpace, TCellContainer >::Data |
Type of data associated to each cell.
Definition at line 235 of file CubicalComplex.h.
typedef CellContainer::difference_type DGtal::CubicalComplex< TKSpace, TCellContainer >::difference_type |
Definition at line 520 of file CubicalComplex.h.
typedef KSpace::DirIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::DirIterator |
Type for iterating over cell directions.
Definition at line 250 of file CubicalComplex.h.
typedef KSpace::Integer DGtal::CubicalComplex< TKSpace, TCellContainer >::Integer |
Type for integers in the space.
Definition at line 243 of file CubicalComplex.h.
typedef Iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::iterator |
Definition at line 515 of file CubicalComplex.h.
typedef TKSpace DGtal::CubicalComplex< TKSpace, TCellContainer >::KSpace |
Type of the cellular grid space.
Definition at line 233 of file CubicalComplex.h.
typedef KSpace::Point DGtal::CubicalComplex< TKSpace, TCellContainer >::Point |
Type for a point in the digital space.
Definition at line 249 of file CubicalComplex.h.
typedef Cell const* DGtal::CubicalComplex< TKSpace, TCellContainer >::pointer |
Definition at line 521 of file CubicalComplex.h.
typedef Cell::PreCell DGtal::CubicalComplex< TKSpace, TCellContainer >::PreCell |
Type for a precell in the space.
Definition at line 245 of file CubicalComplex.h.
typedef Cell const& DGtal::CubicalComplex< TKSpace, TCellContainer >::reference |
Definition at line 517 of file CubicalComplex.h.
typedef CubicalComplex< TKSpace, TCellContainer > DGtal::CubicalComplex< TKSpace, TCellContainer >::Self |
Definition at line 179 of file CubicalComplex.h.
typedef KSpace::Size DGtal::CubicalComplex< TKSpace, TCellContainer >::Size |
Type for a number of elements.
Definition at line 248 of file CubicalComplex.h.
typedef CellContainer::size_type DGtal::CubicalComplex< TKSpace, TCellContainer >::size_type |
Definition at line 519 of file CubicalComplex.h.
typedef KSpace::Space DGtal::CubicalComplex< TKSpace, TCellContainer >::Space |
Type of the digital space.
Definition at line 247 of file CubicalComplex.h.
typedef Cell DGtal::CubicalComplex< TKSpace, TCellContainer >::value_type |
Definition at line 516 of file CubicalComplex.h.
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.
DGtal::CubicalComplex< TKSpace, TCellContainer >::~CubicalComplex | ( | ) |
Destructor.
|
protected |
Constructor. The cubical complex is not valid. A user may not instantiate an empty CubicalComplex, because it needs the Khalimsky space.
DGtal::CubicalComplex< TKSpace, TCellContainer >::CubicalComplex | ( | ConstAlias< KSpace > | aK | ) |
Constructor of empty complex. Needs a space to represents cubical cells.
aK | a Khalimsky space. |
DGtal::CubicalComplex< TKSpace, TCellContainer >::CubicalComplex | ( | const CubicalComplex< TKSpace, TCellContainer > & | other | ) |
Copy constructor.
other | the object to clone. |
Iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::begin | ( | ) |
ConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::begin | ( | ) | const |
Referenced by DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::ConstIterator(), drawComplex(), GIVEN(), DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::Iterator(), main(), DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::nextDimension(), DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::nextDimension(), and SCENARIO().
CellMapIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::begin | ( | Dimension | d | ) |
d | any valid dimension. |
CellMapConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::begin | ( | Dimension | d | ) | const |
d | any valid dimension. |
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::belongs | ( | const Cell & | aCell | ) | const |
aCell | any cell valid in the Khalimsky space associated to the complex. |
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::belongs | ( | const PreCell & | aCell | ) | const |
aCell | any pre-cell valid in the Khalimsky space associated to the complex. |
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::belongs | ( | Dimension | d, |
const Cell & | aCell | ||
) | const |
d | the dimension of cell aCell. |
aCell | any cell valid in the Khalimsky space associated to the complex. |
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::belongs | ( | Dimension | d, |
const PreCell & | aCell | ||
) | const |
d | the dimension of cell aCell. |
aCell | any precell valid in the Khalimsky space associated to the complex. |
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_CONCEPT_ASSERT | ( | (concepts::CCellularGridSpaceND< TKSpace >) | ) |
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_CONCEPT_ASSERT | ( | (concepts::CSTLAssociativeContainer< TCellContainer >) | ) |
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_ASSERT | ( | (boost::is_base_of< CubicalCellData, Data >::value) | ) |
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_ASSERT | ( | (boost::is_same< typename TKSpace::Cell, typename CellContainer::key_type >::value) | ) |
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_ASSERT | ( | IsPairAssociativeContainer< TCellContainer >::value | ) |
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_CONSTANT | ( | uint32_t | , |
COLLAPSIBLE | = 0x20000000 |
||
) |
Flag Used to indicate in a cell data that this cell is collapsible.
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_CONSTANT | ( | uint32_t | , |
FIXED | = 0x40000000 |
||
) |
Flag Used to indicate in a cell data that this cell is fixed.
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.
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_CONSTANT | ( | uint32_t | , |
USER1 | = 0x80000000 |
||
) |
User flag for a cell.
DGtal::CubicalComplex< TKSpace, TCellContainer >::BOOST_STATIC_CONSTANT | ( | uint32_t | , |
VALUE | = 0x0fffffff |
||
) |
Value for a cell.
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).
hintClosed | when 'true', this hint tells that the complex is closed, so this speeds up this method, otherwise, the complex may be arbitrary. |
Referenced by main(), and SCENARIO().
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.
aCell | any cell valid in the Khalimsky space associated to the complex. |
hintClosed | when 'true', this hint tells that the complex is (locally) closed, so this speeds up this method, otherwise, the complex may be arbitrary. |
Referenced by GIVEN().
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.
aCell | any cell valid in the Khalimsky space associated to the complex. |
hintOpen | when 'true', this hint tells that the complex is (locally) open, so this speeds up this method, otherwise, the complex may be arbitrary. |
std::string DGtal::CubicalComplex< TKSpace, TCellContainer >::className | ( | ) | const |
Referenced by main().
void DGtal::CubicalComplex< TKSpace, TCellContainer >::clear | ( | ) |
Clears the cubical complex, which becomes empty.
Referenced by getComplex().
void DGtal::CubicalComplex< TKSpace, TCellContainer >::clear | ( | Dimension | d | ) |
Clears all cells of dimension d of the cubical complex.
d | the dimension of cell aCell. |
void DGtal::CubicalComplex< TKSpace, TCellContainer >::close | ( | ) |
Close the whole complex (see also DGtal::operator~).
Referenced by GIVEN(), main(), DGtal::operator~(), and SCENARIO().
void DGtal::CubicalComplex< TKSpace, TCellContainer >::close | ( | Dimension | k | ) |
Close all cells of dimension less or equal to k.
k | any strictly positive integer. |
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.
S | any complex the cells of which belong to this complex. |
hintClosed | when 'true', this hint tells that the complex is (locally around S) closed, so this speeds up this method, otherwise, the complex may be arbitrary. |
Referenced by main().
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.
outIt | the output iterator on Cell that is used for outputing faces. |
aCell | any cell valid in the Khalimsky space associated to the complex. |
hintOpen | when 'true', this hint tells that the complex is open, so this speeds up this method, otherwise, the complex may be arbitrary. |
CellOutputIterator | any model of boost::OutputIterator, with value_type Cell. |
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.
[in] | c | a 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] | n | the 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. |
void DGtal::CubicalComplex< TKSpace, TCellContainer >::construct | ( | const TDigitalSet & | set | ) |
Construct a complex from a digital set.
TDigitalSet | either kind of DigitalSet |
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().
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::count | ( | const Cell & | aCell | ) | const |
aCell | any cell. |
Dimension DGtal::CubicalComplex< TKSpace, TCellContainer >::dim | ( | ) | const |
Dimension DGtal::CubicalComplex< TKSpace, TCellContainer >::dim | ( | const Cell & | aCell | ) | const |
aCell | any cell valid in the Khalimsky space associated to the complex. |
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).
outIt | the output iterator on Cell that is used for outputing faces. |
aCell | any cell valid in the Khalimsky space associated to the complex. |
hintOpen | when 'true', this hint tells that the complex is open, so this speeds up this method, otherwise, the complex may be arbitrary. |
CellOutputIterator | any model of boost::OutputIterator, with value_type Cell. |
Referenced by GIVEN().
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).
outIt | the output iterator on CellMapIterator that is used for outputing face iterators. |
aCell | any cell valid in the Khalimsky space associated to the complex. |
CellMapIteratorOutputIterator | any model of boost::OutputIterator, with value_type CellMapIterator. |
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).
outIt | the output iterator on Cell that is used for outputing faces. |
aCell | any cell valid in the Khalimsky space associated to the complex. |
hintClosed | when 'true', this hint tells that the complex is closed, so this speeds up this method, otherwise, the complex may be arbitrary. |
CellOutputIterator | any model of boost::OutputIterator, with value_type Cell. |
Referenced by GIVEN().
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).
outIt | the output iterator on CellMapIterator that is used for outputing face iterators. |
aCell | any cell valid in the Khalimsky space associated to the complex. |
CellMapIteratorOutputIterator | any model of boost::OutputIterator, with value_type CellMapIterator. |
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::empty | ( | ) | const |
Iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::end | ( | ) |
ConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::end | ( | ) | const |
Referenced by DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::ConstIterator(), drawComplex(), GIVEN(), DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::Iterator(), main(), DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::nextDimension(), DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::nextDimension(), and SCENARIO().
CellMapIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::end | ( | Dimension | d | ) |
d | any valid dimension. |
CellMapConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::end | ( | Dimension | d | ) | const |
d | any valid dimension. |
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.
aCell | any cell. |
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.
aCell | any cell. |
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::erase | ( | const Cell & | aCell | ) |
Erases cell aCell from the complex (STL version, see eraseCell).
aCell | any cell valid in the Khalimsky space associated to the complex. |
void DGtal::CubicalComplex< TKSpace, TCellContainer >::erase | ( | Iterator | first, |
Iterator | last | ||
) |
Erases range of cells [first, last ).
first | an iterator on the beginning of a range of cells within this complex. |
last | an iterator on the end of a range of cells within this complex. |
void DGtal::CubicalComplex< TKSpace, TCellContainer >::erase | ( | Iterator | position | ) |
Erase element pointed by iterator it.
position | any iterator on a valid cell. |
void DGtal::CubicalComplex< TKSpace, TCellContainer >::eraseCell | ( | CellMapIterator | it | ) |
Erases cell pointed by iterator it.
it | any valid iterator on a cell of this complex. |
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::eraseCell | ( | const Cell & | aCell | ) |
Erases cell aCell from the complex.
aCell | any cell valid in the Khalimsky space associated to the complex. |
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::eraseCell | ( | Dimension | d, |
const Cell & | aCell | ||
) |
Erases cell aCell from the complex.
d | the dimension of cell aCell. |
aCell | any cell valid in the Khalimsky space associated to the complex. |
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::eraseCells | ( | CellConstIterator | it, |
CellConstIterator | itE | ||
) |
Erases the cells stored in range [it,itE) from the CubicalComplex.
it | an iterator pointing at the beginning of a range of (arbitrary) cells. |
itE | an iterator pointing after the end of a range of (arbitrary) cells. |
CellConstIterator | any model of a forward const iterator on Cell. |
void DGtal::CubicalComplex< TKSpace, TCellContainer >::eraseCells | ( | CellMapIterator | it, |
CellMapIterator | itE | ||
) |
Erases cells in range [it, itE).
it | any valid iterator on the first element of range of cells of this complex. |
itE | any valid iterator after the last element of range of cells of this complex. |
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.
d | the dimension of every cell in range [it,itE). |
it | an iterator pointing at the beginning of a range of (arbitrary) cells. |
itE | an iterator pointing after the end of a range of (arbitrary) cells. |
CellConstIterator | any model of a forward const iterator on Cell. |
Integer DGtal::CubicalComplex< TKSpace, TCellContainer >::euler | ( | ) | const |
Referenced by SCENARIO(), and TEST_CASE().
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.
outIt | the output iterator on Cell that is used for outputing faces. |
aCell | any cell valid in the Khalimsky space associated to the complex. |
hintClosed | when 'true', this hint tells that the complex is closed, so this speeds up this method, otherwise, the complex may be arbitrary. |
CellOutputIterator | any model of boost::OutputIterator, with value_type Cell. |
Referenced by GIVEN().
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.
data | any data. |
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.
d | the dimension of cell aCell. |
data | any data. |
Iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::find | ( | const Cell & | aCell | ) |
aCell | any cell valid in the Khalimsky space associated to the complex. |
ConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::find | ( | const Cell & | aCell | ) | const |
aCell | any cell valid in the Khalimsky space associated to the complex. |
CellMapIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::findCell | ( | const Cell & | aCell | ) |
aCell | any cell valid in the Khalimsky space associated to the complex. |
CellMapConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::findCell | ( | const Cell & | aCell | ) | const |
aCell | any cell valid in the Khalimsky space associated to the complex. |
Referenced by SCENARIO().
CellMapIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::findCell | ( | Dimension | d, |
const Cell & | aCell | ||
) |
d | the dimension of cell aCell. |
aCell | any cell valid in the Khalimsky space associated to the complex. |
CellMapConstIterator DGtal::CubicalComplex< TKSpace, TCellContainer >::findCell | ( | Dimension | d, |
const Cell & | aCell | ||
) | const |
d | the dimension of cell aCell. |
aCell | any cell valid in the Khalimsky space associated to the complex. |
CellMap & DGtal::CubicalComplex< TKSpace, TCellContainer >::getCells | ( | const Dimension | d | ) |
d | input Dimension |
const CellMap & DGtal::CubicalComplex< TKSpace, TCellContainer >::getCells | ( | const Dimension | d | ) | const |
d | input Dimension |
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.
[out] | intcc | returns the interior subcomplex of this complex. |
[out] | bdcc | returns the boundary of this complex. |
hintClosed | when 'true', this hint tells that the complex is closed, so this speeds up this method, otherwise, the complex may be arbitrary. |
std::pair< Iterator, bool > DGtal::CubicalComplex< TKSpace, TCellContainer >::insert | ( | const Cell & | aCell | ) |
Insert element aCell into the complex.
aCell | any cell valid in the Khalimsky space associated to the complex. |
Referenced by SCENARIO().
void DGtal::CubicalComplex< TKSpace, TCellContainer >::insert | ( | InputIterator | first, |
InputIterator | last | ||
) |
Insert a range of cells [first, last).
InputIterator | any model of boost::InputIterator where elements are Cell. |
first | the beginning of the range. |
last | the end of the range. |
Iterator DGtal::CubicalComplex< TKSpace, TCellContainer >::insert | ( | Iterator | position, |
const Cell & | aCell | ||
) |
Insert element aCell into the complex with possible hint given by position.
aCell | any cell valid in the Khalimsky space associated to the complex. |
position | an hint for the position where the element can be inserted. |
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.
aCell | any cell valid in the Khalimsky space associated to the complex. |
data | any value. |
Referenced by GIVEN(), main(), and SCENARIO().
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.
d | the dimension of cell aCell. |
aCell | any cell valid in the Khalimsky space associated to the complex. |
data | any value. |
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.
it | an iterator pointing at the beginning of a range of (arbitrary) cells. |
itE | an iterator pointing after the end of a range of (arbitrary) cells. |
data | any value. |
CellConstIterator | any model of a forward const iterator on Cell. |
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.
d | the dimension of all cells in the range [it,itE). |
it | an iterator pointing at the beginning of a range of (arbitrary) cells. |
itE | an iterator pointing after the end of a range of (arbitrary) cells. |
data | any value. |
CellConstIterator | any model of a forward const iterator on Cell. |
CubicalComplex DGtal::CubicalComplex< TKSpace, TCellContainer >::interior | ( | ) | const |
Computes the (topological) interior to this complex.
Referenced by main().
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::isCellBoundary | ( | const Cell & | aCell | ) | const |
aCell | any cell valid in the Khalimsky space associated to the complex. |
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::isCellInterior | ( | const Cell & | aCell | ) | const |
aCell | any cell valid in the Khalimsky space associated to the complex. |
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
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.
S | any complex the cells of which belong to this complex. |
hintClosed | when 'true', this hint tells that the complex is (locally around S) closed, so this speeds up this method, otherwise, the complex may be arbitrary. |
hintOpen | when 'true', this hint tells that the complex is (locally around S) open, so this speeds up this method, otherwise, the complex may be arbitrary. |
Referenced by main(), and SCENARIO().
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::max_size | ( | ) | const |
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::nbCells | ( | Dimension | d | ) | const |
d | the dimension of cells. |
Referenced by GIVEN(), and SCENARIO().
void DGtal::CubicalComplex< TKSpace, TCellContainer >::open | ( | ) |
Open the whole complex (see also DGtal::operator*).
Referenced by DGtal::operator*().
void DGtal::CubicalComplex< TKSpace, TCellContainer >::open | ( | Dimension | k | ) |
Open all cells of dimension less or or equal to k.
k | any strictly positive integer. |
bool DGtal::CubicalComplex< TKSpace, TCellContainer >::operator() | ( | const Cell & | aCell | ) | const |
Makes CubicalComplex a functor Cell -> boolean, which represents the characteristic cell function.
aCell | any cell valid in the Khalimsky space associated to the complex. |
CubicalComplex & DGtal::CubicalComplex< TKSpace, TCellContainer >::operator= | ( | const CubicalComplex< TKSpace, TCellContainer > & | other | ) |
Assignment.
other | the object to copy. |
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.
aCell | any cell valid in the Khalimsky space associated to the complex. |
void DGtal::CubicalComplex< TKSpace, TCellContainer >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Size DGtal::CubicalComplex< TKSpace, TCellContainer >::size | ( | ) | const |
Referenced by SCENARIO().
const KSpace & DGtal::CubicalComplex< TKSpace, TCellContainer >::space | ( | ) | const |
Referenced by DGtal::operator!=(), DGtal::operator<=(), DGtal::operator==(), and DGtal::operator>=().
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.
S | any complex the cells of which belong to this complex. |
hintOpen | when 'true', this hint tells that the complex is (locally around S) open, so this speeds up this method, otherwise, the complex may be arbitrary. |
Referenced by main().
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.
other | a complex living in the same space. |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
static |
The dimension of the embedding space.
Definition at line 242 of file CubicalComplex.h.
Referenced by DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::ConstIterator(), DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::Iterator(), DGtal::CubicalComplex< TKSpace, TCellContainer >::ConstIterator::nextDimension(), DGtal::CubicalComplex< TKSpace, TCellContainer >::Iterator::nextDimension(), 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|=().
|
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|=().
|
protected |
The Khalimsky space in which lives the cubical complex.
Definition at line 1296 of file CubicalComplex.h.