34 #include "DGtal/base/Common.h"
35 #include "DGtal/kernel/SpaceND.h"
36 #include "DGtal/kernel/domains/HyperRectDomain.h"
37 #include "DGtal/geometry/curves/FreemanChain.h"
38 #include "DGtal/geometry/curves/FP.h"
39 #include "DGtal/io/boards/Board2D.h"
41 #include "ConfigTest.h"
45 using namespace DGtal;
46 using namespace LibBoard;
52 template<
typename Coordinate>
57 vector<LibBoard::Point> polyline;
59 typename vector<PointVector<2,Coordinate> >::const_iterator i = v.begin();
60 for ( ;i != v.end();++i) {
62 double xp = (double) p[0];
63 double yp = (double) p[1];
78 typedef int Coordinate;
85 std::string filename = testPath +
"samples/france.fc";
86 std::cout << filename << std::endl;
89 fst.open (filename.c_str(), std::ios::in);
90 Contour theContour(fst);
94 FP theFP( theContour.begin(),theContour.end(),true );
99 aBoard <<
SetMode(
"PointVector",
"Grid" ) << theContour;
101 aBoard.saveEPS(
"FP.eps");
105 newBoard <<
SetMode(
"PointVector",
"Grid" ) << theContour;
108 vector<Point> v( theFP.size() );
109 theFP.copyFP( v.begin() );
111 drawVectorOfPointsAsPolygon<int>(v, newBoard);
114 vector<RealPoint> v2( theFP.size() );
115 theFP.copyMLP( v2.begin() );
117 drawVectorOfPointsAsPolygon<double>(v2, newBoard);
119 newBoard.
saveEPS(
"FP_MLP.eps");
129 int main(
int argc,
char** argv )
133 for (
int i = 0; i < argc; ++i )
137 bool res = testDrawingFP();
138 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;