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"
59int 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);
79 StraightLine aStraightLine;
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 );
123 Preimage2D thePreimage(it->first, it->second, aCircle);
125 while ( (it != itEnd) &&
126 (thePreimage.
addFront(it->first, it->second)) )
133 board.
setUnit(Board2D::UCentimeter);
135 board.
saveEPS(
"PreimageExample2.eps" );
136 board.
saveSVG(
"PreimageExample2.svg" );
138 board.
saveCairo(
"PreimageExample2.pdf", Board2D::CairoPDF);
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Aim: Represents a circle that passes through a given point and that is thus uniquely defined by two o...
Aim: model of CConstBidirectionalRange that adapts any range of elements bounded by two iterators [it...
Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d...
bool initFromVectorStream(std::istream &in)
Storage::const_iterator ConstIterator
std::string className() const
Aim: Computes the preimage of the 2D Euclidean shapes crossing a sequence of n straigth segments in O...
bool addFront(const Point &aP, const Point &aQ)
Aim: Represents a straight line uniquely defined by two 2D points and that is able to return for any ...
void beginBlock(const std::string &keyword="")
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
void saveCairo(const char *filename, CairoType type=CairoPNG, PageSize size=Board::BoundingBox, double margin=10.0) const
DGtal is the top-level namespace which contains all DGtal functions and types.
Modifier class in a Board2D stream. Useful to choose your own mode for a given class....