File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/config/TeX-MML-AM_CHTML/MathJax.js
DGtal 2.0.0
testEmbedder.cpp File Reference
#include <iostream>
#include "DGtal/base/Common.h"
#include "DGtal/base/BasicFunctors.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/kernel/CPointEmbedder.h"
#include "DGtal/kernel/CWithGradientMap.h"
#include "DGtal/kernel/CanonicEmbedder.h"
#include "DGtal/topology/CanonicCellEmbedder.h"
#include "DGtal/topology/CanonicSCellEmbedder.h"
#include "DGtal/topology/CanonicDigitalSurfaceEmbedder.h"
#include "DGtal/kernel/RegularPointEmbedder.h"
#include "DGtal/topology/CCellEmbedder.h"
#include "DGtal/topology/CSCellEmbedder.h"
#include "DGtal/topology/CDigitalSurfaceEmbedder.h"
#include "DGtal/topology/DigitalSetBoundary.h"
#include "DGtal/topology/DigitalSurface.h"
#include "DGtal/shapes/implicit/ImplicitPolynomial3Shape.h"
#include "DGtal/shapes/implicit/ImplicitFunctionLinearCellEmbedder.h"
#include "DGtal/shapes/implicit/ImplicitFunctionDiff1LinearCellEmbedder.h"
#include "DGtal/geometry/volumes/distance/LpMetric.h"
#include "DGtal/geometry/surfaces/estimation/LocalEstimatorFromSurfelFunctorAdapter.h"
#include "DGtal/geometry/surfaces/estimation/DigitalSurfaceEmbedderWithNormalVectorEstimator.h"
#include "DGtal/geometry/surfaces/estimation/estimationFunctors/ElementaryConvolutionNormalVectorEstimator.h"
Include dependency graph for testEmbedder.cpp:

Go to the source code of this file.

Functions

bool testEmbedder ()
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
Jacques-Olivier Lachaud (jacqu.nosp@m.es-o.nosp@m.livie.nosp@m.r.la.nosp@m.chaud.nosp@m.@uni.nosp@m.v-sav.nosp@m.oie..nosp@m.fr ) Laboratory of Mathematics (CNRS, UMR 5127), University of Savoie, France
Date
2012/04/16

Functions for testing class Embedder.

This file is part of the DGtal library.

Definition in file testEmbedder.cpp.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 134 of file testEmbedder.cpp.

135{
136 trace.beginBlock ( "Testing class Embedder" );
137 trace.info() << "Args:";
138 for ( int i = 0; i < argc; ++i )
139 trace.info() << " " << argv[ i ];
140 trace.info() << endl;
141
142 bool res = testEmbedder(); // && ... other tests
143 trace.emphase() << ( res ? "Passed." : "Error." ) << endl;
144 trace.endBlock();
145 return res ? 0 : 1;
146}
Trace trace
bool testEmbedder()

References testEmbedder(), and DGtal::trace.

◆ testEmbedder()

bool testEmbedder ( )

Example of a test. To be completed.

Definition at line 67 of file testEmbedder.cpp.

