32 #include "DGtal/base/Common.h" 33 #include "ConfigTest.h" 34 #include "DGtalCatch.h" 35 #include "DGtal/helpers/StdDefs.h" 37 #include "DGtal/topology/CubicalComplex.h" 38 #include "DGtal/topology/ParDirCollapse.h" 40 #include "DGtal/shapes/GaussDigitizer.h" 41 #include "DGtal/shapes/Shapes.h" 42 #include "DGtal/shapes/EuclideanShapesDecorator.h" 43 #include "DGtal/shapes/parametric/Flower2D.h" 47 using namespace DGtal;
54 template <
typename CC,
typename KSpace>
58 MyEuclideanShape shape( RealPoint( 0.0, 0.0 ), 16, 5, 5, M_PI_2/2. );
61 MyGaussDigitizer digShape;
63 digShape.init ( shape.getLowerBound(), shape.getUpperBound(), 1.0 );
64 Domain domainShape = digShape.getDomain();
65 DigitalSet aSet( domainShape );
75 typedef map<Cell, CubicalCellData>
Map;
81 SECTION(
"Testing the basic algorithm of ParDirCollapse")
83 getComplex< CC, KSpace > ( complex,
K );
84 int eulerBefore = complex.euler();
85 thinning.
attach ( &complex );
87 REQUIRE( (eulerBefore == complex.euler()) );
90 SECTION(
"Testing ParDirCollapse::collapseSurface")
92 getComplex< CC, KSpace > ( complex,
K );
93 int eulerBefore = complex.euler();
94 thinning.
attach ( &complex );
96 REQUIRE( (eulerBefore == complex.euler()) );
98 SECTION(
"Testing ParDirCollapse::collapseIsthmus")
100 getComplex< CC, KSpace > ( complex,
K );
101 int eulerBefore = complex.euler();
102 thinning.
attach ( &complex );
104 REQUIRE( (eulerBefore == complex.euler()) );
std::unordered_map< Cell, CubicalCellData > Map
void getComplex(CC &complex, KSpace &K)
const Point & upperBound() const
void construct(const TDigitalSet &set)
void attach(const EuclideanShape &shape)
Aim: Model of the concept StarShaped represents any flower with k-petals in the plane.
void attach(Alias< CC > pComplex)
REQUIRE(domain.isInside(aPoint))
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.
TEST_CASE("Testing ParDirCollapse")
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...
unsigned int eval(unsigned int iterations)
CubicalComplex< KSpace, Map > CC
const Point & lowerBound() const
Aim: A utility class for constructing different shapes (balls, diamonds, and others).
SECTION("Testing constant forward iterators")