Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
testDigitalSetToCellularGridConverter.cpp
Go to the documentation of this file.
1
16
29
31#include <iostream>
32#include <map>
33#include "DGtal/base/Common.h"
34#include "ConfigTest.h"
35#include "DGtal/helpers/StdDefs.h"
36// Cellular grid converter
37#include "DGtal/topology/CubicalComplex.h"
38// Shape construction
39#include "DGtal/shapes/GaussDigitizer.h"
40#include "DGtal/shapes/Shapes.h"
41#include "DGtal/shapes/EuclideanShapesDecorator.h"
42#include "DGtal/shapes/parametric/Flower2D.h"
44
45using namespace std;
46using namespace DGtal;
47using namespace functors;
48using namespace Z2i;
49
51// Functions for testing class digitalSetToCubicalComplexes.
54{
56 typedef map<Cell, CubicalCellData> Map;
59private:
62public:
65 {
66 MyEuclideanShape shape( RealPoint( 0.0, 0.0 ), 16, 5, 5, M_PI_2/2. );
67 digShape.attach( shape );
68 digShape.init ( shape.getLowerBound(), shape.getUpperBound(), 1.0 );
69 Domain domainShape = digShape.getDomain();
70 K.init ( domainShape.lowerBound(), domainShape.upperBound(), true );
71 DigitalSet aSet ( domainShape );
73
74 CC complex ( K );
75 complex.construct < DigitalSet > ( aSet );
76 return true;
77 }
78};
79
80// Standard services - public :
81
82int main( int /* argc */, char** /* argv */ )
83{
84 bool res = true;
86 trace.beginBlock ( "DigitalSetToCellularGridConverter" );
87 trace.beginBlock ( "Testing extraction of 0D cells" );
88 res &= test.extractCells();
89 trace.endBlock();
90 trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
91 trace.endBlock();
92 return res ? 0 : 1;
93}
94// //
RealPoint getLowerBound() const
Definition Flower2D.h:135
RealPoint getUpperBound() const
Definition Flower2D.h:144
static void digitalShaper(TDigitalSet &aSet, const TShapeFunctor &aFunctor)
GaussDigitizer< Space, MyEuclideanShape > MyGaussDigitizer
Z2i this namespace gathers the standard of types for 2D imagery.
KhalimskySpaceND< 2, Integer > KSpace
Definition StdDefs.h:77
Space::RealPoint RealPoint
Definition StdDefs.h:97
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition StdDefs.h:100
functors namespace gathers all DGtal functors.
DGtal is the top-level namespace which contains all DGtal functions and types.
Trace trace
STL namespace.
int main()
Definition testBits.cpp:56
bool test(const I &itb, const I &ite)