41 #include "DGtal/base/Common.h"
42 #include "DGtal/helpers/StdDefs.h"
43 #include "ConfigExamples.h"
45 #include "DGtal/geometry/tools/Preimage2D.h"
46 #include "DGtal/shapes/fromPoints/StraightLineFrom2Points.h"
47 #include "DGtal/shapes/fromPoints/CircleFrom2Points.h"
49 #include "DGtal/io/boards/Board2D.h"
54 using namespace DGtal;
59 int main(
int argc,
char** argv )
63 for (
int i = 0; i < argc; ++i )
67 std::string filename = examplesPath +
"samples/DSS.dat";
69 instream.open (filename.c_str(), ifstream::in);
72 c.initFromVectorStream(instream);
79 StraightLine aStraightLine;
85 Curve::IncidentPointsRange r = c.getIncidentPointsRange();
90 Preimage2D thePreimage(it->first, it->second, aStraightLine);
92 while ( (it != itEnd) &&
93 (thePreimage.
addFront(it->first, it->second)) )
100 board.
setUnit(Board2D::UCentimeter);
101 board << r << thePreimage;
102 board.
saveEPS(
"PreimageExample.eps" );
114 Circle aCircle( pole );
118 Curve::IncidentPointsRange r = c.getIncidentPointsRange();
123 Preimage2D thePreimage(it->first, it->second, aCircle);
125 while ( (it != itEnd) &&
126 (thePreimage.
addFront(it->first, it->second)) )
133 board.
setUnit(Board2D::UCentimeter);
134 board << r <<
SetMode(pole.className(),
"Grid") << pole << thePreimage;
135 board.
saveEPS(
"PreimageExample2.eps" );
136 board.
saveSVG(
"PreimageExample2.svg" );
138 board.
saveCairo(
"PreimageExample2.pdf", Board2D::CairoPDF);