DGtal
1.0.0
tests
kernel
testDomainSpanIterator.cpp
1
32
#include <cstdio>
33
#include <cmath>
34
#include <iostream>
35
#include <fstream>
36
#include <algorithm>
37
38
#include "DGtal/base/Common.h"
39
#include "DGtal/kernel/SpaceND.h"
40
#include "DGtal/kernel/domains/HyperRectDomain.h"
41
42
43
using namespace
DGtal
;
44
using namespace
std;
45
46
51
bool
testIterator
()
52
{
53
54
trace
.
emphase
() <<
"Iterator 4d: "
;
55
typedef
SpaceND<4>
SpaceType4D;
56
typedef
SpaceType4D::Point
TPoint4D;
57
const
SpaceType4D::Integer t4D[ ] = { 1, 1, 1, 1};
58
const
SpaceType4D::Integer t4D2[ ] = { 3, 6, 3, 3};
59
const
SpaceType4D::Integer t4D3[ ] = { 1, 2, 1, 1};
60
TPoint4D a4D ( t4D );
61
TPoint4D b4D ( t4D2 );
62
TPoint4D c4D ( t4D3);
63
64
trace
.
beginBlock
(
"Span Domain iterator test"
);
66
HyperRectDomain<SpaceType4D>
mySpan ( a4D, b4D );
67
68
69
trace
.
emphase
() << mySpan << std::endl;
70
72
for
(
HyperRectDomain<SpaceType4D>::ConstSubRange::ConstIterator
73
it = mySpan.subRange(1, c4D).begin();
74
it != mySpan.subRange(1, c4D).end(); ++it )
75
trace
.
info
() << ( *it ) << std::endl;
76
77
trace
.
endBlock
();
78
return
mySpan.isValid();
79
}
80
81
82
int
main
()
83
{
84
85
if
(
testIterator
() )
86
return
0;
87
else
88
return
1;
89
}
90
91
DGtal::Trace::beginBlock
void beginBlock(const std::string &keyword="")
DGtal::trace
Trace trace
Definition:
Common.h:144
DGtal::SpaceND
Definition:
SpaceND.h:95
DGtal::HyperRectDomain
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
Definition:
HyperRectDomain.h:92
DGtal::Trace::endBlock
double endBlock()
DGtal::HyperRectDomain_subIterator
Definition:
HyperRectDomain_Iterator.h:321
DGtal::Trace::emphase
std::ostream & emphase()
testIterator
bool testIterator()
Definition:
testHyperRectDomain.cpp:129
main
int main(int argc, char **argv)
Definition:
testArithmeticDSS-benchmark.cpp:147
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition:
ClosedIntegerHalfPlane.h:48
Point
MyPointD Point
Definition:
testClone2.cpp:383
DGtal::Trace::info
std::ostream & info()
Generated on Wed Mar 27 2019 12:03:49 for DGtal by
1.8.15