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

Primitive base class. More...

#include <primitive.h>

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

Public Types

using Scalar = typename DataPoint::Scalar
 Inherited scalar type.
 
using VectorType = typename DataPoint::VectorType
 Inherited vector type.
 
using NeighborFilter = _NFilter
 Filter applied on each neighbor.
 

Public Member Functions

void setNeighborFilter (const NeighborFilter &_nFilter)
 Init the WeightFunc, without changing the other internal states.
 
void init ()
 Set the evaluation position and reset the internal states.
 
bool isReady () const
 Is the primitive well fitted and 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 NeighborFiltergetNeighborFilter () const
 Read access to the NeighborFilter.
 
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

NeighborFilter m_nFilter
 Neighborhood filter.
 
FIT_RESULT m_eCurrentState {UNDEFINED}
 Represent the current state of the fit (finalize function update the state)
 

Detailed Description

template<class DataPoint, class _NFilter, typename T = void>
class Ponca::PrimitiveBase< DataPoint, _NFilter, 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

◆ NeighborFilter

template<class DataPoint , class _NFilter , typename T = void>
using Ponca::PrimitiveBase< DataPoint, _NFilter, T >::NeighborFilter = _NFilter

Filter applied on each neighbor.

Definition at line 38 of file primitive.h.

◆ Scalar

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

Inherited scalar type.

Definition at line 36 of file primitive.h.

◆ VectorType

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

Inherited vector type.

Definition at line 37 of file primitive.h.

Member Enumeration Documentation

◆ anonymous enum

template<class DataPoint , class _NFilter , 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 _NFilter , typename T = void>
bool Ponca::PrimitiveBase< DataPoint, _NFilter, 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 112 of file primitive.h.

◆ finalize()

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

Finalize the procedure.

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

Definition at line 119 of file primitive.h.

◆ getCurrentState()

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

Definition at line 106 of file primitive.h.

◆ getNeighborFilter()

template<class DataPoint , class _NFilter , typename T = void>
const NeighborFilter & Ponca::PrimitiveBase< DataPoint, _NFilter, T >::getNeighborFilter ( ) const
inline

Read access to the NeighborFilter.

See also
setNeighborFilter

Definition at line 99 of file primitive.h.

◆ getNumNeighbors()

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

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

Definition at line 87 of file primitive.h.

◆ getWeightSum()

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

Get the sum of the weights.

Definition at line 90 of file primitive.h.

◆ init()

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

Set the evaluation position and reset the internal states.

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

Definition at line 65 of file primitive.h.

◆ isReady()

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

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

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

Definition at line 74 of file primitive.h.

◆ isStable()

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

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

Definition at line 80 of file primitive.h.

◆ needAnotherPass()

template<class DataPoint , class _NFilter , typename T = void>
bool Ponca::PrimitiveBase< DataPoint, _NFilter, 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 84 of file primitive.h.

◆ setNeighborFilter()

template<class DataPoint , class _NFilter , typename T = void>
void Ponca::PrimitiveBase< DataPoint, _NFilter, T >::setNeighborFilter ( const NeighborFilter _nFilter)
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 60 of file primitive.h.

◆ startNewPass()

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

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

when getCurrentState()==#NEED_ANOTHER_PASS

Definition at line 93 of file primitive.h.

Member Data Documentation

◆ m_eCurrentState

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

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

Definition at line 53 of file primitive.h.

◆ m_nFilter

template<class DataPoint , class _NFilter , typename T = void>
NeighborFilter Ponca::PrimitiveBase< DataPoint, _NFilter, T >::m_nFilter
protected

Neighborhood filter.

Definition at line 49 of file primitive.h.