31 #if defined(CubicalComplex_RECURSES)
32 #error Recursive header files inclusion detected in CubicalComplex.h
33 #else // defined(CubicalComplex_RECURSES)
35 #define CubicalComplex_RECURSES
37 #if !defined CubicalComplex_h
39 #define CubicalComplex_h
47 #include <boost/type_traits.hpp>
48 #include <boost/iterator/iterator_facade.hpp>
49 #include "DGtal/base/Common.h"
50 #include "DGtal/base/ConstAlias.h"
51 #include "DGtal/base/Alias.h"
52 #include "DGtal/base/ContainerTraits.h"
53 #include "DGtal/base/CSTLAssociativeContainer.h"
54 #include "DGtal/topology/CCellularGridSpaceND.h"
83 template <
typename TKSpace,
typename TCellContainer >
86 template <
typename TKSpace,
typename TCellContainer >
90 template <
typename TKSpace,
typename TCellContainer >
94 template <
typename TKSpace,
typename TCellContainer >
98 template <
typename TKSpace,
typename TCellContainer >
102 template <
typename TKSpace,
typename TCellContainer >
106 template <
typename TKSpace,
typename TCellContainer >
110 template <
typename TKSpace,
typename TCellContainer >
114 template <
typename TKSpace,
typename TCellContainer >
119 template <
typename TKSpace,
typename TCellContainer >
122 template <
typename TKSpace,
typename TCellContainer >
126 template <
typename TKSpace,
typename TCellContainer >
130 template <
typename TKSpace,
typename TCellContainer >
134 template <
typename TKSpace,
typename TCellContainer >
138 template <
typename TKSpace,
typename TCellContainer >
173 template <
typename TKSpace,
190 template <
typename K,
typename C >
193 template <
typename K,
typename C >
196 template <
typename K,
typename C >
199 template <
typename K,
typename C >
202 template <
typename K,
typename C >
205 template <
typename K,
typename C >
208 template <
typename K,
typename C >
211 template <
typename K,
typename C >
214 template <
typename K,
typename C >
217 template <
typename K,
typename C >
220 template <
typename K,
typename C >
223 template <
typename K,
typename C >
226 template <
typename K,
typename C >
229 template <
typename K,
typename C >
235 typedef typename CellContainer::mapped_type
Data;
238 BOOST_STATIC_ASSERT (( boost::is_same< typename TKSpace::Cell, typename CellContainer::key_type >::value ));
295 uint32_t v1 = it1->second.data & VALUE;
296 uint32_t v2 = it2->second.data & VALUE;
298 || ( ( v1 == v2 ) && ( it1->first < it2->first ) );
307 :
public boost::iterator_facade< ConstIterator, Cell const,
308 std::forward_iterator_tag >
313 std::forward_iterator_tag >
Base;
315 typedef typename Base::value_type
Value;
412 :
public boost::iterator_facade< Iterator, Cell const,
413 std::forward_iterator_tag >
418 std::forward_iterator_tag >
Base;
420 typedef typename Base::value_type
Value;
561 template <
typename TDigitalSet >
562 void construct (
const TDigitalSet & set );
691 std::pair< ConstIterator, ConstIterator >
equal_range(
const Cell& aCell )
const;
746 std::pair< Iterator, bool >
insert(
const Cell& aCell );
764 template <
class InputIterator>
765 void insert( InputIterator first, InputIterator last );
825 template <
typename CellConstIterator>
826 void insertCells( CellConstIterator it, CellConstIterator itE,
const Data& data =
Data() );
839 template <
typename CellConstIterator>
903 template <
typename CellConstIterator>
916 template <
typename CellConstIterator>
933 template <
typename CellOutputIterator>
934 void faces( CellOutputIterator& outIt,
const Cell& aCell,
935 bool hintClosed =
false )
const;
953 template <
typename CellOutputIterator>
955 bool hintClosed =
false )
const;
970 template <
typename CellMapIteratorOutputIterator>
988 template <
typename CellOutputIterator>
989 void coFaces( CellOutputIterator& outIt,
const Cell& aCell,
990 bool hintOpen =
false )
const;
1008 template <
typename CellOutputIterator>
1010 bool hintOpen =
false )
const;
1025 template <
typename CellMapIteratorOutputIterator>
1202 bool hintClosed =
false )
const;
1322 template <
typename TKSpace,
1323 typename TCellContainer >
1337 template <
typename TKSpace,
typename TCellContainer>
1347 #include "DGtal/topology/CubicalComplex.ih"
1352 #endif // !defined CubicalComplex_h
1354 #undef CubicalComplex_RECURSES
1355 #endif // else defined(CubicalComplex_RECURSES)
ConstIterator(ConstAlias< CubicalComplex > cc, Dimension d)
KSpace::Space Space
Type of the digital space.
CellMapConstIterator myIt
BOOST_STATIC_ASSERT(IsPairAssociativeContainer< TCellContainer >::value)
CellMap::iterator CellMapIterator
Iterator for visiting type CellMap.
KForm< Calculus, order, duality > operator-(const KForm< Calculus, order, duality > &form_a, const KForm< Calculus, order, duality > &form_b)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
boost::uint32_t uint32_t
unsigned 32-bit integer.
void swap(CubicalComplex &other)
KSpace::Integer Integer
Type for integers in the space.
std::pair< ConstIterator, ConstIterator > equal_range(const Cell &aCell) const
Cells cellBoundary(const Cell &aCell, bool hintClosed=false) const
void directFacesIterators(CellMapIteratorOutputIterator &outIt, const Cell &aCell)
Cell const & dereference() const
CubicalCellData(uint32_t d)
void coFaces(CellOutputIterator &outIt, const Cell &aCell, bool hintOpen=false) const
const CellMap & getCells(const Dimension d) const
AnyCellCollection< Cell > Cells
bool equal(const Iterator &other) const
SequenceCategory Category
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...
ConstIterator begin() const
bool isCellInterior(const Cell &aCell) const
std::pair< Iterator, bool > insert(const Cell &aCell)
DGtal::uint32_t Dimension
void eraseCells(CellMapIterator it, CellMapIterator itE)
CellMap::const_iterator CellMapConstIterator
Const iterator for visiting type CellMap.
bool operator<=(PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
Comparison operator on Points/Vectors (LesserOrEqualThan).
Iterator()
Default iterator. Invalid.
BOOST_STATIC_CONSTANT(uint32_t, REMOVED=0x10000000)
Flag Used to indicate in a cell data that this cell has been (virtually) removed.
CubicalComplex closure(const CubicalComplex &S, bool hintClosed=false) const
void insertCell(const Cell &aCell, const Data &data=Data())
void faces(CellOutputIterator &outIt, const Cell &aCell, bool hintClosed=false) const
ConstIterator find(const Cell &aCell) const
bool operator!=(PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
Difference operator on Points/Vectors.
CellContainer::mapped_type Data
Type of data associated to each cell.
TCellContainer CellContainer
Type for storing cells, an associative container Cell -> Data.
CellType
Possible cell types within a complex.
boost::iterator_facade< ConstIterator, Cell const, std::forward_iterator_tag > Base
Dimension dimension() const
const KSpace * myKSpace
The Khalimsky space in which lives the cubical complex.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
CellContainer::size_type size_type
void selfDisplay(std::ostream &out) const
void getInteriorAndBoundary(CubicalComplex &intcc, CubicalComplex &bdcc, bool hintClosed=false) const
Size count(const Cell &aCell) const
void directCoFacesIterators(CellMapIteratorOutputIterator &outIt, const Cell &aCell)
CubicalComplex< TKSpace, TCellContainer > & operator-=(CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
CubicalComplex< TKSpace, TCellContainer > & operator&=(CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
void construct(const TDigitalSet &set)
TKSpace KSpace
Type of the cellular grid space.
static const constexpr Dimension dimension
const CubicalComplex * myCC
CubicalComplex< TKSpace, TCellContainer > Self
NumberTraits< Integer >::UnsignedVersion Size
Type used to represent sizes in the digital space.
ConstIterator()
Default iterator. Invalid.
CubicalComplex & operator=(const CubicalComplex &other)
DGtal is the top-level namespace which contains all DGtal functions and types.
CubicalComplex< TKSpace, TCellContainer > operator~(const CubicalComplex< TKSpace, TCellContainer > &)
CubicalComplex interior() const
bool equal(const ConstIterator &other) const
void insertCells(CellConstIterator it, CellConstIterator itE, const Data &data=Data())
KSpace::Cell Cell
Type for a cell in the space.
bool operator>=(PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
Comparison operator on Points/Vectors (GreaterOrEqualThan).
bool belongs(const Cell &aCell) const
CubicalComplex link(const CubicalComplex &S, bool hintClosed=false, bool hintOpen=false) const
Base::reference Reference
Cell::PreCell PreCell
Type for a precell in the space.
CubicalComplex< TKSpace, TCellContainer > & operator|=(CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
CubicalComplex< TKSpace, TCellContainer > operator|(const CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
friend class boost::iterator_core_access
const KSpace & space() const
CellType computeCellType(const Cell &c, CellMapIterator &it_cell_up, Dimension n=dimension)
bool operator()(const CellMapIterator &it1, const CellMapIterator &it2) const
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
Size nbCells(Dimension d) const
Aim: Defines the concept describing an Associative Container of the STL (https://www....
ConstIterator const_iterator
KSpace::Cells Cells
Type for a sequence of cells in the space.
Defines default container traits for arbitrary types.
Base::difference_type DifferenceType
std::vector< CellMap > myCells
KSpace::DirIterator DirIterator
Type for iterating over cell directions.
Data & operator[](const Cell &aCell)
void directCoFaces(CellOutputIterator &outIt, const Cell &aCell, bool hintOpen=false) const
typename PreCellularGridSpace::DirIterator DirIterator
void directFaces(CellOutputIterator &outIt, const Cell &aCell, bool hintClosed=false) const
CubicalComplex< TKSpace, TCellContainer > operator&(const CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
CellMapConstIterator myItEnd
CellContainer CellMap
Type for storing cells, an associative container Cell -> Data.
Iterator(Alias< CubicalComplex > cc, Dimension d, CellMapIterator it)
friend class boost::iterator_core_access
KSpace::Size Size
Type for a number of elements.
Base::difference_type DifferenceType
ConstIterator(ConstAlias< CubicalComplex > cc, Dimension d, CellMapConstIterator it)
CubicalComplex< TKSpace, TCellContainer > & operator^=(CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
Iterator(Alias< CubicalComplex > cc, Dimension d)
Dimension dimension() const
static const Dimension dimension
The dimension of the embedding space.
CubicalComplex boundary(bool hintClosed=false) const
Size eraseCell(const Cell &aCell)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
KForm< Calculus, order, duality > operator*(const typename Calculus::Scalar &scalar, const KForm< Calculus, order, duality > &form)
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
void fillData(Data data=Data())
Cell const & const_reference
CubicalComplex< TKSpace, TCellContainer > operator^(const CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
bool operator==(PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
Equality operator between two Points/Vectors.
KSpace::Point Point
Type for a point in the digital space.
ConstIterator end() const
Cells cellCoBoundary(const Cell &aCell, bool hintOpen=false) const
Aim: This class represents an arbitrary cubical complex living in some Khalimsky space....
boost::iterator_facade< Iterator, Cell const, std::forward_iterator_tag > Base
bool isCellBoundary(const Cell &aCell) const
Cell const * const_pointer
CellMapConstIterator findCell(const Cell &aCell) const
CubicalComplex star(const CubicalComplex &S, bool hintOpen=false) const
Cell const & dereference() const
void erase(Iterator position)
Base::reference Reference
std::string className() const
bool operator()(const Cell &aCell) const
CellContainer::difference_type difference_type