32#include "DGtal/base/Common.h"
33#include "ConfigTest.h"
34#include "DGtal/helpers/StdDefs.h"
35#include "DGtal/topology/ImplicitDigitalSurface.h"
36#include "DGtal/io/viewers/PolyscopeViewer.h"
49template <
typename TPo
int3>
59 double x = ( (double) p[ 0 ] );
60 double y = ( (double) p[ 1 ] );
61 double z = ( (double) p[ 2 ] );
62 return ( x*x + y*y + z*z -
myR*
myR) <= 0.0;
70 unsigned int nbok = 0;
73 trace.beginBlock (
"Testing... Ball with quadnormal");
78 typedef Boundary::Surfel
Surfel;
79 Point p1( -100, -100, -100 );
80 Point p2( 100, 100, 100 );
82 nbok +=
K.init( p1, p2,
true ) ? 1 : 0;
84 trace.info() <<
"(" << nbok <<
"/" << nb <<
") "
85 <<
"K.init() is ok" << std::endl;
86 ImplicitDigitalBall ball( 60.0 );
88 Boundary boundary(
K, ball,
90 unsigned int nbsurfels = 0;
95 for (
ConstIterator it = boundary.begin(), it_end = boundary.end();
102 trace.info() << nbsurfels <<
" surfels found." << std::endl;
110int main(
int argc,
char** argv )
112 trace.beginBlock (
"Testing class BallQuad" );
113 trace.info() <<
"Args:";
114 for (
int i = 0; i < argc; ++i )
115 trace.info() <<
" " << argv[ i ];
116 trace.info() << endl;
119 trace.emphase() <<
"Passed." << endl;
110int main(
int argc,
char** argv ) {
…}
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as the boundary of an impl...
void show() override
Starts the event loop and display of elements.
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
ImplicitDigitalBall3(double r)