DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
testParametricShape.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/parametric/Ball2D.h"
36
#include "DGtal/io/boards/Board2D.h"
37
#include "DGtal/io/colormaps/GrayscaleColorMap.h"
38
#include "DGtal/images/ImageContainerBySTLVector.h"
40
41
using namespace
std
;
42
using namespace
DGtal
;
43
45
// Functions for testing class ParametricShape.
47
51
bool
testParametricShape()
52
{
53
trace
.
beginBlock
(
"Testing parametric shaper ..."
);
54
Z2i::Point
a(0,0);
55
Z2i::Point
b(64,64);
56
Z2i::Space::RealPoint
c(32.0,32.0);
57
Z2i::Point
cc(32,32);
58
59
Board2D
board;
60
61
Z2i::Domain
domain
(a,b);
62
Z2i::DigitalSet
set(
domain
);
63
64
Shapes<Z2i::Domain>::euclideanShaper
( set,
65
Ball2D<Z2i::Space>
( cc, 10));
66
67
Z2i::Point
lower
,
upper
;
68
set.computeBoundingBox(
lower
,
upper
);
69
70
trace
.
info
()<<
"Generated set: "
<<set<<
" lowerBound="
<<
lower
71
<<
" upperBound="
<<
upper
<<std::endl;
72
73
board << set;
74
board.
saveSVG
(
"parametricball.svg"
);
75
76
return
true
;
77
}
78
80
// Standard services - public :
81
82
int
main
(
int
argc,
char
** argv )
83
{
84
trace
.
beginBlock
(
"Testing class ImplicitShape"
);
85
trace
.
info
() <<
"Args:"
;
86
for
(
int
i = 0; i < argc; ++i )
87
trace
.
info
() <<
" "
<< argv[ i ];
88
trace
.
info
() << endl;
89
90
bool
res = testParametricShape();
// && ... other tests
91
trace
.
emphase
() << ( res ?
"Passed."
:
"Error."
) << endl;
92
trace
.
endBlock
();
93
return
res ? 0 : 1;
94
}
95
// //
DGtal::Ball2D
Aim: Model of the concept StarShaped represents any circle in the plane.
Definition
Ball2D.h:61
DGtal::Board2D
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)....
Definition
Board2D.h:71
DGtal::Shapes::euclideanShaper
static void euclideanShaper(TDigitalSet &aSet, const TShapeFunctor &aFunctor, const double h=1.0)
DGtal::SpaceND< 2, Integer >::RealPoint
PointVector< dim, double > RealPoint
Definition
SpaceND.h:117
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()
LibBoard::Board::saveSVG
void saveSVG(const char *filename, PageSize size=Board::BoundingBox, double margin=10.0) const
Definition
Board.cpp:1011
DGtal::Z2i::Point
Space::Point Point
Definition
StdDefs.h:95
DGtal::Z2i::DigitalSet
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition
StdDefs.h:100
DGtal::Z2i::Domain
HyperRectDomain< Space > Domain
Definition
StdDefs.h:99
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
lower
Vector lower(const Vector &z, unsigned int k)
Definition
viewDualSurface.cpp:189
upper
Vector upper(const Vector &z, unsigned int k)
Definition
viewDualSurface.cpp:196
tests
helpers
testParametricShape.cpp
Generated on
for DGtal by
1.18.0