Loading [MathJax]/extensions/TeX/AMSsymbols.js
DGtal 2.0.0
fileGridCurveRanges.cpp
Go to the documentation of this file.
1
16
29
31#include <iostream>
32#include <fstream>
33#include <algorithm>
35
37#include "DGtal/base/Common.h"
38#include "DGtal/helpers/StdDefs.h"
39#include "ConfigExamples.h"
41
43#include "DGtal/io/boards/Board2D.h"
45
46
47using namespace DGtal;
48
50
51int main()
52{
53
55 Z2i::Curve c;
57
59 std::string square = examplesPath + "samples/smallSquare.dat";
61
63 std::fstream inputStream;
64 inputStream.open (square.c_str(), std::ios::in);
65 c.initFromVectorStream(inputStream);
66 inputStream.close();
68
70 DGtal::Board2D aBoard;
72
73 //displaying domain
74 Z2i::Point low(-1,-1);
75 Z2i::Point up(3,3);
76 Z2i::Domain aDomain( low,up );
77 aBoard << SetMode(aDomain.className(), "Paving") << aDomain;
78
80 aBoard << c;
81 aBoard.saveEPS("DisplayGridCurveTuto.eps");
83
86 aBoard << r1;
88 aBoard.saveEPS("DisplayInnerPointsTuto.eps");
89
92 aBoard << r2;
94 aBoard.saveEPS("DisplayIncidentPointsTuto.eps");
95
96
97 return 0;
98
99}
100
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition Board2D.h:71
bool initFromVectorStream(std::istream &in)
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToInnerPoint< KSpace >, Point > InnerPointsRange
Definition GridCurve.h:449
IncidentPointsRange getIncidentPointsRange() const
Definition GridCurve.h:478
ConstRangeAdapter< typename Storage::const_iterator, functors::SCellToIncidentPoints< KSpace >, std::pair< Point, Point > > IncidentPointsRange
Definition GridCurve.h:473
InnerPointsRange getInnerPointsRange() const
Definition GridCurve.h:454
std::string className() const
void saveEPS(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition Board.cpp:804
int main()
GridCurve< K2 > Curve
Definition StdDefs.h:116
Space::Point Point
Definition StdDefs.h:95
HyperRectDomain< Space > Domain
Definition StdDefs.h:99
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....
Definition Board2D.h:247