30 #include "ConfigExamples.h" 32 #include "DGtal/helpers/StdDefs.h" 34 #include "DGtal/topology/CubicalComplex.h" 36 #include "DGtal/topology/ParDirCollapse.h" 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 #include "DGtal/io/boards/Board2D.h" 48 using namespace DGtal;
53 template <
typename CC,
typename KSpace>
57 MyEuclideanShape shape( RealPoint( 0.0, 0.0 ), 16, 5, 5, M_PI_2/2. );
60 MyGaussDigitizer digShape;
62 digShape.init ( shape.getLowerBound(), shape.getUpperBound(), 1.0 );
63 Domain domainShape = digShape.getDomain();
64 DigitalSet aSet( domainShape );
72 template <
typename CC>
78 for ( CellMapConstIterator it = complex.
begin( d ), itE = complex.
end( d );
88 Color( 100, 255, 100 ) ) );
92 Color( 100, 255, 100 ) ) );
103 typedef map<Cell, CubicalCellData>
Map;
112 getComplex< CC, KSpace > ( complex,
K );
113 drawComplex<CC> ( board, complex );
114 board.saveEPS (
"ComplexBeforeThinning.eps" );
116 thinning.
attach ( &complex );
122 drawComplex<CC> ( board, complex );
123 board.saveEPS (
"ParDirCollapse_2.eps" );
127 getComplex< CC, KSpace > ( complex,
K );
128 thinning.
attach ( &complex );
132 drawComplex<CC> ( board, complex );
133 board.saveEPS (
"ParDirCollapse_collapseSurface.eps" );
137 getComplex< CC, KSpace > ( complex,
K );
138 thinning.
attach ( &complex );
142 drawComplex<CC> ( board, complex );
143 board.saveEPS (
"ParDirCollapse_collapseIsthmus.eps" );
void beginBlock(const std::string &keyword="")
std::unordered_map< Cell, CubicalCellData > Map
ConstIterator begin() const
DGtal::uint32_t Dimension
const Point & upperBound() const
void getComplex(CC &complex, KSpace &K)
void construct(const TDigitalSet &set)
Custom style class redefining the pen color and the fill color. You may use Board2D::Color::None for ...
CellMap::const_iterator CellMapConstIterator
Const iterator for visiting type CellMap.
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)
CC::CellMapConstIterator CellMapConstIterator
void clear(const DGtal::Color &color=DGtal::Color::None)
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.
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
ConstIterator end() const
const Point & lowerBound() const
Structure representing an RGB triple with alpha component.
Aim: A utility class for constructing different shapes (balls, diamonds, and others).
void drawComplex(Board2D &board, CC &complex)
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)...