8#include "../../defines.h"
9#include "../concepts.h"
11#define MEAN_NORMAL_REQUIREMENTS ProvidesNormal<DataPoint>
12#define MEAN_POSITION_DER_REQUIREMENTS ProvidesBasketDiffUnitBase<T>&& ProvidesMeanPosition<T>
13#define MEAN_NORMAL_DER_REQUIREMENTS ProvidesBasketDiffUnitBase<T>&& ProvidesMeanNormal<T>
27 template <
class DataPo
int,
class _NFilter,
typename T>
30 PONCA_FITTING_DECLARE_DEFAULT_TYPES
36 PONCA_EXPLICIT_BASKET_CAST_OPERATORS(MeanPosition, meanPosition)
37 PONCA_FITTING_DECLARE_INIT
38 PONCA_FITTING_DECLARE_ADDNEIGHBOR
48 return Base::getNeighborFrame().convertToGlobalBasis(barycenterLocal());
67 PONCA_MULTIARCH
inline VectorType barycenterLocal()
const {
return (m_sumP / Base::getWeightSum()); }
69 PONCA_MULTIARCH
inline bool operator==(
const MeanPosition<DataPoint, NeighborFilter, T>& other)
const
71 return Base::operator==(other) && internal::isApprox(m_sumP, other.m_sumP);
85 template <
class DataPo
int,
class _NFilter,
typename T>
86 requires MEAN_NORMAL_REQUIREMENTS
89 PONCA_FITTING_DECLARE_DEFAULT_TYPES
96 PONCA_FITTING_DECLARE_INIT
97 PONCA_FITTING_DECLARE_ADDNEIGHBOR
105 PONCA_MULTIARCH [[nodiscard]]
inline VectorType meanNormalVector()
const
107 return (
m_sumN / Base::getWeightSum());
112 return Base::operator==(other) && internal::isApprox(m_sumN, other.
m_sumN);
128 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
129 requires MEAN_POSITION_DER_REQUIREMENTS
132 PONCA_FITTING_DECLARE_DEFAULT_TYPES
133 PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES
141 PONCA_FITTING_DECLARE_INIT
142 PONCA_FITTING_DECLARE_ADDNEIGHBOR_DER
170 PONCA_MULTIARCH [[nodiscard]]
VectorArray barycenterDerivatives()
const
172 return (
m_dSumP - Base::barycenterLocal() * Base::m_dSumW) / Base::getWeightSum();
175 PONCA_MULTIARCH
inline bool operator==(
178 return Base::operator==(other) && internal::isApprox(m_dSumP, other.
m_dSumP);
194 template <
class DataPo
int,
class _NFilter,
int DiffType,
typename T>
195 requires MEAN_NORMAL_DER_REQUIREMENTS
198 PONCA_FITTING_DECLARE_DEFAULT_TYPES
199 PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES
207 PONCA_FITTING_DECLARE_INIT
208 PONCA_FITTING_DECLARE_ADDNEIGHBOR_DER
238 PONCA_MULTIARCH [[nodiscard]]
VectorArray dMeanNormal()
const
240 return (
m_dSumN - Base::meanNormalVector() * Base::m_dSumW) / Base::getWeightSum();
245 return Base::operator==(other) && internal::isApprox(m_dSumN, other.
m_dSumN);
Compute the derivatives of the input points mean normal.
MeanNormalDer< DataPoint, _NFilter, DiffType, T > & meanNormalDer()
Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
typename Base::VectorArray VectorArray
Alias to vector derivatives array.
typename Base::VectorType VectorType
Alias to vector type.
VectorArray m_dSumN
Derivatives of the input normals of the input points vectors.
Compute the mean normal of the input points.
typename Base::VectorType VectorType
Alias to vector type.
MeanNormal< DataPoint, _NFilter, T > & meanNormal()
Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
VectorType m_sumN
Sum of the normal vectors.
Compute the derivatives of the input points barycenter.
typename Base::VectorType VectorType
Alias to vector type.
MeanPositionDer< DataPoint, _NFilter, DiffType, T > & meanPositionDer()
Explicit conversion to CLASSNAME, to access methods potentially hidden by heritage.
VectorArray m_dSumP
Derivatives of the input points vectors.
typename Base::VectorArray VectorArray
Alias to vector derivatives array.
Compute the barycenter of the input points.
VectorType m_sumP
Sum of the input points vectors.
typename Base::VectorType VectorType
Alias to vector type.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Ponca::MeanPosition T barycenter() const
where are all the point samples in 's neighborhood
Scalar barycenterDistance() const
The distance between the barycenter and the basis center.