DGtal
2.0.0
Loading...
Searching...
No Matches
testDigitalTopology.cpp
Go to the documentation of this file.
1
16
29
31
#include <iostream>
32
#include "DGtal/base/Common.h"
33
#include "DGtal/kernel/SpaceND.h"
34
#include "DGtal/topology/MetricAdjacency.h"
35
#include "DGtal/topology/DigitalTopology.h"
37
38
using namespace
std
;
39
using namespace
DGtal
;
40
42
// Functions for testing class DigitalTopology.
44
48
bool
testDigitalTopologyZ2
()
49
{
50
typedef
SpaceND< 2 >
Zi2;
51
typedef
MetricAdjacency< Zi2, 1 >
Adj4;
52
typedef
MetricAdjacency< Zi2, 2 >
Adj8;
53
Adj4 adj4;
54
Adj8 adj8;
55
56
trace
.beginBlock (
"Testing Digital topology (4,8) in Z2."
);
57
typedef
DigitalTopology< Adj4, Adj8 >
DT48;
58
DT48
dt
( adj4, adj8,
JORDAN_DT
);
59
trace
.info() <<
dt
<< std::endl;
60
typedef
DT48::ReverseTopology DT84;
61
DT84 opp_dt =
dt
.reverseTopology();
62
trace
.info() << opp_dt << std::endl;
63
trace
.endBlock();
64
65
// should not compile
66
// typedef DigitalTopology< Adj4, bool > DTimpossible;
67
// DTimpossible dti( adj4, true );
68
69
return
true
;
70
}
71
73
// Standard services - public :
74
75
int
main
(
int
argc,
char
** argv )
76
{
77
trace
.beginBlock (
"Testing class DigitalTopology"
);
78
trace
.info() <<
"Args:"
;
79
for
(
int
i = 0; i < argc; ++i )
80
trace
.info() <<
" "
<< argv[ i ];
81
trace
.info() << endl;
82
83
bool
res =
testDigitalTopologyZ2
();
// && ... other tests
84
trace
.emphase() << ( res ?
"Passed."
:
"Error."
) << endl;
85
trace
.endBlock();
86
return
res ? 0 : 1;
87
}
88
// //
DGtal::DigitalTopology< Adj4, Adj8 >
DGtal::MetricAdjacency
Aim: Describes digital adjacencies in digital spaces that are defined with the 1-norm and the infinit...
Definition
MetricAdjacency.h:80
DGtal::SpaceND
Definition
SpaceND.h:96
dt
float dt
Definition
dgtalCalculus-geodesic.cpp:63
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::trace
Trace trace
DGtal::JORDAN_DT
@ JORDAN_DT
Definition
DigitalTopology.h:57
std
STL namespace.
main
int main()
Definition
testBits.cpp:56
testDigitalTopologyZ2
bool testDigitalTopologyZ2()
Definition
testDigitalTopology.cpp:48
tests
topology
testDigitalTopology.cpp
Generated on
for DGtal by
1.14.0