31 #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();
72 template <
typename CC>
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" );
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Structure representing an RGB triple with alpha component.
Aim: This class represents an arbitrary cubical complex living in some Khalimsky space....
ConstIterator end() const
void construct(const TDigitalSet &set)
ConstIterator begin() const
CellMap::const_iterator CellMapConstIterator
Const iterator for visiting type CellMap.
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: Model of the concept StarShaped represents any flower with k-petals in the plane.
void attach(ConstAlias< EuclideanShape > shape)
const Point & lowerBound() const
const Point & upperBound() const
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
Aim: Implements thinning algorithms in cubical complexes. The implementation supports any model of cu...
void attach(Alias< CC > pComplex)
unsigned int eval(unsigned int iterations)
Aim: A utility class for constructing different shapes (balls, diamonds, and others).
void beginBlock(const std::string &keyword="")
void clear(const DGtal::Color &color=DGtal::Color::None)
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
void getComplex(CC &complex, KSpace &K)
void drawComplex(Board2D &board, CC &complex)
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::uint32_t Dimension
Custom style class redefining the pen color and the fill color. You may use Board2D::Color::None for ...
std::unordered_map< Cell, CubicalCellData > Map
CubicalComplex< KSpace, Map > CC
CC::CellMapConstIterator CellMapConstIterator
PointVector< 3, double > RealPoint