DGtal 2.1.0
Loading...
Searching...
No Matches
testBallQuadViewer.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "ConfigTest.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/topology/ImplicitDigitalSurface.h"
#include "DGtal/io/viewers/PolyscopeViewer.h"
Include dependency graph for testBallQuadViewer.cpp:

Go to the source code of this file.

Data Structures

struct  ImplicitDigitalBall3< TPoint3 >
 

Functions

void testBallQuad ()
 
int main (int argc, char **argv)
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
David Coeurjolly (david.nosp@m..coe.nosp@m.urjol.nosp@m.ly@l.nosp@m.iris..nosp@m.cnrs.nosp@m..fr ) Laboratoire d'InfoRmatique en Image et Systemes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
Date
2014/04/14

Functions for testing class BallQuad.

This file is part of the DGtal library.

Definition in file testBallQuadViewer.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 110 of file testBallQuadViewer.cpp.

111{
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;
117
118 testBallQuad(); // && ... other tests
119 trace.emphase() << "Passed." << endl;
120 trace.endBlock();
121 return 0;
122}
void beginBlock(const std::string &keyword="")
std::ostream & emphase()
std::ostream & info()
double endBlock()
Trace trace
void testBallQuad()

References DGtal::Trace::beginBlock(), DGtal::Trace::emphase(), DGtal::Trace::endBlock(), DGtal::Trace::info(), testBallQuad(), and DGtal::trace.

◆ testBallQuad()

void testBallQuad ( )

Definition at line 68 of file testBallQuadViewer.cpp.

69{
70 unsigned int nbok = 0;
71 unsigned int nb = 0;
72
73 trace.beginBlock ( "Testing... Ball with quadnormal");
74 using namespace Z3i;
75 typedef ImplicitDigitalBall3<Point> ImplicitDigitalBall;
77 typedef Boundary::SurfelConstIterator ConstIterator;
78 typedef Boundary::Surfel Surfel;
79 Point p1( -100, -100, -100 );
80 Point p2( 100, 100, 100 );
81 KSpace K;
82 nbok += K.init( p1, p2, true ) ? 1 : 0;
83 nb++;
84 trace.info() << "(" << nbok << "/" << nb << ") "
85 << "K.init() is ok" << std::endl;
86 ImplicitDigitalBall ball( 60.0 );
87 Surfel bel = Surfaces<KSpace>::findABel( K, ball, 10000 );
88 Boundary boundary( K, ball,
90 unsigned int nbsurfels = 0;
91
93 viewer.allowReuseList = true;
94
95 for ( ConstIterator it = boundary.begin(), it_end = boundary.end();
96 it != it_end; ++it )
97 {
98 ++nbsurfels;
99 viewer << *it;
100 }
101
102 trace.info() << nbsurfels << " surfels found." << std::endl;
103
104 viewer.show();
105}
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as the boundary of an impl...
Aim: This class is a model of CCellularGridSpaceND. It represents the cubical grid as a cell complex,...
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.
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...
MyDigitalSurface::ConstIterator ConstIterator
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value.
KSpace K

References DGtal::Display3D< Space, KSpace >::allowReuseList, DGtal::Trace::beginBlock(), DGtal::Surfaces< TKSpace >::findABel(), DGtal::Trace::info(), DGtal::KhalimskySpaceND< dim, TInteger >::init(), K, DGtal::PolyscopeViewer< Space, KSpace >::show(), and DGtal::trace.

Referenced by main().