DGtal
1.4.2
Loading...
Searching...
No Matches
exampleArithDSSIterator.cpp
Go to the documentation of this file.
1
31
#include <iostream>
32
#include "ConfigExamples.h"
33
#include "DGtal/helpers/StdDefs.h"
34
#include "DGtal/base/Common.h"
36
37
#include "DGtal/geometry/curves/ArithDSSIterator.h"
38
#include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
39
40
41
using namespace
std
;
42
using namespace
DGtal
;
43
45
46
int
main
()
47
{
48
trace
.
beginBlock
(
"Example exampleArithDSSIterator"
);
49
50
typedef
Z2i::Integer
Integer
;
51
typedef
ArithDSSIterator<Integer,8>
DSSIterator;
52
typedef
ArithmeticalDSSComputer<DSSIterator,Integer,8>
ArithDSS;
53
typedef
Z2i::Point
Point
;
54
55
Point
A(1,5);
56
Integer
xMax = 6;
57
58
// Define an iterator over the 8-connected DSS of characteristics
59
// (2,3,15) and initial point A
60
DSSIterator it(2,3,-15,A);
61
62
// Use this iterator in the ArithmeticalDSS recognition algorithm.
63
// The result gives the minimal characteristics of the subsegment of
64
// the DSL (2,3,15) between the point A and the point of abscissa
65
// equal to xMax.
66
ArithDSS myDSS(it);
67
68
while
( (*(myDSS.end()))[0] <=xMax && myDSS.extendFront())
69
{}
70
71
//Display the result.
72
std::cout << myDSS.a() <<
" "
<< myDSS.b() <<
" "
<< myDSS.mu();
73
74
trace
.
endBlock
();
75
return
0;
76
}
77
// //
DGtal::ArithDSSIterator
Aim: An iterator on the points of a Digital Straight Segment. Template parameters are the integer typ...
Definition
ArithDSSIterator.h:64
DGtal::ArithmeticalDSSComputer
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
Definition
ArithmeticalDSSComputer.h:87
DGtal::PointVector< dim, Integer >
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::endBlock
double endBlock()
main
int main()
Definition
exampleArithDSSIterator.cpp:46
Integer
Point::Coordinate Integer
Definition
examplePlaneProbingParallelepipedEstimator.cpp:44
DGtal::Z2i::Integer
DGtal::int32_t Integer
Definition
StdDefs.h:74
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
Definition
Common.h:153
std
STL namespace.
Point
MyPointD Point
Definition
testClone2.cpp:383
examples
geometry
curves
exampleArithDSSIterator.cpp
Generated on Mon Dec 23 2024 11:13:20 for DGtal by
1.12.0