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"
53template <
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();
67 K.init ( domainShape.lowerBound(), domainShape.upperBound(),
true );
69 complex.construct ( aSet );
88 Color( 100, 255, 100 ) ) );
92 Color( 100, 255, 100 ) ) );
103 typedef map<Cell, CubicalCellData>
Map;
109 ParDirCollapse < CC > thinning (
K );
111 trace.beginBlock (
"ParDirCollapse -- 2 iterations." );
114 board.
saveEPS (
"ComplexBeforeThinning.eps" );
116 thinning.
attach ( &complex );
123 board.
saveEPS (
"ParDirCollapse_2.eps" );
126 trace.beginBlock (
"ParDirCollapse -- collapseSurface." );
128 thinning.
attach ( &complex );
133 board.
saveEPS (
"ParDirCollapse_collapseSurface.eps" );
136 trace.beginBlock (
"ParDirCollapse -- collapseIsthmus." );
138 thinning.
attach ( &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.
CellMap::const_iterator CellMapConstIterator
void attach(ConstAlias< EuclideanShape > shape)
void attach(Alias< CC > pComplex)
unsigned int eval(unsigned int iterations)
static void digitalShaper(TDigitalSet &aSet, const TShapeFunctor &aFunctor)
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)
Z2i this namespace gathers the standard of types for 2D imagery.
KhalimskySpaceND< 2, Integer > KSpace
Space::RealPoint RealPoint
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
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