Ponca  8e4373a7fc557bbfb1afb9210d70f03872388d04
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 Member Functions

NeighborFiltergetNeighborFilter ()
 Write access to the NeighborFilter.
 

Protected Attributes

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 120 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 127 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 114 of file primitive.h.

◆ getNeighborFilter() [1/2]

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

Write access to the NeighborFilter.

See also
setNeighborFilter

Definition at line 107 of file primitive.h.

◆ getNeighborFilter() [2/2]

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 100 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 88 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 91 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 66 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 75 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 81 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 85 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 61 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 94 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 54 of file primitive.h.