32 #include "ConfigExamples.h"
33 #include "DGtal/base/Common.h"
35 #include "DGtal/geometry/curves/AlphaThickSegmentComputer.h"
36 #include "DGtal/helpers/StdDefs.h"
37 #include "DGtal/io/readers/PointListReader.h"
39 #include "DGtal/io/boards/Board2D.h"
43 using namespace DGtal;
56 std::string file = examplesPath +
"samples/contourSnoisy.sdp";
62 aBoard <<
SetMode(aContour[0].className(),
"Grid");
63 for (
unsigned int i = 0; i< aContour.size(); i++){
64 aBoard << aContour[i];
65 aBoard.
drawLine(aContour[i][0], aContour[i][1],
66 aContour[(i+1)%aContour.size()][0], aContour[(i+1)%aContour.size()][1]);
73 AlphaThickSegmentComputer2D anAlphaSegment(15);
76 std::vector<Z2i::RealPoint>::const_iterator it = aContour.begin();
77 while (anAlphaSegment.extendFront(*it)) {
84 aBoard << anAlphaSegment;
86 AlphaThickSegmentComputer2D anAlphaSegment2(9);
88 anAlphaSegment2.init(aContour.begin());
89 while (anAlphaSegment2.end() != aContour.end() &&
90 anAlphaSegment2.extendFront()) {
96 aBoard << anAlphaSegment2;
99 AlphaThickSegmentComputer2D anAlphaSegment3(2);
100 anAlphaSegment3.init(aContour.begin());
101 while (anAlphaSegment3.end() != aContour.end() &&
102 anAlphaSegment3.extendFront()) {
105 aBoard << anAlphaSegment3;
108 aBoard.
saveEPS(
"exampleAlphaThickSegmentNoisy.eps");
void beginBlock(const std::string &keyword="")
void drawLine(double x1, double y1, double x2, double y2, int depthValue=-1)
Custom style class redefining the pen color and the fill color. You may use Board2D::Color::None for ...
Aim: Implements method to read a set of points represented in each line of a file.
DGtal is the top-level namespace which contains all DGtal functions and types.
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Modifier class in a Board2D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithBoard2D.
Aim: This class is devoted to the recognition of alpha thick segments as described in ...
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)...