Ponca  aa50bfdf187919869239c5b44b748842569114c1
Point Cloud Analysis library
Loading...
Searching...
No Matches
Ponca::PrimitiveBase< DataPoint, _WFunctor, T > Class Template Reference

Primitive base class. More...

#include <primitive.h>

+ Collaboration diagram for Ponca::PrimitiveBase< DataPoint, _WFunctor, T >:

Public Types

using Scalar = typename DataPoint::Scalar
 Inherited scalar type.
 
using VectorType = typename DataPoint::VectorType
 Inherited vector type.
 
using WFunctor = _WFunctor
 Weight Function.
 

Public Member Functions

void setWeightFunc (const WFunctor &_w)
 Init the WeightFunc, without changing the other internal states.
 
void init (const VectorType &_basisCenter=VectorType::Zero())
 Set the evaluation position and reset the internal states.
 
bool isReady () const
 Is the primitive well fitted an ready to use (finalize has been called)
 
bool isStable () const
 Is the fitted primitive ready to use (finalize has been called and the result is stable)
 
bool needAnotherPass () const
 Is another pass required for fitting (finalize has been called and the result is NEED_OTHER_PASS)
 
int getNumNeighbors () const
 Get number of points added in the neighborhood (with non negative weight)

 
Scalar getWeightSum () const
 Get the sum of the weights.
 
void startNewPass ()
 To be called when starting a new processing pass, ie.
 
const WFunctorgetWeightFunc () const
 Read access to the WeightFunc.
 
FIT_RESULT getCurrentState () const
 
bool addLocalNeighbor (Scalar w, const VectorType &, const DataPoint &)
 Add a neighbor to perform the fit.
 
FIT_RESULT finalize ()
 Finalize the procedure.
 

Protected Types

enum  { PROVIDES_PRIMITIVE_BASE }
 

Protected Attributes

FIT_RESULT m_eCurrentState {UNDEFINED}
 Represent the current state of the fit (finalize function update the state)
 
WFunctor m_w
 Weight function (must inherits BaseWeightFunc)
 

Detailed Description

template<class DataPoint, class _WFunctor, typename T = void>
class Ponca::PrimitiveBase< DataPoint, _WFunctor, T >

Primitive base class.

This class stores and provides public access to the fitting state, and must be inherited by classes implementing new primitives.

Note
This class should not be inherited explicitly: this is done by the #Basket class.

Definition at line 28 of file primitive.h.

Member Typedef Documentation

◆ Scalar

template<class DataPoint , class _WFunctor , typename T = void>
using Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::Scalar = typename DataPoint::Scalar

Inherited scalar type.

Definition at line 36 of file primitive.h.

◆ VectorType

template<class DataPoint , class _WFunctor , typename T = void>
using Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::VectorType = typename DataPoint::VectorType

Inherited vector type.

Definition at line 37 of file primitive.h.

◆ WFunctor

template<class DataPoint , class _WFunctor , typename T = void>
using Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::WFunctor = _WFunctor

Weight Function.

Definition at line 38 of file primitive.h.

Member Enumeration Documentation

◆ anonymous enum

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

Provides base API for primitives.

Definition at line 31 of file primitive.h.

Member Function Documentation

◆ addLocalNeighbor()

template<class DataPoint , class _WFunctor , typename T = void>
bool Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::addLocalNeighbor ( Scalar  w,
const VectorType ,
const DataPoint &   
)
inline

Add a neighbor to perform the fit.

Returns
false if param nei is not a valid neighbour (weight = 0)

Definition at line 114 of file primitive.h.

◆ finalize()

template<class DataPoint , class _WFunctor , typename T = void>
FIT_RESULT Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::finalize ( )
inline

Finalize the procedure.

Returns
Fitting Status
Warning
Must be called be for any use of the fitting output

Definition at line 121 of file primitive.h.

◆ getCurrentState()

template<class DataPoint , class _WFunctor , typename T = void>
FIT_RESULT Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::getCurrentState ( ) const
inline
Returns
the current test of the fit

Definition at line 108 of file primitive.h.

◆ getNumNeighbors()

template<class DataPoint , class _WFunctor , typename T = void>
int Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::getNumNeighbors ( ) const
inline

Get number of points added in the neighborhood (with non negative weight)

Definition at line 89 of file primitive.h.

◆ getWeightFunc()

template<class DataPoint , class _WFunctor , typename T = void>
const WFunctor & Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::getWeightFunc ( ) const
inline

Read access to the WeightFunc.

See also
setWeightFunc

Definition at line 101 of file primitive.h.

◆ getWeightSum()

template<class DataPoint , class _WFunctor , typename T = void>
Scalar Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::getWeightSum ( ) const
inline

Get the sum of the weights.

Definition at line 92 of file primitive.h.

◆ init()

template<class DataPoint , class _WFunctor , typename T = void>
void Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::init ( const VectorType _basisCenter = VectorType::Zero())
inline

Set the evaluation position and reset the internal states.

Warning
Must be called be for any computation (but after setWeightFunc)

Definition at line 66 of file primitive.h.

◆ isReady()

template<class DataPoint , class _WFunctor , typename T = void>
bool Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::isReady ( ) const
inline

Is the primitive well fitted an ready to use (finalize has been called)

Warning
The fit can be unstable (having neighbors between 3 and 6)

Definition at line 76 of file primitive.h.

◆ isStable()

template<class DataPoint , class _WFunctor , typename T = void>
bool Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::isStable ( ) const
inline

Is the fitted primitive ready to use (finalize has been called and the result is stable)

Definition at line 82 of file primitive.h.

◆ needAnotherPass()

template<class DataPoint , class _WFunctor , typename T = void>
bool Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::needAnotherPass ( ) const
inline

Is another pass required for fitting (finalize has been called and the result is NEED_OTHER_PASS)

See also
startNewPass

Definition at line 86 of file primitive.h.

◆ setWeightFunc()

template<class DataPoint , class _WFunctor , typename T = void>
void Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::setWeightFunc ( const WFunctor _w)
inline

Init the WeightFunc, without changing the other internal states.

Calls startNewPass internally.

Warning
Must be called be for any computation (and before init).
See also
getWeightFunc

Definition at line 61 of file primitive.h.

◆ startNewPass()

template<class DataPoint , class _WFunctor , typename T = void>
void Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::startNewPass ( )
inline

To be called when starting a new processing pass, ie.

when getCurrentState()==#NEED_ANOTHER_PASS

Definition at line 95 of file primitive.h.

Member Data Documentation

◆ m_eCurrentState

template<class DataPoint , class _WFunctor , typename T = void>
FIT_RESULT Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::m_eCurrentState {UNDEFINED}
protected

Represent the current state of the fit (finalize function update the state)

Definition at line 51 of file primitive.h.

◆ m_w

template<class DataPoint , class _WFunctor , typename T = void>
WFunctor Ponca::PrimitiveBase< DataPoint, _WFunctor, T >::m_w
protected

Weight function (must inherits BaseWeightFunc)

Definition at line 54 of file primitive.h.