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;
71 K3::SCell s = theKSpace.sPointel(
K3::Point(3,3,4) );
77 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
83 K3::SCell s = theKSpace.sCell(
K3::Point(0,0,0),
true);
84 theKSpace.sSetKCoords( s,
K3::Point(5,6,8) );
90 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
96 K2::SCell s = theKSpace.sCell(
K2::Point(0,1) );
102 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
109 K2::SCell s = theKSpace.sCell(
K2::Point(0,1) );
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;
124 K2::SCell s = theKSpace.sCell(
K2::Point(0,1) );
130 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
137 K2::SCell s = theKSpace.sCell(
K2::Point(0,1) );
143 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") " << std::endl;
150 K2::SCell s = theKSpace.sCell(
K2::Point(0,1) );
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;
165 K2::SCell s = theKSpace.sCell(
K2::Point(0,1) );
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 )
191 checkingConcepts<functors::SCellToPoint<K2>, K2::SCell,
K2::Point >();
193 checkingConcepts<functors::SCellToArrow<K2>, K2::SCell, std::pair<K2::Point, K2::Vector> >();
194 checkingConcepts<functors::SCellToInnerPoint<K2>, K2::SCell,
K2::Point >();
195 checkingConcepts<functors::SCellToOuterPoint<K2>, K2::SCell,
K2::Point >();
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.
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.
FreemanChain< int >::Vector Vector
int main(int argc, char **argv)
bool testSCellsFunctors()