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

Inherits Grenaille::Concept::FittingProcedureConcept< DataPoint, _WFunctor, T >, and Grenaille::AlgebraicSphere< DataPoint, _WFunctor >.

Detailed Description

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

Algebraic Sphere fitting procedure on oriented point sets.

Method published in [3].

See Also
AlgebraicSphere

Public Types

typedef Base::Scalar Scalar
 Scalar type inherited from DataPoint.
 
typedef Base::VectorType VectorType
 Vector type inherited from DataPoint.
 
typedef _WFunctor WFunctor
 Weight Function.
 
- Public Types inherited from Grenaille::AlgebraicSphere< DataPoint, _WFunctor >
typedef DataPoint::Scalar Scalar
 Scalar type inherited from DataPoint.
 
typedef DataPoint::VectorType VectorType
 Vector type inherited from DataPoint.
 
typedef _WFunctor WFunctor
 Weight Function.
 

Public Member Functions

 OrientedSphereFit ()
 Default constructor.
 
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...
 
Scalar potential () const
 Value of the scalar field at the evaluation point.
 
VectorType normal () const
 Value of the normal of the primitive at the evaluation point.
 
- Public Member Functions inherited from Grenaille::Concept::FittingProcedureConcept< DataPoint, _WFunctor, T >
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...
 
- Public Member Functions inherited from Grenaille::AlgebraicSphere< DataPoint, _WFunctor >
 AlgebraicSphere ()
 Default constructor.
 
void resetPrimitive ()
 Set the scalar field values to 0 and reset the isNormalized() status.
 
const VectorTypebasisCenter () const
 Reading access to the basis center (evaluation position)
 
VectorTypebasisCenter ()
 Writing access to the (evaluation position)
 
Scalar prattNorm () const
 compute the Pratt norm of the implicit scalar field.
 
Scalar prattNorm2 () const
 compute the squared Pratt norm of the implicit scalar field.
 
bool applyPrattNorm ()
 Normalize the scalar field by the Pratt norm. More...
 
Scalar radius ()
 return the estimated radius of the sphere More...
 
VectorType center ()
 return the estimated center of the sphere More...
 
bool isNormalized () const
 State indicating when the sphere has been normalized.
 
Scalar potential (const VectorType &_q) const
 Value of the scalar field at the location \( \mathbf{q} \).
 
VectorType project (const VectorType &_q) const
 Project a point on the sphere.
 
VectorType primitiveGradient (const VectorType &_q) const
 Approximation of the scalar field gradient at \( \mathbf{q} (not normalized) \).
 
bool isPlane () const
 Used to know if the fitting result to a plane. More...
 
- Public Member Functions inherited from Grenaille::PrimitiveBase< DataPoint, _WFunctor >
 PrimitiveBase ()
 Default constructor.
 
void resetPrimitive ()
 Reset fitting state status.
 
bool isReady () const
 Is the primitive well fitted an ready to use (finalize has been called) More...
 
bool isStable () const
 Is the plane fitted an ready to use (finalize has been called and the result is stable, eq. having more than 6 neighbors)
 
FIT_RESULT getCurrentState () const
 

Protected Attributes

VectorType m_sumN
 Sum of the normal vectors.
 
VectorType m_sumP
 Sum of the relative positions.
 
Scalar m_sumDotPN
 Sum of the dot product betwen relative positions and normals.
 
Scalar m_sumDotPP
 Sum of the squared relative positions.
 
Scalar m_sumW
 Sum of queries weight.
 
WFunctor m_w
 Weight function (must inherits BaseWeightFunc)
 
- Protected Attributes inherited from Grenaille::AlgebraicSphere< DataPoint, _WFunctor >
bool m_isNormalized
 Is the implicit scalar field normalized using Pratt.
 
- Protected Attributes inherited from Grenaille::PrimitiveBase< DataPoint, _WFunctor >
FIT_RESULT m_eCurrentState
 Represent the current state of the fit (finalize function update the state)
 
int m_nbNeighbors
 Give the number of neighbors.
 

Additional Inherited Members

- Public Attributes inherited from Grenaille::AlgebraicSphere< DataPoint, _WFunctor >
Scalar m_uc
 Constant parameter of the Algebraic hyper-sphere.
 
Scalar m_uq
 Quadratic parameter of the Algebraic hyper-sphere.
 
VectorType m_ul
 Linear parameter of the Algebraic hyper-sphere.
 
- Protected Types inherited from Grenaille::AlgebraicSphere< DataPoint, _WFunctor >
enum  
 

Member Function Documentation

template<class DataPoint , class _WFunctor , typename T >
bool OrientedSphereFit::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 >
FIT_RESULT OrientedSphereFit::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 OrientedSphereFit::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::OrientedSphereFit< 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