DGtal  1.5.beta
ParDirCollapse.h
1 
17 #pragma once
18 
36 #if defined(ParDirCollapse_RECURSES)
37 #error Recursive header files inclusion detected in ParDirCollapse.h
38 #else // defined(ParDirCollapse_RECURSES)
40 #define ParDirCollapse_RECURSES
41 
42 #if !defined ParDirCollapse_h
44 #define ParDirCollapse_h
45 
47 // Inclusions
48 #include "DGtal/helpers/StdDefs.h"
49 #include "DGtal/base/Common.h"
50 #include "DGtal/kernel/PointVector.h"
51 // Cellular grid
52 #include "DGtal/topology/CubicalComplex.h"
53 #include "DGtal/topology/CubicalComplexFunctions.h"
55 
56 namespace DGtal
57 {
59 // class ParDirCollapse
76 template < typename CC >
78 {
79  BOOST_STATIC_ASSERT(( CC::KSpace::dimension >= 2 ));
81  // ----------------------- Types ------------------------------
82 public:
84  typedef typename CC::KSpace KSpace;
86  typedef typename CC::Point Point;
88  typedef typename CC::Size Size;
90  typedef typename KSpace::Cell Cell;
92  typedef typename KSpace::Cells Cells;
95 
96  // ----------------------- Standard services ------------------------------
101  bool isValid() const;
102 
103  // ----------------------- Interface --------------------------------------
104 public:
109  ParDirCollapse ( const KSpace & k );
110 
117  void attach ( Alias< CC > pComplex );
118 
125  unsigned int eval ( unsigned int iterations );
126 
133 
141 
142  // ------------------------- Internals ------------------------------------
143 private:
149  int getOrientation ( const Cell& F, const Cell& G ) const;
150 
156  int getDirection ( const Cell& F, const Cell& G ) const;
157 
167  bool completeFreepair ( CellMapConstIterator F, Cell& G, int orient, int dir );
168 
175 
183 
184  // ------------------------- Hidden services ------------------------------
185 protected:
191 
192 private:
198  ParDirCollapse ( const ParDirCollapse & other );
199 
207 
208 
209  // ------------------------- Private Datas --------------------------------
210 private:
211 
213  const KSpace& K;
216  // ------------------------- Public Datas --------------------------------
217 public:
218  bool verbose = true;
219 
220 }; // end of class ParDirCollapse
221 
222 } // namespace DGtal
223 
224 
226 // Includes inline functions.
227 #if !defined(BUILD_INLINE)
228 #include "DGtal/topology/ParDirCollapse.ih"
229 #endif
230 
231 
232 // //
234 
235 #endif // !defined ParDirCollapse_h
236 
237 #undef ParDirCollapse_RECURSES
238 #endif // else defined(ParDirCollapse_RECURSES)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: Alias.h:183
Aim: This class represents an arbitrary cubical complex living in some Khalimsky space....
TKSpace KSpace
Type of the cellular grid space.
KSpace::Size Size
Type for a number of elements.
CellMap::const_iterator CellMapConstIterator
Const iterator for visiting type CellMap.
AnyCellCollection< Cell > Cells
Aim: Implements thinning algorithms in cubical complexes. The implementation supports any model of cu...
BOOST_STATIC_ASSERT((CC::KSpace::dimension >=2))
ParDirCollapse(const KSpace &k)
BOOST_CONCEPT_ASSERT((boost::Container< CC >))
CC::KSpace KSpace
Any model of concepts::CCellularGridSpaceND, i.e. a type that models a Khalimsky space.
CC::CellMapConstIterator CellMapConstIterator
Type of const iterator over a map of cells.
CC * complex
Pointer to complex.
void attach(Alias< CC > pComplex)
bool isNotIncludedInUpperDim(CellMapConstIterator F)
KSpace::Cells Cells
Type of collection of cells.
unsigned int eval(unsigned int iterations)
CC::Size Size
Type of containers size.
bool isIsthmus(CellMapConstIterator F)
const KSpace & K
Reference to Khalimsky space in which a given complex is embedded.
bool isValid() const
int getOrientation(const Cell &F, const Cell &G) const
KSpace::Cell Cell
Type of cells in Khalimsky space.
bool completeFreepair(CellMapConstIterator F, Cell &G, int orient, int dir)
ParDirCollapse(const ParDirCollapse &other)
int getDirection(const Cell &F, const Cell &G) const
ParDirCollapse & operator=(const ParDirCollapse &other)
CC::Point Point
Type of integer point.
DGtal is the top-level namespace which contains all DGtal functions and types.
Go to http://www.sgi.com/tech/stl/Container.html.
Definition: Boost.dox:104