DGtal 1.3.0
|
Aim: this class adapts any local surface estimator to cache the estimated values in a associative container (Surfel <-> estimated value). More...
#include <DGtal/geometry/surfaces/estimation/EstimatorCache.h>
Public Types | |
typedef TEstimator | Estimator |
Estimator type. More... | |
typedef TContainer | Container |
Container type. More... | |
typedef Estimator::Surfel | Surfel |
Surfel type. More... | |
typedef Estimator::Quantity | Quantity |
Quantity type. More... | |
typedef EstimatorCache< Estimator, Container > | Self |
Self. More... | |
Public Member Functions | |
BOOST_CONCEPT_ASSERT ((concepts::CSurfelLocalEstimator< TEstimator >)) | |
BOOST_CONCEPT_ASSERT ((boost::PairAssociativeContainer< TContainer >)) | |
EstimatorCache () | |
EstimatorCache (Alias< Estimator > anEstimator) | |
~EstimatorCache () | |
EstimatorCache (const Self &other) | |
Self & | operator= (const Self &other) |
template<typename SurfelConstIterator > | |
void | init (const double aH, SurfelConstIterator itb, SurfelConstIterator ite) |
template<typename SurfelConstIterator > | |
Quantity | eval (const SurfelConstIterator it) const |
Quantity | eval (const Surfel s) const |
template<typename SurfelConstIterator , typename OutputIterator > | |
OutputIterator | eval (SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator result) const |
double | h () const |
Container::size_type | size () const |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Private Attributes | |
Container | myContainer |
Instance of estimator. More... | |
Estimator * | myEstimator |
Alias of the estimator. More... | |
bool | myInit |
Init flag. More... | |
Aim: this class adapts any local surface estimator to cache the estimated values in a associative container (Surfel <-> estimated value).
Description of template class 'EstimatorCache'
The use-case of this class is when you want to estimate the same quantity several times.
This class implements eval() methods for surfel iterators as in concepts::CSurfelLocalEstimator concept. Addtitionnaly, we also have an eval method from a surfel.
This class is also a model of concepts::CSurfelLocalEstimator
TEstimator | any model of CSurfelLocalEstimator |
TContainer | the associative container to use (default type: std::map<Surfel,Quantity>) |
Definition at line 77 of file EstimatorCache.h.
typedef TContainer DGtal::EstimatorCache< TEstimator, TContainer >::Container |
Container type.
Definition at line 88 of file EstimatorCache.h.
typedef TEstimator DGtal::EstimatorCache< TEstimator, TContainer >::Estimator |
Estimator type.
Definition at line 84 of file EstimatorCache.h.
typedef Estimator::Quantity DGtal::EstimatorCache< TEstimator, TContainer >::Quantity |
Quantity type.
Definition at line 97 of file EstimatorCache.h.
typedef EstimatorCache<Estimator,Container> DGtal::EstimatorCache< TEstimator, TContainer >::Self |
Self.
Definition at line 100 of file EstimatorCache.h.
typedef Estimator::Surfel DGtal::EstimatorCache< TEstimator, TContainer >::Surfel |
Surfel type.
Definition at line 94 of file EstimatorCache.h.
|
inline |
|
inline |
Constructor from estimator instance.
Definition at line 112 of file EstimatorCache.h.
|
inline |
|
inline |
Copy constructor.
Definition at line 125 of file EstimatorCache.h.
DGtal::EstimatorCache< TEstimator, TContainer >::BOOST_CONCEPT_ASSERT | ( | (boost::PairAssociativeContainer< TContainer >) | ) |
DGtal::EstimatorCache< TEstimator, TContainer >::BOOST_CONCEPT_ASSERT | ( | (concepts::CSurfelLocalEstimator< TEstimator >) | ) |
|
inline |
Cached evaluation of the estimator at a surfel s
[in] | s | the iterator to the surfel to estimate. |
Definition at line 197 of file EstimatorCache.h.
References DGtal::EstimatorCache< TEstimator, TContainer >::myContainer, and DGtal::EstimatorCache< TEstimator, TContainer >::myInit.
|
inline |
Cached evaluation of the estimator at iterator it
SurfelConstIterator | a const iterator on surfels. |
[in] | it | the iterator to the surfel to estimate. |
Definition at line 183 of file EstimatorCache.h.
References DGtal::EstimatorCache< TEstimator, TContainer >::myContainer, and DGtal::EstimatorCache< TEstimator, TContainer >::myInit.
Referenced by DGtal::EstimatorCache< TEstimator, TContainer >::eval().
|
inline |
Cached range evaluation of the estimator between itb and ite.
SurfelConstIterator | a const iterator on surfels. |
[in] | itb | the begin iterator to the surfel to estimate. |
[in] | ite | the end iterator to the surfel to estimate. |
[in] | result | an output iterator on the result. |
Definition at line 218 of file EstimatorCache.h.
References DGtal::EstimatorCache< TEstimator, TContainer >::eval(), and DGtal::EstimatorCache< TEstimator, TContainer >::myInit.
|
inline |
Definition at line 236 of file EstimatorCache.h.
References DGtal::EstimatorCache< TEstimator, TContainer >::myEstimator.
|
inline |
Estimator initialization. This method initializes the underlying estimator and caches all estimated quantity between itb and ite.
SurfelConstIterator | a const iterator on surfels. |
[in] | aH | the gridstep |
[in] | ite | iterator on the first surfel of the surface. |
[in] | itb | iterator after the last surfel of the surface. |
Definition at line 158 of file EstimatorCache.h.
References DGtal::EstimatorCache< TEstimator, TContainer >::myContainer, DGtal::EstimatorCache< TEstimator, TContainer >::myEstimator, and DGtal::EstimatorCache< TEstimator, TContainer >::myInit.
|
inline |
Checks the validity/consistency of the object.
Definition at line 267 of file EstimatorCache.h.
References DGtal::EstimatorCache< TEstimator, TContainer >::myEstimator.
|
inline |
Assignment.
other | the object to copy. |
Definition at line 136 of file EstimatorCache.h.
References DGtal::EstimatorCache< TEstimator, TContainer >::myContainer, DGtal::EstimatorCache< TEstimator, TContainer >::myEstimator, and DGtal::EstimatorCache< TEstimator, TContainer >::myInit.
|
inline |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Definition at line 258 of file EstimatorCache.h.
References DGtal::EstimatorCache< TEstimator, TContainer >::myContainer.
|
inline |
Definition at line 248 of file EstimatorCache.h.
References DGtal::EstimatorCache< TEstimator, TContainer >::myContainer, and DGtal::EstimatorCache< TEstimator, TContainer >::myInit.
|
private |
Instance of estimator.
Definition at line 279 of file EstimatorCache.h.
Referenced by DGtal::EstimatorCache< TEstimator, TContainer >::eval(), DGtal::EstimatorCache< TEstimator, TContainer >::init(), DGtal::EstimatorCache< TEstimator, TContainer >::operator=(), DGtal::EstimatorCache< TEstimator, TContainer >::selfDisplay(), and DGtal::EstimatorCache< TEstimator, TContainer >::size().
|
private |
Alias of the estimator.
Definition at line 282 of file EstimatorCache.h.
Referenced by DGtal::EstimatorCache< TEstimator, TContainer >::h(), DGtal::EstimatorCache< TEstimator, TContainer >::init(), DGtal::EstimatorCache< TEstimator, TContainer >::isValid(), and DGtal::EstimatorCache< TEstimator, TContainer >::operator=().
|
private |
Init flag.
Definition at line 285 of file EstimatorCache.h.
Referenced by DGtal::EstimatorCache< TEstimator, TContainer >::eval(), DGtal::EstimatorCache< TEstimator, TContainer >::init(), DGtal::EstimatorCache< TEstimator, TContainer >::operator=(), and DGtal::EstimatorCache< TEstimator, TContainer >::size().