31 #include "DGtal/base/Common.h"
32 #include "DGtal/base/CUnaryFunctor.h"
34 #include "DGtal/topology/SCellsFunctors.h"
35 #include "DGtal/topology/CanonicSCellEmbedder.h"
37 #include "DGtal/topology/KhalimskySpaceND.h"
42 using namespace DGtal;
48 template <
typename TFunctor,
typename TArg,
typename TRes >
61 unsigned int nbok = 0;
77 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
84 theKSpace.sSetKCoords( s,
K3::Point(5,6,8) );
90 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
102 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
110 std::pair<K2::Point, K2::Vector> aArrow = m( s );
111 trace.
info() << s << aArrow.first << aArrow.second <<std::endl;
114 nbok += ( ((aArrow.first == p) && (aArrow.second == v)) ) ? 1 : 0;
117 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
130 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
143 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
151 std::pair<K2::Point, K2::Point> aPair = m( s );
152 trace.
info() << s << aPair.first << aPair.second <<std::endl;
155 nbok += ( ((aPair.first == p1) && (aPair.second == p2)) ) ? 1 : 0;
158 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
168 nbok += ( aCode ==
'3' ) ? 1 : 0;
172 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
181 int main(
int argc,
char** argv )
185 for (
int i = 0; i < argc; ++i )
193 checkingConcepts<functors::SCellToArrow<K2>,
K2::SCell, std::pair<K2::Point, K2::Vector> >();
196 checkingConcepts<functors::SCellToIncidentPoints<K2>,
K2::SCell, std::pair<K2::Point, K2::Point> >();
197 checkingConcepts<functors::SCellToCode<K2>,
K2::SCell,
char >();
200 trace.
emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
void beginBlock(const std::string &keyword="")
Aim: transforms a signed cell into an arrow, ie. a pair point-vector.
Aim: transforms a 2d signed cell, basically a linel, into a code (0,1,2 or 3),.
Aim: transforms a signed cell c into a pair of points corresponding to the signed cells of greater di...
Aim: transforms a signed cell c into a point corresponding to the signed cell of greater dimension th...
Aim: transforms a signed cell c into a point corresponding to the signed cell of greater dimension th...
Aim: transforms a scell into a point.
DigitalPlane::Point Vector
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: A trivial embedder for signed cell, which corresponds to the canonic injection of cell centroids...
Aim: Defines a unary functor, which associates arguments to results.
int main(int argc, char **argv)
bool testSCellsFunctors()
PointVector< 3, double > RealPoint