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

Inherits Grenaille::PrimitiveBase< DataPoint, _WFunctor >.

Detailed Description

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

Algebraic Sphere primitive.

Method published in [3]

An algebraic hyper-sphere is defined as the \(0\)-isosurface of the scalar field

\( s_\mathbf{u}(\mathbf{x}) = \left[ 1 \; \mathbf{x}^T \; \mathbf{x}^T\mathbf{x}\right]^T \cdot \mathbf{u} \)

with \( \mathbf{u} \left[ u_c \; \mathbf{u_l} \; u_q\right]^T \) is the vector of the constant, linear and quadratic parameters.

Note
If internally the scalar fields are stored in a local frame defined by the evaluation position, the public methods involving a query (such as project, potential, gradient) have to be defined in global coordinates (e.g. you don't need to convert your query in the current locale frame).

This primitive provides:

PROVIDES_ALGEBRAIC_SPHERE 

Public Types

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

 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. More...
 
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
 

Public Attributes

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

enum  { PROVIDES_ALGEBRAIC_SPHERE }
 

Protected Attributes

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.
 

Member Enumeration Documentation

template<class DataPoint, class _WFunctor, typename T = void>
anonymous enum
protected
Enumerator
PROVIDES_ALGEBRAIC_SPHERE 

Provides Algebraic Sphere.

Member Function Documentation

template<class DataPoint, class _WFunctor, typename T = void>
bool Grenaille::AlgebraicSphere< DataPoint, _WFunctor, T >::applyPrattNorm ( )
inline

Normalize the scalar field by the Pratt norm.

Returns
false when the normalization fails (sphere is already normalized)
template<class DataPoint, class _WFunctor, typename T = void>
VectorType Grenaille::AlgebraicSphere< DataPoint, _WFunctor, T >::center ( )
inline

return the estimated center of the sphere

Warning
return Vector inf if the fitted surface is planar
template<class DataPoint, class _WFunctor, typename T = void>
bool Grenaille::AlgebraicSphere< DataPoint, _WFunctor, T >::isPlane ( ) const
inline

Used to know if the fitting result to a plane.

Returns
true if finalize() have been called and the fitting result to a plane
template<class DataPoint , class _WFunctor , typename T >
DataPoint::VectorType AlgebraicSphere::project ( const VectorType _q) const
inline

Project a point on the sphere.

Use gradient descent

template<class DataPoint, class _WFunctor, typename T = void>
Scalar Grenaille::AlgebraicSphere< DataPoint, _WFunctor, T >::radius ( )
inline

return the estimated radius of the sphere

Warning
return inf if the fitted surface is planar