DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
testArithDSSIterator.cpp
Go to the documentation of this file.
1
16
29
31
#include <iostream>
32
#include "DGtal/base/Common.h"
33
#include "DGtal/geometry/curves/ArithDSSIterator.h"
34
#include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
36
37
using namespace
std
;
38
using namespace
DGtal
;
39
41
// Functions for testing class ArithDSSIterator.
43
47
bool
testArithDSSIterator
()
48
{
49
typedef
PointVector<2,int>
Point
;
50
typedef
ArithDSSIterator<int,8>
MyIterator;
51
52
Point
p(3,2);
53
MyIterator it(2,5,-4,p);
54
55
typedef
NaiveDSS8<int>
ArithDSS;
56
57
ArithDSS myDSS(p, p);
58
59
int
absMax=8;
60
61
while
( (*it)[0] <=absMax && myDSS.extendFront(*++it))
62
{}
63
64
std::cout << myDSS.a() <<
" "
<< myDSS.b() <<
" "
<< myDSS.mu() <<
" "
<< std::endl;
65
66
return
( (myDSS.a() == 2) &&
67
(myDSS.b() == 5) &&
68
(myDSS.mu() == -4) );
69
}
70
72
// Standard services - public :
73
74
int
main
(
int
argc,
char
** argv )
75
{
76
trace
.
beginBlock
(
"Testing class ArithDSSIterator"
);
77
trace
.
info
() <<
"Args:"
;
78
for
(
int
i = 0; i < argc; ++i )
79
trace
.
info
() <<
" "
<< argv[ i ];
80
trace
.
info
() << endl;
81
82
bool
res =
testArithDSSIterator
();
// && ... other tests
83
trace
.
emphase
() << ( res ?
"Passed."
:
"Error."
) << endl;
84
trace
.
endBlock
();
85
return
res ? 0 : 1;
86
}
87
// //
DGtal::ArithDSSIterator
Aim: An iterator on the points of a Digital Straight Segment. Template parameters are the integer typ...
Definition
ArithDSSIterator.h:64
DGtal::NaiveDSS8
Aim: This class represents a standard digital straight segment (DSS), ie. the sequence of simply 8-co...
Definition
ArithmeticalDSS.h:970
DGtal::PointVector
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition
PointVector.h:593
DGtal::Point
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::Trace::emphase
std::ostream & emphase()
DGtal::Trace::info
std::ostream & info()
DGtal::Trace::endBlock
double endBlock()
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
std
STL namespace.
testArithDSSIterator
bool testArithDSSIterator()
Definition
testArithDSSIterator.cpp:47
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
tests
geometry
curves
testArithDSSIterator.cpp
Generated on
for DGtal by
1.18.0