34 #include "DGtal/base/Common.h"
37 #include "DGtal/geometry/curves/ArithmeticalDSS.h"
38 #include "DGtal/geometry/curves/FreemanChain.h"
39 #include "DGtal/base/BasicTypes.h"
40 #include "DGtal/io/boards/Board2D.h"
41 #include "DGtal/helpers/StdDefs.h"
44 using namespace DGtal;
57 typedef std::vector<Point>
Range;
58 typedef std::vector<Point>::const_iterator ConstIterator;
63 contour.push_back(Point(0,0));
64 contour.push_back(Point(1,0));
65 contour.push_back(Point(1,1));
66 contour.push_back(Point(2,1));
67 contour.push_back(Point(3,1));
68 contour.push_back(Point(3,2));
69 contour.push_back(Point(4,2));
70 contour.push_back(Point(5,2));
71 contour.push_back(Point(6,2));
72 contour.push_back(Point(6,3));
73 contour.push_back(Point(6,4));
78 theDSS4.init( contour.
begin() );
79 while ( ( theDSS4.end() != contour.
end() )
80 &&( theDSS4.extendForward() ) ) {}
83 cout << theDSS4 << endl;
90 Domain domain( Point(0,0), Point(8,8) );
91 board <<
SetMode(domain.className(),
"Grid")
95 board <<
SetMode(
"PointVector",
"Grid")
96 <<
SetMode(theDSS4.className(),
"Points")
99 board <<
SetMode(theDSS4.className(),
"BoundingBox")
110 typedef std::vector<Point> Range;
111 typedef std::vector<Point>::const_iterator ConstIterator;
116 boundary.push_back(Point(0,0));
117 boundary.push_back(Point(1,1));
118 boundary.push_back(Point(2,1));
119 boundary.push_back(Point(3,2));
120 boundary.push_back(Point(4,2));
121 boundary.push_back(Point(5,2));
122 boundary.push_back(Point(6,3));
123 boundary.push_back(Point(6,4));
127 theDSS8.init( boundary.
begin() );
128 while ( ( theDSS8.end() != boundary.
end() )
129 &&( theDSS8.extendForward() ) ) {}
133 cout << theDSS8 << endl;
139 Domain domain( Point(0,0), Point(8,8) );
140 board <<
SetMode(domain.className(),
"Paving")
144 board <<
SetMode(
"PointVector",
"Both");
145 board <<
SetMode(theDSS8.className(),
"Points")
149 board <<
SetMode(theDSS8.className(),
"BoundingBox")