66 unsigned int nbok = 0;
75 typedef VisitorRange::ConstIterator VisitorConstIterator;
88 dshape.attach( ishape );
92 if ( !
K.
init( dshape.getLowerBound(), dshape.getUpperBound(),
true ) )
94 trace.
error() <<
"Problem with Khalimsky space" << std::endl;
106 VisitorRange range(
new Visitor( surf, *surf.
begin() ));
107 VisitorConstIterator ibegin = range.begin();
108 VisitorConstIterator iend = range.end();
110 MyIICurvatureFunctor curvatureFunctor;
111 curvatureFunctor.init( h, re );
113 MyIICurvatureEstimator curvatureEstimator( curvatureFunctor );
114 curvatureEstimator.attach(
K, dshape );
115 curvatureEstimator.setParams( re/h );
116 curvatureEstimator.init( h, ibegin, iend );
118 std::vector<MyIICurvatureEstimator::Quantity> results;
119 std::back_insert_iterator< std::vector<MyIICurvatureEstimator::Quantity> > itback(results);
121 curvatureEstimator.eval(ibegin,iend,itback);
122 trace.
info() <<
"Number of values = "<< results.size()<<std::endl;
126 VisitorRange range2(
new Visitor( surf, *surf.
begin() ));
127 VisitorConstIterator ibegin2 = range2.begin();
128 VisitorConstIterator iend2 = range2.end();
134 GaussianCache cache( curvatureEstimator );
135 cache.init( h, ibegin2, iend2 );
136 trace.
info() <<
"Number of cached values = "<< cache.size()<<std::endl;
138 trace.
info() <<
"Value at begin="<< cache.eval(surf.
begin())<<
" expected = "<< curvatureEstimator.eval(surf.
begin())<<std::endl;
146 if ( cache.eval(it) != curvatureEstimator.eval(it) )
149 trace.
error() <<
"Incorrect values at "<<*it<<
" read " <<cache.eval(it)<<
" and expecting "<<curvatureEstimator.eval(it)<<std::endl;
157 if ( cache.eval(it) == 12345678 )
161 trace.
error() <<
"Incorrect values at "<<*it<<std::endl;
167 GaussianCache cache2(cache);
168 trace.
info() <<
"Number of cached values = "<< cache.size()<<std::endl;
169 trace.
info() <<
"Value at begin="<< cache2.eval(surf.
begin())<<
" expected = "<< curvatureEstimator.eval(surf.
begin())<<std::endl;
172 if ( cache.eval(it) == 12345678 )
176 trace.
error() <<
"Incorrect values at "<<*it<<std::endl;
185 trace.
info() <<
"(" << nbok <<
"/" << nb <<
") "
186 <<
"cache == eval" << std::endl;
bool init(const Point &lower, const Point &upper, bool isClosed)
Specifies the upper and lower bounds for the maximal cells in this space.