68{
69 unsigned int nbok = 0;
70 unsigned int nb = 0;
71
72 using Z3i::Point;
73 using Z3i::Vector;
74 using Z3i::Domain;
75 using Z3i::Space;
76 using Z3i::KSpace;
77 using Z3i::DigitalSet;
78
79 typedef CanonicEmbedder<Space> MyEmbedder1;
80 BOOST_CONCEPT_ASSERT(( CPointEmbedder< MyEmbedder1 > ));
81 typedef RegularPointEmbedder<Space> MyEmbedder2;
82 BOOST_CONCEPT_ASSERT(( CPointEmbedder< MyEmbedder2 > ));
85 < KSpace, ImplicitShape, MyEmbedder1 > MyCellEmbedder1;
86 BOOST_CONCEPT_ASSERT(( CCellEmbedder< MyCellEmbedder1 > ));
88 < KSpace, ImplicitShape, MyEmbedder2 > MyCellEmbedder2;
89 BOOST_CONCEPT_ASSERT(( CCellEmbedder< MyCellEmbedder2 > ));
90 BOOST_CONCEPT_ASSERT(( CWithGradientMap< MyCellEmbedder2 > ));
91 typedef CanonicCellEmbedder<KSpace> MyCellEmbedder3;
92 BOOST_CONCEPT_ASSERT(( CCellEmbedder< MyCellEmbedder3 > ));
93 typedef CanonicSCellEmbedder<KSpace> MySCellEmbedder1;
94 BOOST_CONCEPT_ASSERT(( CSCellEmbedder< MySCellEmbedder1 > ));
95 typedef DigitalSetBoundary<KSpace, DigitalSet> DigitalSurfaceContainer;
98 BOOST_CONCEPT_ASSERT(( CDigitalSurfaceEmbedder< MyDSEmbedder1 > ));
99
101 typedef DGtal::functors::ConstValue< double > ConvFunctor;
104 Functor, ConvFunctor> MyEstimator;
105
107 < MyDSEmbedder1, MyEstimator > MyDSEmbedder2;
108 BOOST_CONCEPT_ASSERT(( CDigitalSurfaceEmbedder< MyDSEmbedder2 > ));
109 BOOST_CONCEPT_ASSERT(( CWithGradientMap< MyDSEmbedder2 > ));
110
111 trace.beginBlock ( "Testing block ..." );
112 KSpace K;
113 MyCellEmbedder3 cemb3( K );
114 MySCellEmbedder1 scemb1( K );
115 Domain domain( Point( 0, 0, 0 ), Point( 10, 10, 10 ) );
116 K.init( Point( 0, 0, 0 ), Point( 10, 10, 10 ), true );
117 DigitalSet dset( domain );
118 //dset.insert( Point( 3,3,2) );
119 DigitalSurfaceContainer dsc( K, dset );
120 MyDigitalSurface ds( dsc );
121 MyDSEmbedder1 dsemb1( ds );
122 nbok += true ? 1 : 0;
123 nb++;
124 trace.info() << "(" << nbok << "/" << nb << ") "
125 << "true == true" << std::endl;
126 trace.endBlock();
127
128 return nbok == nb;
129}
Aim: A model of CDigitalSurfaceContainer which defines the digital surface as the boundary of a given...
Aim: Combines a digital surface embedder with a normal vector estimator to get a model of CDigitalSur...
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
Aim: a cellular embedder for implicit functions, (default constructible, copy constructible,...
Aim: a cellular embedder for implicit functions, (default constructible, copy constructible,...
Aim: model of CEuclideanOrientedShape concepts to create a shape from a polynomial.
Aim: this class adapts any local functor on digital surface element to define a local estimator....
Aim: A simple point embedder where grid steps are given for each axis. Note that the real point (0,...
Aim: Define a simple functor that returns a constant value (0 by default).
Aim: Estimates normal vector by convolution of elementary normal vector to adjacent surfel.
DigitalSurface< MyDigitalSurfaceContainer > MyDigitalSurface
HyperRectDomain< Space > Domain
Definition StdDefs.h:172
SpaceND< 3, Integer > Space
Definition StdDefs.h:144
KhalimskySpaceND< 3, Integer > KSpace
Definition StdDefs.h:146
Space::Point Point
Definition StdDefs.h:168
DigitalSetSelector< Domain, BIG_DS+HIGH_BEL_DS >::Type DigitalSet
Definition StdDefs.h:173
Space::Vector Vector
Definition StdDefs.h:169
Aim: A trivial embedder for signed and unsigned cell, which corresponds to the canonic injection of c...
Aim: A trivial embedder for digital surfaces, which corresponds to the canonic injection of cell cent...
Aim: A trivial embedder for digital points, which corresponds to the canonic injection of Zn into Rn.
Aim: A trivial embedder for signed cell, which corresponds to the canonic injection of cell centroids...
Aim: A cell embedder is a mapping from unsigned cells to Euclidean points. It adds inner types to fun...
Aim: A digital surface embedder is a specialized mapping from signed cells to Euclidean points....
Aim: A point embedder is a mapping from digital points to Euclidean points. It adds inner types to fu...
Aim: A cell embedder is a mapping from signed cells to Euclidean points. It adds inner types to funct...
Aim: Such object provides a gradient map that associates to each argument some real vector.
MyPointD Point
KSpace K
ImplicitPolynomial3Shape< Space > ImplicitShape
Domain domain
Z2i::DigitalSet DigitalSet

References domain, K, and DGtal::trace.

Referenced by main().