Ponca  7b3f8ad3fde25a027e6452783ccee143798a71b8
Point Cloud Analysis library
Loading...
Searching...
No Matches
mlsSphereFitDer.h
1/*
2 This Source Code Form is subject to the terms of the Mozilla Public
3 License, v. 2.0. If a copy of the MPL was not distributed with this
4 file, You can obtain one at http://mozilla.org/MPL/2.0/.
5*/
6
7#pragma once
8
9#include "../../defines.h"
10#include "../concepts.h"
11
12#define MLS_SPHERE_FIT_DER_REQUIREMENTS ProvidesAlgebraicSphere<T>&& ProvidesImplicitPrimitiveDerivative<T>
13
14namespace Ponca
15{
16
24 template <class DataPoint, class _NFilter, int DiffType, typename T>
25 requires MLS_SPHERE_FIT_DER_REQUIREMENTS
26 class MlsSphereFitDer : public T
27 {
28 PONCA_FITTING_DECLARE_DEFAULT_TYPES
29 PONCA_FITTING_DECLARE_DEFAULT_DER_TYPES
30 protected:
31 enum
32 {
33 Dim = DataPoint::Dim,
34 DerDim = Base::NbDerivatives
35 };
36
37 public:
49 using Matrix = Eigen::Matrix<Scalar, DerDim, DerDim>;
50
70 using MatrixArray = Eigen::Matrix<Scalar, DerDim, Dim * DerDim>;
71
72 protected:
73 // computation data
82 public:
83 // results
88 public:
89 PONCA_EXPLICIT_CAST_OPERATORS_DER(MlsSphereFitDer, mlsSphereFitDer)
90 PONCA_EXPLICIT_CAST_OPERATORS_DER(MlsSphereFitDer, implicitPrimitiveDer)
91
92 PONCA_FITTING_DECLARE_INIT_ADDDER_FINALIZE
93
96 PONCA_MULTIARCH [[nodiscard]] inline ScalarArray dPotential() const;
97
100
102 PONCA_MULTIARCH [[nodiscard]] inline VectorArray dNormal() const;
103
104 }; // class MlsSphereFitDer
105
106#include "mlsSphereFitDer.hpp"
107
108} // namespace Ponca
Aggregator class used to declare specialized structures using CRTP.
Definition basket.h:294
Extension performing derivation of the mls surface.
typename Base::ScalarArray ScalarArray
Alias to scalar derivatives array.
typename Base::VectorArray VectorArray
Alias to vector derivatives array.
Matrix m_d2SumDotPN
Sum of the dot product between relative positions and normals with second-order weight derivatives.
MlsSphereFitDer< DataPoint, _NFilter, DiffType, T > & implicitPrimitiveDer()
Explicit conversion to MlsSphereFitDer , to access methods potentially hidden by heritage.
ScalarArray dPotential() const
Returns the derivatives of the scalar field at the evaluation point.
Matrix m_d2Uc
Second derivative of the hyper-sphere constant term
VectorArray dNormal() const
Returns the second derivatives of the scalar field at the evaluation point.
Eigen::Matrix< Scalar, DerDim, DerDim > Matrix
Static squared matrix of scalars with a size adapted to the differentiation type.
MatrixArray m_d2SumN
Sum of normal vectors with second-order weight derivatives.
MatrixArray m_d2SumP
Sum of relative positions with second-order weight derivatives.
@ Dim
Dimension of the ambient space.
@ DerDim
Number of dimensions used for the differentiation.
VectorType primitiveGradient() const
Value of the normal of the primitive at the evaluation point.
Matrix m_d2SumDotPP
Sum of the squared relative positions with second-order weight derivatives.
Eigen::Matrix< Scalar, DerDim, Dim *DerDim > MatrixArray
Static matrix of scalars with a size adapted to the differentiation type and the dimension of the amb...
MatrixArray m_d2Ul
Second derivative of the hyper-sphere linear term
typename Base::VectorType VectorType
Alias to vector type.
MlsSphereFitDer< DataPoint, _NFilter, DiffType, T > & mlsSphereFitDer()
Explicit conversion to MlsSphereFitDer , to access methods potentially hidden by heritage.
Matrix m_d2SumW
Sum of queries weight with second-order weight derivatives.
Matrix m_d2Uq
Second derivative of the hyper-sphere quadratic term.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition concepts.h:11