DGtal  0.9.3
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)
39 
40 #define ParDirCollapse_RECURSES
41 
42 #if !defined ParDirCollapse_h
43 
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 
132  void collapseSurface();
133 
140  void collapseIsthmus();
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 
174  bool isNotIncludedInUpperDim ( CellMapConstIterator F );
175 
182  bool isIsthmus ( CellMapConstIterator F );
183 
184  // ------------------------- Hidden services ------------------------------
185 protected:
190  ParDirCollapse();
191 
192 private:
198  ParDirCollapse ( const ParDirCollapse & other );
199 
206  ParDirCollapse & operator= ( const ParDirCollapse & other );
207 
208 
209  // ------------------------- Private Datas --------------------------------
210 private:
211 
213  const KSpace& K;
216 
217 }; // end of class ParDirCollapse
218 
219 } // namespace DGtal
220 
221 
223 // Includes inline functions.
224 #if !defined(BUILD_INLINE)
225 #include "DGtal/topology/ParDirCollapse.ih"
226 #endif
227 
228 
229 // //
231 
232 #endif // !defined ParDirCollapse_h
233 
234 #undef ParDirCollapse_RECURSES
235 #endif // else defined(ParDirCollapse_RECURSES)
BOOST_CONCEPT_ASSERT((boost::Container< CC >))
KSpace::Cells Cells
Type of collection of cells.
CC * complex
Pointer to complex.
ParDirCollapse & operator=(const ParDirCollapse &other)
CC::Point Point
Type of integer point.
TKSpace KSpace
Type of the cellular grid space.
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: Alias.h:182
CellMap::const_iterator CellMapConstIterator
Const iterator for visiting type CellMap.
bool completeFreepair(CellMapConstIterator F, Cell &G, int orient, int dir)
bool isValid() const
void attach(Alias< CC > pComplex)
CC::KSpace KSpace
Any model of concepts::CCellularGridSpaceND, i.e. a type that models a Khalimsky space.
int getDirection(const Cell &F, const Cell &G) const
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.
BOOST_STATIC_ASSERT((CC::KSpace::dimension >=2))
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Implements thinning algorithms in cubical complexes. The implementation supports any model of cu...
KSpace::Cell Cell
Type of cells in Khalimsky space.
int getOrientation(const Cell &F, const Cell &G) const
unsigned int eval(unsigned int iterations)
CC::Size Size
Type of containers size.
bool isIsthmus(CellMapConstIterator F)
bool isNotIncludedInUpperDim(CellMapConstIterator F)
KSpace::Size Size
Type for a number of elements.
const KSpace & K
Reference to Khalimsky space in which a given complex is embedded.
KSpace::Cell Cell
Go to http://www.sgi.com/tech/stl/Container.html.
Definition: Boost.dox:104
CC::CellMapConstIterator CellMapConstIterator
Type of const iterator over a map of cells.