DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
testMeasureSet.cpp
1
16
29
31
#include <iostream>
32
#include "DGtal/base/Common.h"
33
#include "DGtal/helpers/StdDefs.h"
34
#include "DGtal/shapes/Shapes.h"
35
#include "DGtal/shapes/ShapeFactory.h"
36
37
#include "DGtal/geometry/volumes/estimation/Measure.h"
38
40
41
using namespace
std
;
42
using namespace
DGtal
;
43
45
// Functions for testing class Measure.
47
48
bool
testConcept()
49
{
50
51
return
true
;
52
}
53
54
55
60
bool
testMeasure()
61
{
62
trace
.
beginBlock
(
"Testing Measure ..."
);
63
64
65
Z3i::Point
a(0,0);
66
Z3i::Point
b(64,64,64);
67
Z3i::Point
c(32,32,32);
68
Z3i::Domain
domain
(a,b);
69
Z3i::DigitalSet
set(
domain
);
70
71
Shapes<Z3i::Domain>::euclideanShaper
( set,
72
ImplicitBall<Z3i::Space>
( c, 10));
73
74
Measure< Z3i::DigitalSet>
measure;
75
76
trace
.
info
() <<
"Input set= "
<<set<<std::endl;
77
78
trace
.
info
()<<measure<<std::endl;
79
80
81
measure.
init
(10, set);
82
trace
.
info
() <<
"Volume (h=10) "
<<measure.
eval
()<<std::endl;
83
measure.
init
(100, set);
84
trace
.
info
() <<
"Volume (h=100) "
<<measure.
eval
()<<std::endl;
85
86
trace
.
info
()<<measure<<std::endl;
87
88
trace
.
endBlock
();
89
90
return
true
;
91
}
92
94
// Standard services - public :
95
96
int
main
(
int
argc,
char
** argv )
97
{
98
trace
.
beginBlock
(
"Testing class Measure"
);
99
trace
.
info
() <<
"Args:"
;
100
for
(
int
i = 0; i < argc; ++i )
101
trace
.
info
() <<
" "
<< argv[ i ];
102
trace
.
info
() << endl;
103
104
bool
res = testConcept() && testMeasure();
// && ... other tests
105
trace
.
emphase
() << ( res ?
"Passed."
:
"Error."
) << endl;
106
trace
.
endBlock
();
107
return
res ? 0 : 1;
108
}
109
// //
DGtal::ImplicitBall
Aim: model of CEuclideanOrientedShape and CEuclideanBoundedShape concepts to create a ball in nD....
Definition
ImplicitBall.h:65
DGtal::Measure
Aim: Implements a simple measure computation (in the Lesbegue sens) of a set. In dimension 2,...
Definition
Measure.h:72
DGtal::Measure::eval
Quantity eval() const
DGtal::Measure::init
void init(const double h, const Set &aSetPointer)
DGtal::Shapes::euclideanShaper
static void euclideanShaper(TDigitalSet &aSet, const TShapeFunctor &aFunctor, const double h=1.0)
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::Z3i::Domain
HyperRectDomain< Space > Domain
Definition
StdDefs.h:172
DGtal::Z3i::Point
Space::Point Point
Definition
StdDefs.h:168
DGtal::Z3i::DigitalSet
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition
StdDefs.h:173
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.
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
domain
Domain domain
Definition
testProjection.cpp:88
tests
geometry
volumes
estimation
testMeasureSet.cpp
Generated on
for DGtal by
1.18.0