DGtal  1.3.beta
CubicalComplex.h
1 
17 #pragma once
18 
31 #if defined(CubicalComplex_RECURSES)
32 #error Recursive header files inclusion detected in CubicalComplex.h
33 #else // defined(CubicalComplex_RECURSES)
34 
35 #define CubicalComplex_RECURSES
36 
37 #if !defined CubicalComplex_h
38 
39 #define CubicalComplex_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <vector>
45 #include <string>
46 #include <algorithm>
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"
56 
57 namespace DGtal
58 {
59 
76  struct CubicalCellData {
77  inline CubicalCellData() : data( 0 ) {}
78  CubicalCellData( uint32_t d ) : data( d ) {}
80  };
81 
82  // Forward definitions.
83  template < typename TKSpace, typename TCellContainer >
85 
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 >
118 
119  template < typename TKSpace, typename TCellContainer >
122  template < typename TKSpace, typename TCellContainer >
125 
126  template < typename TKSpace, typename TCellContainer >
127  bool
130  template < typename TKSpace, typename TCellContainer >
131  bool
134  template < typename TKSpace, typename TCellContainer >
135  bool
138  template < typename TKSpace, typename TCellContainer >
139  bool
142 
143 
145  // template class CubicalComplex
173  template < typename TKSpace,
174  typename TCellContainer = typename TKSpace::template CellMap< CubicalCellData >::Type >
175  class CubicalComplex
176  {
177  // ----------------------- associated types ------------------------------
178  public:
180 
183 
184  // JOL: Not used, because unordered_set and unordered_map do not pass
185  // these concept checks.
186  // BOOST_CONCEPT_ASSERT(( boost::AssociativeContainer< TCellContainer > ));
187  // BOOST_CONCEPT_ASSERT(( boost::PairAssociativeContainer< TCellContainer > ));
189 
190  template < typename K, typename C >
191  friend CubicalComplex<K,C>&
193  template < typename K, typename C >
194  friend CubicalComplex<K,C>&
196  template < typename K, typename C >
197  friend CubicalComplex<K,C>&
199  template < typename K, typename C >
200  friend CubicalComplex<K,C>&
202  template < typename K, typename C >
203  friend CubicalComplex<K,C>
205  template < typename K, typename C >
206  friend CubicalComplex<K,C>
208  template < typename K, typename C >
209  friend CubicalComplex<K,C>
211  template < typename K, typename C >
212  friend CubicalComplex<K,C>
214  template < typename K, typename C >
215  friend CubicalComplex<K,C>
217  template < typename K, typename C >
218  friend CubicalComplex<K,C>
220  template < typename K, typename C >
221  friend bool
223  template < typename K, typename C >
224  friend bool
226  template < typename K, typename C >
227  friend bool
229  template < typename K, typename C >
230  friend bool
232 
233  typedef TKSpace KSpace;
234  typedef TCellContainer CellContainer;
235  typedef typename CellContainer::mapped_type Data;
236 
237  BOOST_STATIC_ASSERT (( boost::is_base_of< CubicalCellData, Data >::value ));
238  BOOST_STATIC_ASSERT (( boost::is_same< typename TKSpace::Cell, typename CellContainer::key_type >::value ));
239 
240 
243  typedef typename KSpace::Integer Integer;
244  typedef typename KSpace::Cell Cell;
245  typedef typename Cell::PreCell PreCell;
246  typedef typename KSpace::Cells Cells;
247  typedef typename KSpace::Space Space;
248  typedef typename KSpace::Size Size;
249  typedef typename KSpace::Point Point;
250  typedef typename KSpace::DirIterator DirIterator;
252  typedef typename CellMap::const_iterator CellMapConstIterator;
253  typedef typename CellMap::iterator CellMapIterator;
254 
255 
257  enum CellType {
261  };
262 
264  BOOST_STATIC_CONSTANT( uint32_t, REMOVED = 0x10000000 );
266  BOOST_STATIC_CONSTANT( uint32_t, COLLAPSIBLE = 0x20000000 );
268  BOOST_STATIC_CONSTANT( uint32_t, FIXED = 0x40000000 );
270  BOOST_STATIC_CONSTANT( uint32_t, USER1 = 0x80000000 );
272  BOOST_STATIC_CONSTANT( uint32_t, VALUE = 0x0fffffff );
273 
274  // ----------------------- inner types ------------------------------------
275 
283 
293  bool operator()( const CellMapIterator& it1, const CellMapIterator& it2 ) const
294  {
295  uint32_t v1 = it1->second.data & VALUE;
296  uint32_t v2 = it2->second.data & VALUE;
297  return ( v1 < v2 )
298  || ( ( v1 == v2 ) && ( it1->first < it2->first ) );
299  }
300  };
301 
307  : public boost::iterator_facade< ConstIterator, Cell const,
308  std::forward_iterator_tag >
309  {
310  friend class CubicalComplex;
311 
312  typedef boost::iterator_facade< ConstIterator, Cell const,
313  std::forward_iterator_tag > Base;
315  typedef typename Base::value_type Value;
316  typedef typename Base::pointer Pointer;
317  typedef typename Base::reference Reference;
318  typedef typename Base::difference_type DifferenceType;
319 
321  ConstIterator() : myCC( 0 ), myD( 0 ) {}
322 
332  : myCC( &cc ), myD( d )
333  {
334  if ( myD <= myCC->dimension )
335  {
336  myIt = myCC->begin( myD );
337  myItEnd = myCC->end( myD );
338  nextDimension();
339  }
340  else
341  {
342  myD = myCC->dimension + 1;
343  myIt = myCC->end( myCC->dimension );
344  myItEnd = myCC->end( myCC->dimension );
345  }
346  }
347 
357  : myCC( &cc ), myD( d ), myIt( it )
358  {
359  ASSERT( d <= myCC->dimension );
360  myItEnd = myCC->end( d );
361  nextDimension();
362  }
363 
364  private:
366 
368  {
369  while ( myIt == myItEnd )
370  {
371  if ( ++myD > myCC->dimension ) break;
372  myIt = myCC->begin( myD );
373  myItEnd = myCC->end( myD );
374  }
375  }
376 
377  void increment()
378  {
379  ASSERT( myCC != 0 );
380  ++myIt;
381  nextDimension();
382  }
383 
384  bool equal( const ConstIterator& other ) const
385  {
386  return ( myD == other.myD ) && ( myIt == other.myIt );
387  }
388 
389  Cell const& dereference() const
390  {
391  return myIt->first;
392  }
393 
395  {
396  return myD;
397  }
398 
399  private:
404  };
405 
411  struct Iterator
412  : public boost::iterator_facade< Iterator, Cell const,
413  std::forward_iterator_tag >
414  {
415  friend class CubicalComplex;
416 
417  typedef boost::iterator_facade< Iterator, Cell const,
418  std::forward_iterator_tag > Base;
419  typedef Iterator Self;
420  typedef typename Base::value_type Value;
421  typedef typename Base::pointer Pointer;
422  typedef typename Base::reference Reference;
423  typedef typename Base::difference_type DifferenceType;
424 
426  Iterator() : myCC( 0 ), myD( 0 ) {}
427 
436  : myCC( &cc ), myD( d )
437  {
438  if ( myD <= myCC->dimension )
439  {
440  myIt = myCC->begin( myD );
441  myItEnd = myCC->end( myD );
442  nextDimension();
443  }
444  else
445  {
446  myD = myCC->dimension + 1;
447  myIt = myCC->end( myCC->dimension );
448  myItEnd = myCC->end( myCC->dimension );
449  }
450  }
451 
460  CellMapIterator it )
461  : myCC( &cc ), myD( d ), myIt( it )
462  {
463  ASSERT( d <= myCC->dimension );
464  myItEnd = myCC->end( d );
465  nextDimension();
466  }
467 
468  private:
470 
472  {
473  while ( myIt == myItEnd )
474  {
475  if ( ++myD > myCC->dimension ) break;
476  myIt = myCC->begin( myD );
477  myItEnd = myCC->end( myD );
478  }
479  }
480 
481  void increment()
482  {
483  ASSERT( myCC != 0 );
484  ++myIt;
485  nextDimension();
486  }
487 
488  bool equal( const Iterator& other ) const
489  {
490  return ( myD == other.myD ) && ( myIt == other.myIt );
491  }
492 
493  Cell const& dereference() const
494  {
495  return myIt->first;
496  }
497 
499  {
500  return myD;
501  }
502 
503  private:
508  };
509 
510  // ----------------------- STL inner types ------------------------------
511  public:
512 
513  // Renaming for STL-type of iterator.
516  typedef Cell value_type;
517  typedef Cell const& reference;
518  typedef Cell const& const_reference;
519  typedef typename CellContainer::size_type size_type;
520  typedef typename CellContainer::difference_type difference_type;
521  typedef Cell const* pointer;
522  typedef Cell const* const_pointer;
523 
524  // ----------------------- Standard services ------------------------------
525  public:
526 
530  ~CubicalComplex();
531 
532  protected:
538  CubicalComplex();
539  public:
540 
548 
553  CubicalComplex ( const CubicalComplex & other );
554 
561  template < typename TDigitalSet >
562  void construct ( const TDigitalSet & set );
563 
569  CubicalComplex & operator= ( const CubicalComplex & other );
570 
574  void clear();
575 
580  void clear( Dimension d );
581 
588  void fillData( Data data = Data() );
589 
598  void fillData( Dimension d, Data data = Data() );
599 
604  Dimension dim() const;
605 
610  Dimension dim( const Cell& aCell ) const;
611 
616  Size nbCells( Dimension d ) const;
617 
625  Integer euler() const;
626 
630  const KSpace& space() const;
631 
632  // ---------- cell container operations ---------------
633  public:
634 
640  const CellMap & getCells(const Dimension d) const ;
641 
647  CellMap & getCells(const Dimension d) ;
648 
651  ConstIterator begin() const;
652 
655  ConstIterator end() const;
656 
659  Iterator begin();
660 
663  Iterator end();
664 
669  Size count( const Cell& aCell ) const;
670 
672  Size size() const;
673 
676  Size max_size() const;
677 
679  bool empty() const;
680 
691  std::pair< ConstIterator, ConstIterator > equal_range( const Cell& aCell ) const;
692 
703  std::pair< Iterator, Iterator > equal_range( const Cell& aCell );
704 
709  void erase( Iterator position );
710 
716  Size erase( const Cell& aCell );
717 
723  void erase( Iterator first, Iterator last );
724 
729  ConstIterator find( const Cell& aCell ) const;
730 
735  Iterator find( const Cell& aCell );
736 
746  std::pair< Iterator, bool > insert( const Cell& aCell );
747 
755  Iterator insert( Iterator position, const Cell& aCell );
756 
764  template <class InputIterator>
765  void insert( InputIterator first, InputIterator last );
766 
774  void swap( CubicalComplex& other );
775 
776  // ---------- enhanced container operations ---------------
777  public:
778 
786  Data& operator[]( const Cell& aCell );
787 
795  bool operator()( const Cell& aCell ) const;
796 
803  void insertCell( const Cell& aCell, const Data& data = Data() );
804 
813  void insertCell( Dimension d, const Cell& aCell, const Data& data = Data() );
814 
825  template <typename CellConstIterator>
826  void insertCells( CellConstIterator it, CellConstIterator itE, const Data& data = Data() );
827 
839  template <typename CellConstIterator>
840  void insertCells( Dimension d, CellConstIterator it, CellConstIterator itE, const Data& data = Data() );
841 
846  bool belongs( const Cell& aCell ) const;
851  bool belongs( const PreCell& aCell ) const;
852 
858  bool belongs( Dimension d, const Cell& aCell ) const;
864  bool belongs( Dimension d, const PreCell& aCell ) const;
865 
871  Size eraseCell( const Cell& aCell );
872 
879  Size eraseCell( Dimension d, const Cell& aCell );
880 
885  void eraseCell( CellMapIterator it );
886 
893 
903  template <typename CellConstIterator>
904  Size eraseCells( CellConstIterator it, CellConstIterator itE );
905 
916  template <typename CellConstIterator>
917  Size eraseCells( Dimension d, CellConstIterator it, CellConstIterator itE );
918 
933  template <typename CellOutputIterator>
934  void faces( CellOutputIterator& outIt, const Cell& aCell,
935  bool hintClosed = false ) const;
936 
953  template <typename CellOutputIterator>
954  void directFaces( CellOutputIterator& outIt, const Cell& aCell,
955  bool hintClosed = false ) const;
956 
970  template <typename CellMapIteratorOutputIterator>
971  void directFacesIterators( CellMapIteratorOutputIterator& outIt, const Cell& aCell );
972 
988  template <typename CellOutputIterator>
989  void coFaces( CellOutputIterator& outIt, const Cell& aCell,
990  bool hintOpen = false ) const;
991 
1008  template <typename CellOutputIterator>
1009  void directCoFaces( CellOutputIterator& outIt, const Cell& aCell,
1010  bool hintOpen = false ) const;
1011 
1025  template <typename CellMapIteratorOutputIterator>
1026  void directCoFacesIterators( CellMapIteratorOutputIterator& outIt, const Cell& aCell );
1027 
1033 
1038  CellMapConstIterator end( Dimension d ) const;
1039 
1045 
1051 
1056  CellMapConstIterator findCell( const Cell& aCell ) const;
1057 
1063  CellMapConstIterator findCell( Dimension d, const Cell& aCell ) const;
1064 
1069  CellMapIterator findCell( const Cell& aCell );
1070 
1076  CellMapIterator findCell( Dimension d, const Cell& aCell );
1077 
1078  // ---------- local operations for extracting specific subcomplexes -------------
1079  public:
1080 
1098  Cells cellBoundary( const Cell& aCell, bool hintClosed = false ) const;
1099 
1116  Cells cellCoBoundary( const Cell& aCell, bool hintOpen = false ) const;
1117 
1118 
1119  // ---------------------- local properties --------------------------------------
1120  public:
1128  bool isCellInterior( const Cell& aCell ) const;
1129 
1137  bool isCellBoundary( const Cell& aCell ) const;
1138 
1162  CellType computeCellType( const Cell& c, CellMapIterator& it_cell_up,
1163  Dimension n = dimension );
1164 
1165 
1166  // ----------------------- Standard subcomplexes --------------------------------
1167  public:
1168 
1173  CubicalComplex interior() const;
1174 
1186  CubicalComplex boundary( bool hintClosed = false ) const;
1187 
1201  CubicalComplex& bdcc,
1202  bool hintClosed = false ) const;
1203 
1214  CubicalComplex closure( const CubicalComplex& S, bool hintClosed = false ) const;
1215 
1226  CubicalComplex star( const CubicalComplex& S, bool hintOpen = false ) const;
1227 
1242  CubicalComplex link( const CubicalComplex& S, bool hintClosed = false, bool hintOpen = false ) const;
1243 
1244  // ----------------------- global operations on complexes -----------------------
1245  public:
1246 
1250  void close();
1251 
1256  void close( Dimension k );
1257 
1261  void open();
1262 
1267  void open( Dimension k );
1268 
1269 
1270  // ----------------------- Interface --------------------------------------
1271  public:
1272 
1277  void selfDisplay ( std::ostream & out ) const;
1278 
1283  bool isValid() const;
1284 
1285  // --------------- CDrawableWithBoard2D realization ------------------
1286  public:
1290  std::string className() const;
1291 
1292  // ------------------------- Protected Datas ------------------------------
1293  protected:
1294 
1297 
1301  std::vector<CellMap> myCells;
1302 
1303 
1304  // ------------------------- Hidden services ------------------------------
1305  protected:
1306 
1307 
1308  private:
1309 
1310 
1311  // ------------------------- Internals ------------------------------------
1312  private:
1313 
1314 
1315  }; // end of class CubicalComplex
1316 
1322  template < typename TKSpace,
1323  typename TCellContainer >
1324  struct ContainerTraits< CubicalComplex< TKSpace, TCellContainer > >
1325  {
1326  //typedef typename ContainerTraits< TCellContainer >::Category Category;
1328  };
1329 
1330 
1337  template <typename TKSpace, typename TCellContainer>
1338  std::ostream&
1339  operator<< ( std::ostream & out,
1340  const CubicalComplex<TKSpace, TCellContainer> & object );
1341 
1342 } // namespace DGtal
1343 
1344 
1346 // Includes inline functions.
1347 #include "DGtal/topology/CubicalComplex.ih"
1348 
1349 // //
1351 
1352 #endif // !defined CubicalComplex_h
1353 
1354 #undef CubicalComplex_RECURSES
1355 #endif // else defined(CubicalComplex_RECURSES)
DGtal::KhalimskyPreCell< dim, Integer >
DGtal::CubicalComplex::ConstIterator::ConstIterator
ConstIterator(ConstAlias< CubicalComplex > cc, Dimension d)
Definition: CubicalComplex.h:331
DGtal::SequenceCategory
Definition: ContainerTraits.h:66
DGtal::CubicalComplex::Iterator
Definition: CubicalComplex.h:411
DGtal::CubicalComplex::Space
KSpace::Space Space
Type of the digital space.
Definition: CubicalComplex.h:247
DGtal::CubicalComplex::ConstIterator::myIt
CellMapConstIterator myIt
Definition: CubicalComplex.h:402
DGtal::CubicalComplex::BOOST_STATIC_ASSERT
BOOST_STATIC_ASSERT(IsPairAssociativeContainer< TCellContainer >::value)
DGtal::CubicalComplex::clear
void clear()
DGtal::CubicalComplex::Iterator::Self
Iterator Self
Definition: CubicalComplex.h:419
DGtal::CubicalComplex::CellMapIterator
CellMap::iterator CellMapIterator
Iterator for visiting type CellMap.
Definition: CubicalComplex.h:253
DGtal::operator-
KForm< Calculus, order, duality > operator-(const KForm< Calculus, order, duality > &form_a, const KForm< Calculus, order, duality > &form_b)
DGtal::ConstAlias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
DGtal::CubicalComplex::reference
Cell const & reference
Definition: CubicalComplex.h:517
DGtal::CubicalComplex::close
void close()
DGtal::CubicalComplex::Iterator::myCC
CubicalComplex * myCC
Definition: CubicalComplex.h:504
DGtal::uint32_t
boost::uint32_t uint32_t
unsigned 32-bit integer.
Definition: BasicTypes.h:63
DGtal::CubicalComplex::swap
void swap(CubicalComplex &other)
DGtal::CubicalComplex::Iterator::myItEnd
CellMapIterator myItEnd
Definition: CubicalComplex.h:507
DGtal::CubicalComplex::Iterator::myIt
CellMapIterator myIt
Definition: CubicalComplex.h:506
DGtal::CubicalComplex::Integer
KSpace::Integer Integer
Type for integers in the space.
Definition: CubicalComplex.h:243
DGtal::CubicalComplex::equal_range
std::pair< ConstIterator, ConstIterator > equal_range(const Cell &aCell) const
DGtal::CubicalComplex::cellBoundary
Cells cellBoundary(const Cell &aCell, bool hintClosed=false) const
DGtal::CubicalComplex::directFacesIterators
void directFacesIterators(CellMapIteratorOutputIterator &outIt, const Cell &aCell)
DGtal::CubicalComplex::euler
Integer euler() const
DGtal::CubicalComplex::Iterator::dereference
Cell const & dereference() const
Definition: CubicalComplex.h:493
DGtal::CubicalCellData::CubicalCellData
CubicalCellData(uint32_t d)
Definition: CubicalComplex.h:78
DGtal::CubicalComplex::coFaces
void coFaces(CellOutputIterator &outIt, const Cell &aCell, bool hintOpen=false) const
DGtal::CubicalComplex::getCells
const CellMap & getCells(const Dimension d) const
DGtal::KhalimskySpaceND::Cells
AnyCellCollection< Cell > Cells
Definition: KhalimskySpaceND.h:439
DGtal::CubicalComplex::Iterator::equal
bool equal(const Iterator &other) const
Definition: CubicalComplex.h:488
DGtal::ContainerTraits< CubicalComplex< TKSpace, TCellContainer > >::Category
SequenceCategory Category
Definition: CubicalComplex.h:1327
DGtal::concepts::CCellularGridSpaceND
Aim: This concept describes a cellular grid space in nD. In these spaces obtained by cartesian produc...
Definition: CCellularGridSpaceND.h:162
DGtal::CubicalComplex::begin
ConstIterator begin() const
DGtal::CubicalComplex::isCellInterior
bool isCellInterior(const Cell &aCell) const
DGtal::CubicalComplex::insert
std::pair< Iterator, bool > insert(const Cell &aCell)
DGtal::CubicalComplex::Maximal
@ Maximal
Definition: CubicalComplex.h:258
DGtal::Dimension
DGtal::uint32_t Dimension
Definition: Common.h:137
DGtal::CubicalComplex::eraseCells
void eraseCells(CellMapIterator it, CellMapIterator itE)
DGtal::CubicalComplex::CellMapConstIterator
CellMap::const_iterator CellMapConstIterator
Const iterator for visiting type CellMap.
Definition: CubicalComplex.h:252
DGtal::operator<=
bool operator<=(PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
Comparison operator on Points/Vectors (LesserOrEqualThan).
DGtal::CubicalComplex::Iterator::Iterator
Iterator()
Default iterator. Invalid.
Definition: CubicalComplex.h:426
DGtal::CubicalComplex::BOOST_STATIC_CONSTANT
BOOST_STATIC_CONSTANT(uint32_t, REMOVED=0x10000000)
Flag Used to indicate in a cell data that this cell has been (virtually) removed.
DGtal::CubicalComplex::closure
CubicalComplex closure(const CubicalComplex &S, bool hintClosed=false) const
DGtal::CubicalComplex::insertCell
void insertCell(const Cell &aCell, const Data &data=Data())
DGtal::CubicalComplex::faces
void faces(CellOutputIterator &outIt, const Cell &aCell, bool hintClosed=false) const
DGtal::CubicalComplex::find
ConstIterator find(const Cell &aCell) const
DGtal::operator!=
bool operator!=(PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
Difference operator on Points/Vectors.
DGtal::CubicalComplex::Data
CellContainer::mapped_type Data
Type of data associated to each cell.
Definition: CubicalComplex.h:235
DGtal::CubicalComplex::ConstIterator::increment
void increment()
Definition: CubicalComplex.h:377
DGtal::CubicalCellData
Definition: CubicalComplex.h:76
DGtal::CubicalComplex::ConstIterator::nextDimension
void nextDimension()
Definition: CubicalComplex.h:367
DGtal::CubicalComplex::CellContainer
TCellContainer CellContainer
Type for storing cells, an associative container Cell -> Data.
Definition: CubicalComplex.h:234
DGtal::CubicalCellData::data
uint32_t data
Definition: CubicalComplex.h:79
DGtal::CubicalComplex::CellType
CellType
Possible cell types within a complex.
Definition: CubicalComplex.h:257
DGtal::CubicalComplex::ConstIterator::Base
boost::iterator_facade< ConstIterator, Cell const, std::forward_iterator_tag > Base
Definition: CubicalComplex.h:313
DGtal::CubicalComplex::ConstIterator::dimension
Dimension dimension() const
Definition: CubicalComplex.h:394
DGtal::CubicalComplex::myKSpace
const KSpace * myKSpace
The Khalimsky space in which lives the cubical complex.
Definition: CubicalComplex.h:1296
DGtal::CubicalComplex::Iterator::nextDimension
void nextDimension()
Definition: CubicalComplex.h:471
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::CubicalComplex::Iterator::myD
Dimension myD
Definition: CubicalComplex.h:505
DGtal::CubicalComplex::size_type
CellContainer::size_type size_type
Definition: CubicalComplex.h:519
DGtal::SpaceND
Definition: SpaceND.h:95
DGtal::CubicalComplex::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::CubicalComplex::getInteriorAndBoundary
void getInteriorAndBoundary(CubicalComplex &intcc, CubicalComplex &bdcc, bool hintClosed=false) const
DGtal::CubicalComplex::count
Size count(const Cell &aCell) const
DGtal::CubicalComplex::directCoFacesIterators
void directCoFacesIterators(CellMapIteratorOutputIterator &outIt, const Cell &aCell)
DGtal::operator-=
CubicalComplex< TKSpace, TCellContainer > & operator-=(CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
Definition: CubicalComplexFunctions.h:97
DGtal::operator&=
CubicalComplex< TKSpace, TCellContainer > & operator&=(CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
Definition: CubicalComplexFunctions.h:201
DGtal::CubicalComplex::construct
void construct(const TDigitalSet &set)
DGtal::CubicalComplex::Iterator::Pointer
Base::pointer Pointer
Definition: CubicalComplex.h:421
DGtal::CubicalComplex::KSpace
TKSpace KSpace
Type of the cellular grid space.
Definition: CubicalComplex.h:233
DGtal::KhalimskySpaceND::dimension
static const constexpr Dimension dimension
Definition: KhalimskySpaceND.h:430
DGtal::CubicalComplex::CubicalComplex
CubicalComplex()
DGtal::CubicalComplex::ConstIterator::myCC
const CubicalComplex * myCC
Definition: CubicalComplex.h:400
DGtal::CubicalComplex::Self
CubicalComplex< TKSpace, TCellContainer > Self
Definition: CubicalComplex.h:179
DGtal::KhalimskySpaceND::Size
NumberTraits< Integer >::UnsignedVersion Size
Type used to represent sizes in the digital space.
Definition: KhalimskySpaceND.h:407
DGtal::CubicalComplex::ConstIterator::ConstIterator
ConstIterator()
Default iterator. Invalid.
Definition: CubicalComplex.h:321
DGtal::CubicalComplex::operator=
CubicalComplex & operator=(const CubicalComplex &other)
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::operator~
CubicalComplex< TKSpace, TCellContainer > operator~(const CubicalComplex< TKSpace, TCellContainer > &)
Definition: CubicalComplexFunctions.h:61
DGtal::CubicalComplex::interior
CubicalComplex interior() const
DGtal::CubicalComplex::ConstIterator
Definition: CubicalComplex.h:306
DGtal::CubicalComplex::ConstIterator::equal
bool equal(const ConstIterator &other) const
Definition: CubicalComplex.h:384
DGtal::CubicalComplex::Any
@ Any
Definition: CubicalComplex.h:260
DGtal::CubicalComplex::pointer
Cell const * pointer
Definition: CubicalComplex.h:521
DGtal::CubicalComplex::insertCells
void insertCells(CellConstIterator it, CellConstIterator itE, const Data &data=Data())
DGtal::CubicalComplex::Cell
KSpace::Cell Cell
Type for a cell in the space.
Definition: CubicalComplex.h:244
DGtal::operator>=
bool operator>=(PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
Comparison operator on Points/Vectors (GreaterOrEqualThan).
DGtal::CubicalComplex::belongs
bool belongs(const Cell &aCell) const
DGtal::CubicalComplex::Iterator::increment
void increment()
Definition: CubicalComplex.h:481
DGtal::CubicalComplex::link
CubicalComplex link(const CubicalComplex &S, bool hintClosed=false, bool hintOpen=false) const
DGtal::CubicalComplex::ConstIterator::Value
Base::value_type Value
Definition: CubicalComplex.h:315
DGtal::CubicalComplex::Iterator::Reference
Base::reference Reference
Definition: CubicalComplex.h:422
DGtal::CubicalComplex::PreCell
Cell::PreCell PreCell
Type for a precell in the space.
Definition: CubicalComplex.h:245
DGtal::operator|=
CubicalComplex< TKSpace, TCellContainer > & operator|=(CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
Definition: CubicalComplexFunctions.h:160
DGtal::operator|
CubicalComplex< TKSpace, TCellContainer > operator|(const CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
Definition: CubicalComplexFunctions.h:139
DGtal::CubicalComplex::ConstIterator::iterator_core_access
friend class boost::iterator_core_access
Definition: CubicalComplex.h:365
DGtal::CubicalComplex::space
const KSpace & space() const
DGtal::CubicalComplex::computeCellType
CellType computeCellType(const Cell &c, CellMapIterator &it_cell_up, Dimension n=dimension)
DGtal::CubicalComplex::iterator
Iterator iterator
Definition: CubicalComplex.h:515
DGtal::CubicalComplex::DefaultCellMapIteratorPriority::operator()
bool operator()(const CellMapIterator &it1, const CellMapIterator &it2) const
Definition: CubicalComplex.h:293
DGtal::CubicalComplex::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CCellularGridSpaceND< TKSpace >))
DGtal::CubicalComplex::max_size
Size max_size() const
DGtal::CubicalComplex::nbCells
Size nbCells(Dimension d) const
DGtal::concepts::CSTLAssociativeContainer
Aim: Defines the concept describing an Associative Container of the STL (https://www....
Definition: CSTLAssociativeContainer.h:102
DGtal::CubicalCellData::CubicalCellData
CubicalCellData()
Definition: CubicalComplex.h:77
DGtal::CubicalComplex::const_iterator
ConstIterator const_iterator
Definition: CubicalComplex.h:514
DGtal::CubicalComplex::Cells
KSpace::Cells Cells
Type for a sequence of cells in the space.
Definition: CubicalComplex.h:246
DGtal::ContainerTraits
Defines default container traits for arbitrary types.
Definition: ContainerTraits.h:85
DGtal::CubicalComplex::isValid
bool isValid() const
DGtal::CubicalComplex::Free
@ Free
Definition: CubicalComplex.h:259
DGtal::CubicalComplex::ConstIterator::DifferenceType
Base::difference_type DifferenceType
Definition: CubicalComplex.h:318
DGtal::CubicalComplex::myCells
std::vector< CellMap > myCells
Definition: CubicalComplex.h:1301
DGtal::CubicalComplex::~CubicalComplex
~CubicalComplex()
DGtal::CubicalComplex::DirIterator
KSpace::DirIterator DirIterator
Type for iterating over cell directions.
Definition: CubicalComplex.h:250
DGtal::CubicalComplex::operator[]
Data & operator[](const Cell &aCell)
DGtal::CubicalComplex::ConstIterator::Self
ConstIterator Self
Definition: CubicalComplex.h:314
DGtal::CubicalComplex::directCoFaces
void directCoFaces(CellOutputIterator &outIt, const Cell &aCell, bool hintOpen=false) const
DGtal::KhalimskySpaceND::DirIterator
typename PreCellularGridSpace::DirIterator DirIterator
Definition: KhalimskySpaceND.h:422
DGtal::CubicalComplex::directFaces
void directFaces(CellOutputIterator &outIt, const Cell &aCell, bool hintClosed=false) const
DGtal::operator&
CubicalComplex< TKSpace, TCellContainer > operator&(const CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
Definition: CubicalComplexFunctions.h:180
DGtal::CubicalComplex::ConstIterator::myItEnd
CellMapConstIterator myItEnd
Definition: CubicalComplex.h:403
DGtal::CubicalComplex::open
void open()
DGtal::CubicalComplex::value_type
Cell value_type
Definition: CubicalComplex.h:516
DGtal::CubicalComplex::CellMap
CellContainer CellMap
Type for storing cells, an associative container Cell -> Data.
Definition: CubicalComplex.h:251
DGtal::CubicalComplex::Iterator::Iterator
Iterator(Alias< CubicalComplex > cc, Dimension d, CellMapIterator it)
Definition: CubicalComplex.h:459
DGtal::PointVector< dim, Integer >
DGtal::CubicalComplex::Iterator::iterator_core_access
friend class boost::iterator_core_access
Definition: CubicalComplex.h:469
DGtal::CubicalComplex::Size
KSpace::Size Size
Type for a number of elements.
Definition: CubicalComplex.h:248
DGtal::CubicalComplex::Iterator::DifferenceType
Base::difference_type DifferenceType
Definition: CubicalComplex.h:423
DGtal::CubicalComplex::ConstIterator::ConstIterator
ConstIterator(ConstAlias< CubicalComplex > cc, Dimension d, CellMapConstIterator it)
Definition: CubicalComplex.h:355
DGtal::operator^=
CubicalComplex< TKSpace, TCellContainer > & operator^=(CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
Definition: CubicalComplexFunctions.h:245
DGtal::CubicalComplex::Iterator::Iterator
Iterator(Alias< CubicalComplex > cc, Dimension d)
Definition: CubicalComplex.h:435
DGtal::CubicalComplex::empty
bool empty() const
DGtal::CubicalComplex::Iterator::dimension
Dimension dimension() const
Definition: CubicalComplex.h:498
DGtal::CubicalComplex::dimension
static const Dimension dimension
The dimension of the embedding space.
Definition: CubicalComplex.h:242
DGtal::CubicalComplex::boundary
CubicalComplex boundary(bool hintClosed=false) const
DGtal::CubicalComplex::eraseCell
Size eraseCell(const Cell &aCell)
DGtal::Alias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: Alias.h:182
DGtal::operator*
KForm< Calculus, order, duality > operator*(const typename Calculus::Scalar &scalar, const KForm< Calculus, order, duality > &form)
DGtal::CubicalComplex::Iterator::Value
Base::value_type Value
Definition: CubicalComplex.h:420
DGtal::KhalimskySpaceND::Integer
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
Definition: KhalimskySpaceND.h:404
DGtal::CubicalComplex::dim
Dimension dim() const
DGtal::CubicalComplex::fillData
void fillData(Data data=Data())
DGtal::CubicalComplex::const_reference
Cell const & const_reference
Definition: CubicalComplex.h:518
DGtal::operator^
CubicalComplex< TKSpace, TCellContainer > operator^(const CubicalComplex< TKSpace, TCellContainer > &, const CubicalComplex< TKSpace, TCellContainer > &)
Definition: CubicalComplexFunctions.h:222
DGtal::operator==
bool operator==(PointVector< ptDim, LeftEuclideanRing, LeftContainer > const &lhs, PointVector< ptDim, RightEuclideanRing, RightContainer > const &rhs)
Equality operator between two Points/Vectors.
DGtal::CubicalComplex::Point
KSpace::Point Point
Type for a point in the digital space.
Definition: CubicalComplex.h:249
DGtal::CubicalComplex::end
ConstIterator end() const
DGtal::CubicalComplex::cellCoBoundary
Cells cellCoBoundary(const Cell &aCell, bool hintOpen=false) const
DGtal::CubicalComplex
Aim: This class represents an arbitrary cubical complex living in some Khalimsky space....
Definition: CubicalComplex.h:84
DGtal::CubicalComplex::Iterator::Base
boost::iterator_facade< Iterator, Cell const, std::forward_iterator_tag > Base
Definition: CubicalComplex.h:418
DGtal::CubicalComplex::isCellBoundary
bool isCellBoundary(const Cell &aCell) const
DGtal::CubicalComplex::ConstIterator::Pointer
Base::pointer Pointer
Definition: CubicalComplex.h:316
DGtal::CubicalComplex::const_pointer
Cell const * const_pointer
Definition: CubicalComplex.h:522
DGtal::CubicalComplex::findCell
CellMapConstIterator findCell(const Cell &aCell) const
DGtal::IsPairAssociativeContainer
Definition: ContainerTraits.h:377
DGtal::CubicalComplex::DefaultCellMapIteratorPriority
Definition: CubicalComplex.h:282
DGtal::CubicalComplex::star
CubicalComplex star(const CubicalComplex &S, bool hintOpen=false) const
DGtal::CubicalComplex::ConstIterator::dereference
Cell const & dereference() const
Definition: CubicalComplex.h:389
DGtal::CubicalComplex::erase
void erase(Iterator position)
DGtal::CubicalComplex::size
Size size() const
DGtal::KhalimskyCell< dim, Integer >
DGtal::CubicalComplex::ConstIterator::Reference
Base::reference Reference
Definition: CubicalComplex.h:317
DGtal::CubicalComplex::className
std::string className() const
DGtal::CubicalComplex::operator()
bool operator()(const Cell &aCell) const
DGtal::CubicalComplex::difference_type
CellContainer::difference_type difference_type
Definition: CubicalComplex.h:520
DGtal::CubicalComplex::ConstIterator::myD
Dimension myD
Definition: CubicalComplex.h:401