32#include "DGtal/base/Common.h"
33#include "DGtal/topology/DigitalSurface.h"
34#include "DGtal/topology/DigitalSetBoundary.h"
35#include "DGtal/topology/ImplicitDigitalSurface.h"
36#include "DGtal/graph/BreadthFirstVisitor.h"
37#include "DGtal/shapes/Shapes.h"
47 template <
typename KSpace,
typename Po
intPredicate>
50 const PointPredicate & pp,
56 unsigned int nbok = 0;
58 trace.beginBlock (
"Testing block ... ImplicitDigitalSurface" );
59 trace.beginBlock (
"ImplicitDigitalSurface instanciation" );
60 Boundary boundary(
K, pp,
64 trace.beginBlock (
"Counting the number of surfels (breadth first traversal)" );
65 unsigned int nbsurfels = 0;
66 for (
ConstIterator it = boundary.begin(), it_end = boundary.end();
71 trace.info() << nbsurfels <<
" surfels found." << std::endl;
72 nb++; nbok += nbsurfels == 354382 ? 1 : 0;
73 trace.info() <<
"(" << nbok <<
"/" << nb <<
") "
74 <<
"nbsurfels == 354382" << std::endl;
81 template <
typename TPo
int3>
91 double x = ( (double) p[ 0 ] /
myA );
92 double y = ( (double) p[ 1 ] /
myB );
93 double z = ( (double) p[ 2 ] /
myC );
94 return ( x*x + y*y + z*z ) <= 1.0;
103int main(
int ,
char** )
109 trace.beginBlock (
"Testing class Object" );
110 Point p1( -200, -200, -200 );
111 Point p2( 200, 200, 200 );
113 if (
K.init( p1, p2,
true ) )
115 ImplicitDigitalEllipse ellipse( 180.0, 135.0, 102.0 );
123 trace.emphase() << ( res ?
"Passed." :
"Error." ) << endl;
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as the boundary of an impl...
SignedKhalimskyCell< dim, Integer > SCell
static SCell findABel(const KSpace &K, const PointPredicate &pp, unsigned int nbtries=1000)
Aim: Represent adjacencies between surfel elements, telling if it follows an interior to exterior ord...
Z3i this namespace gathers the standard of types for 3D imagery.
DGtal is the top-level namespace which contains all DGtal functions and types.
bool operator()(const TPoint3 &p) const
ImplicitDigitalEllipse3(double a, double b, double c)
bool testImplicitDigitalSurface()