31#if defined(EstimatorCache_RECURSES)
32#error Recursive header files inclusion detected in EstimatorCache.h
35#define EstimatorCache_RECURSES
37#if !defined EstimatorCache_h
39#define EstimatorCache_h
45#include "DGtal/base/Common.h"
46#include "DGtal/base/Alias.h"
47#include "DGtal/geometry/surfaces/estimation/CSurfelLocalEstimator.h"
74 template <
typename TEstimator,
75 typename TContainer = std::map<
typename TEstimator::Surfel,
76 typename TEstimator::Quantity> >
94 typedef typename Estimator::Surfel
Surfel;
157 template <
typename SurfelConstIterator>
158 void init(
const double aH, SurfelConstIterator itb, SurfelConstIterator ite)
167 for(SurfelConstIterator it = itb; it != ite; ++it)
182 template <
typename SurfelConstIterator>
185 ASSERT_MSG(
myInit,
" init() method must have been called first.");
199 ASSERT_MSG(
myInit,
" init() method must have been called first.");
217 template <
typename SurfelConstIterator,
typename OutputIterator>
218 OutputIterator
eval(SurfelConstIterator itb,
219 SurfelConstIterator ite,
220 OutputIterator result )
const
222 ASSERT_MSG(
myInit,
" init() method must have been called first.");
223 for(SurfelConstIterator it = itb; it != ite; ++it)
224 *result++ = this->
eval(it);
248 typename Container::size_type
size()
const
250 ASSERT_MSG(
myInit,
" init() method must have been called first.");
260 out<<
"[EstimatorCache] number of surfels="<<
myContainer.size();
299 template <
typename T,
typename TC>
303 object.selfDisplay( out );
313#undef EstimatorCache_RECURSES
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Aim: this class adapts any local surface estimator to cache the estimated values in a associative con...
Quantity eval(const SurfelConstIterator it) const
Container myContainer
Instance of estimator.
TContainer Container
Container type.
Self & operator=(const Self &other)
EstimatorCache< Estimator, Container > Self
Self.
Container::size_type size() const
EstimatorCache(Alias< Estimator > anEstimator)
Estimator::Quantity Quantity
Quantity type.
void selfDisplay(std::ostream &out) const
Quantity eval(const Surfel s) const
Estimator * myEstimator
Alias of the estimator.
BOOST_CONCEPT_ASSERT((concepts::CSurfelLocalEstimator< TEstimator >))
Estimator::Surfel Surfel
Surfel type.
TEstimator Estimator
Estimator type.
EstimatorCache(const Self &other)
void init(const double aH, SurfelConstIterator itb, SurfelConstIterator ite)
OutputIterator eval(SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator result) const
BOOST_CONCEPT_ASSERT((boost::PairAssociativeContainer< TContainer >))
typename TetrahedronEstimator::Quantity Quantity
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Aim: This concept describes an object that can process a range of surfels (that are supposed to belon...
Go to http://www.sgi.com/tech/stl/PairAssociativeContainer.html.