33 #include "DGtal/helpers/StdDefs.h"
35 #include "DGtal/base/Common.h"
36 #include "DGtal/kernel/SpaceND.h"
37 #include "DGtal/topology/MetricAdjacency.h"
38 #include "DGtal/graph/CUndirectedSimpleLocalGraph.h"
44 using namespace DGtal;
63 unsigned int nbok = 0;
76 trace.
info() <<
" p = " << p << std::endl;
78 back_insert_iterator< vector<Point> > bii6( neigh6 );
79 Adj6::writeNeighbors( bii6, p );
80 nbok += neigh6.size() == 6 ? 1 : 0;
82 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
83 <<
"Card(6-neigh): " << neigh6.size()
84 <<
"== 6 ?" << std::endl;
86 unsigned int nb_correct = 0;
87 for (
unsigned int i = 0; i < neigh6.size(); ++i )
89 if ( Adj6::isProperlyAdjacentTo( p, neigh6[ i ] ) )
91 trace.
info() << neigh6[ i ] <<
"* " << std::endl;
95 trace.
info() << neigh6[ i ] <<
"- " << std::endl;
98 nbok += nb_correct == 6 ? 1 : 0;
100 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
101 <<
"Within, #proper adjacent : " << nb_correct
102 <<
"== 6 ?" << std::endl;
109 trace.
info() <<
" p = " << p << std::endl;
110 vector<Point> neigh18;
111 back_insert_iterator< vector<Point> > bii18( neigh18 );
112 Adj18::writeNeighbors( bii18, p );
113 nbok += neigh18.size() == 18 ? 1 : 0;
115 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
116 <<
"Card(18-neigh): " << neigh18.size()
117 <<
"== 18 ?" << std::endl;
120 for (
unsigned int i = 0; i < neigh18.size(); ++i )
122 if ( Adj18::isProperlyAdjacentTo( p, neigh18[ i ] ) )
124 trace.
info() << neigh18[ i ] <<
"* " << std::endl;
128 trace.
info() << neigh18[ i ] <<
"- " << std::endl;
131 nbok += nb_correct == 18 ? 1 : 0;
133 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
134 <<
"Within, #proper adjacent : " << nb_correct
135 <<
"== 18 ?" << std::endl;
141 trace.
info() <<
" p = " << p << std::endl;
142 vector<Point> neigh26;
143 back_insert_iterator< vector<Point> > bii26( neigh26 );
144 Adj26::writeNeighbors( bii26, p );
145 nbok += neigh26.size() == 26 ? 1 : 0;
147 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
148 <<
"Card(26-neigh): " << neigh26.size()
149 <<
"== 26 ?" << std::endl;
152 for (
unsigned int i = 0; i < neigh26.size(); ++i )
154 if ( Adj26::isProperlyAdjacentTo( p, neigh26[ i ] ) )
156 trace.
info() << neigh26[ i ] <<
"* " << std::endl;
160 trace.
info() << neigh26[ i ] <<
"- " << std::endl;
163 nbok += nb_correct == 26 ? 1 : 0;
165 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
166 <<
"Within, #proper adjacent : " << nb_correct
167 <<
"== 26 ?" << std::endl;
177 unsigned int nbok=0,nb=0;
183 nbok += Adj::bestCapacity() == 72 ? 1 : 0;
185 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
186 <<
"Within, bestCapacity : " << Adj::bestCapacity()
187 <<
"== 72 ?" << std::endl;
199 int main(
int argc,
char** argv )
203 for (
int i = 0; i < argc; ++i )
208 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: Describes digital adjacencies in digital spaces that are defined with the 1-norm and the infinit...
void beginBlock(const std::string &keyword="")
Aim: Gathers several functions useful for concept checks.
DGtal is the top-level namespace which contains all DGtal functions and types.
int main(int argc, char **argv)
bool testLocalGraphModel()
bool testMetricAdjacency()