Patate Lib  0.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Grenaille::Concept::FittingProcedureConcept< DataPoint, _WFunctor, T > Class Template Reference

Inherited by Grenaille::CovariancePlaneFit< DataPoint, _WFunctor, T >, Grenaille::OrientedSphereFit< DataPoint, _WFunctor, T >, and Grenaille::UnorientedSphereFit< DataPoint, _WFunctor, T >.

Detailed Description

template<class DataPoint, class _WFunctor, typename T = void>
class Grenaille::Concept::FittingProcedureConcept< DataPoint, _WFunctor, T >

Describes the procedure to fit a primitive to point samples.

A typical example use would go like this:

typedef Basket<MyPointStructure,MyWeightingFunction,MyFittingProcedure> Fit;
MyWeightingFunction w ( some_parameters );
// Create a fit object
Fit fit;
// init the internal state with respect to the reference position
fit.init( referencePosition );
// set the weighting function. Has no influence of the other internals
fit.setWeightFunc( w );
foreach neighbors of referencePosition
fit.addNeighbor(neighbor);
fit.finalize();
if(fit.isStable())
{
// use the fit
// ...
}

Public Member Functions

void setWeightFunc (const WFunctor &w)
 Init the WeightFunc, without changing the other internal states. More...
 
void init (const VectorType &evalPos)
 Set the evaluation position and reset the internal states. More...
 
bool addNeighbor (const DataPoint &nei)
 Add a neighbor to perform the fit. More...
 
FIT_RESULT finalize ()
 Finalize the fitting procedure. More...
 

Member Function Documentation

template<class DataPoint , class _WFunctor , typename T = void>
bool Grenaille::Concept::FittingProcedureConcept< DataPoint, _WFunctor, T >::addNeighbor ( const DataPoint &  nei)
inline

Add a neighbor to perform the fit.

Returns
false if param nei is not a valid neighbour (weight = 0)
template<class DataPoint , class _WFunctor , typename T = void>
FIT_RESULT Grenaille::Concept::FittingProcedureConcept< DataPoint, _WFunctor, T >::finalize ( )
inline

Finalize the fitting procedure.

Returns
the corresponding state of the fitting
Warning
Must be called be for any use of the fitting output
template<class DataPoint , class _WFunctor , typename T = void>
void Grenaille::Concept::FittingProcedureConcept< DataPoint, _WFunctor, T >::init ( const VectorType &  evalPos)
inline

Set the evaluation position and reset the internal states.

Warning
Must be called be for any computation
template<class DataPoint , class _WFunctor , typename T = void>
void Grenaille::Concept::FittingProcedureConcept< DataPoint, _WFunctor, T >::setWeightFunc ( const WFunctor &  w)
inline

Init the WeightFunc, without changing the other internal states.

Warning
Must be called be for any computation