DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
exampleArithmeticalDSSComputer.cpp
Go to the documentation of this file.
1
16
29
38
40
#include <iostream>
41
#include "DGtal/base/Common.h"
42
#include "DGtal/base/BasicTypes.h"
43
#include "DGtal/helpers/StdDefs.h"
44
46
#include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
49
50
51
using namespace
std
;
52
using namespace
DGtal
;
53
55
56
int
main
()
57
{
58
59
60
using namespace
Z2i
;
61
63
// Container of digital points
64
typedef
std::vector<Z2::Point> Container;
65
// Iterator on the container
66
typedef
Container::const_iterator
ConstIterator
;
67
// StandardDSS4 computer
68
typedef
StandardDSS4Computer<ConstIterator>
DSSComputer;
69
// Construction of the computer
70
DSSComputer theDSSComputer;
72
73
// Input points
74
Container contour;
75
contour.push_back(Z2::Point(0,0));
76
contour.push_back(Z2::Point(1,0));
77
contour.push_back(Z2::Point(1,1));
78
contour.push_back(Z2::Point(2,1));
79
contour.push_back(Z2::Point(3,1));
80
contour.push_back(Z2::Point(3,2));
81
contour.push_back(Z2::Point(4,2));
82
contour.push_back(Z2::Point(5,2));
83
contour.push_back(Z2::Point(6,2));
84
contour.push_back(Z2::Point(6,3));
85
contour.push_back(Z2::Point(6,4));
86
88
// Add points while it is possible
89
theDSSComputer.init( contour.begin() );
90
while
( ( theDSSComputer.end() != contour.end() ) &&
91
( theDSSComputer.extendFront() ) ) {}
93
94
// Trace to the standard output
95
cout << theDSSComputer << endl;
96
98
DSSComputer::Primitive theDSS = theDSSComputer.primitive();
100
101
// Trace to the standard output
102
cout << theDSS << endl;
103
104
return
1;
105
}
106
// //
DGtal::ConstIterator
DGtal::Z2i
Z2i this namespace gathers the standard of types for 2D imagery.
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::StandardDSS4Computer
ArithmeticalDSSComputer< TIterator, TInteger, 4 > StandardDSS4Computer
Aim: This is an alias to ArithmeticalDSS that is devoted to the dynamic recognition of standard and s...
Definition
ArithmeticalDSSComputer.h:462
std
STL namespace.
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
examples
geometry
curves
exampleArithmeticalDSSComputer.cpp
Generated on
for DGtal by
1.18.0