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

Compute the barycenter of the input points + their normals. More...

#include <mean.h>

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

Public Types

using Scalar = typename DataPoint::Scalar
 Alias to scalar type.
 
using VectorType = typename Base::VectorType
 Alias to vector type.
 
using WFunctor = typename Base::WFunctor
 Alias to weight function.
 

Public Member Functions

MeanNormal< DataPoint, _WFunctor, T > & meanNormal ()
 Explicit conversion to MeanNormal , to access methods potentially hidden by heritage.
 
const MeanNormal< DataPoint, _WFunctor, T > & meanNormal () const
 Explicit conversion to MeanNormal , to access methods potentially hidden by heritage.
 
void init (const VectorType &_evalPos)
 Set the evaluation position and reset the internal states.
 
bool addLocalNeighbor (Scalar w, const VectorType &localQ, const DataPoint &attributes)
 Add a neighbor to perform the fit.
 
VectorType meanNormalVector () const
 Mean of the normals of the input points.
 

Protected Types

enum  { PROVIDES_MEAN_NORMAL }
 
using Base = T
 Base class of the procedure.
 

Protected Attributes

VectorType m_sumN
 Sum of the normal vectors.
 

Detailed Description

template<class DataPoint, class _WFunctor, typename T>
class Ponca::MeanNormal< DataPoint, _WFunctor, T >

Compute the barycenter of the input points + their normals.

Warning
The barycenter is not stored explicitly, but rather computed from the sum of the neighbors positions and normals.

This primitive provides:

PROVIDES_MEAN_NORMAL 
See also
MeanPosition
Note
This class should not derive from MeanPosition, as we might want to compute mean normals but without mean positions. This is done this way currently, because we do not want to duplicate the weighting functor, which is currently stored in MeanPosition.

Definition at line 65 of file mean.h.

Member Typedef Documentation

◆ Base

template<class DataPoint , class _WFunctor , typename T >
using Ponca::MeanNormal< DataPoint, _WFunctor, T >::Base = T
protected

Base class of the procedure.

Definition at line 66 of file mean.h.

◆ Scalar

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

Alias to scalar type.

Definition at line 66 of file mean.h.

◆ VectorType

template<class DataPoint , class _WFunctor , typename T >
using Ponca::MeanNormal< DataPoint, _WFunctor, T >::VectorType = typename Base::VectorType

Alias to vector type.

Definition at line 66 of file mean.h.

◆ WFunctor

template<class DataPoint , class _WFunctor , typename T >
using Ponca::MeanNormal< DataPoint, _WFunctor, T >::WFunctor = typename Base::WFunctor

Alias to weight function.

Definition at line 66 of file mean.h.

Member Enumeration Documentation

◆ anonymous enum

template<class DataPoint , class _WFunctor , typename T >
anonymous enum
protected

Definition at line 69 of file mean.h.

Member Function Documentation

◆ addLocalNeighbor()

template<class DataPoint , class _WFunctor , typename T >
bool MeanNormal::addLocalNeighbor ( Scalar  w,
const VectorType localQ,
const DataPoint &  attributes 
)
inline

Add a neighbor to perform the fit.

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

Definition at line 40 of file mean.hpp.

◆ init()

template<class DataPoint , class _WFunctor , typename T >
void MeanNormal::init ( const VectorType _evalPos)
inline

Set the evaluation position and reset the internal states.

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

Definition at line 31 of file mean.hpp.

◆ meanNormal() [1/2]

template<class DataPoint , class _WFunctor , typename T >
MeanNormal< DataPoint, _WFunctor, T > & Ponca::MeanNormal< DataPoint, _WFunctor, T >::meanNormal ( )
inline

Explicit conversion to MeanNormal , to access methods potentially hidden by heritage.

Definition at line 73 of file mean.h.

◆ meanNormal() [2/2]

template<class DataPoint , class _WFunctor , typename T >
const MeanNormal< DataPoint, _WFunctor, T > & Ponca::MeanNormal< DataPoint, _WFunctor, T >::meanNormal ( ) const
inline

Explicit conversion to MeanNormal , to access methods potentially hidden by heritage.

Definition at line 73 of file mean.h.

◆ meanNormalVector()

template<class DataPoint , class _WFunctor , typename T >
VectorType Ponca::MeanNormal< DataPoint, _WFunctor, T >::meanNormalVector ( ) const
inline

Mean of the normals of the input points.

Defined as \( n(\mathbf{x}) = \frac{\sum_i w_\mathbf{x}(\mathbf{p_i}) \mathbf{n_i}}{\sum_i w_\mathbf{x}(\mathbf{p_i})} \), where \(\left[\mathbf{p_i}, \mathbf{n_i} \in \text{neighborhood}(\mathbf{x})\right]\) are all the point and normal samples in \(\mathbf{x}\)'s neighborhood

Definition at line 81 of file mean.h.

Member Data Documentation

◆ m_sumN

template<class DataPoint , class _WFunctor , typename T >
VectorType Ponca::MeanNormal< DataPoint, _WFunctor, T >::m_sumN
protected

Sum of the normal vectors.

Definition at line 70 of file mean.h.