Ponca  7b3f8ad3fde25a027e6452783ccee143798a71b8
Point Cloud Analysis library
Loading...
Searching...
No Matches
sphereFit.h
1/*
2This Source Code Form is subject to the terms of the Mozilla Public
3License, v. 2.0. If a copy of the MPL was not distributed with this
4file, You can obtain one at http://mozilla.org/MPL/2.0/.
5*/
6
7#pragma once
8#include "../../defines.h"
9#include "../concepts.h"
10
11#include "../primitive/algebraicSphere.h" // used to define SphereFit
12
13#define SPHERE_FIT_REQUIREMENTS ProvidesAlgebraicSphere<T>
14
15namespace Ponca
16{
17
60 template <class DataPoint, class _NFilter, typename T>
61 requires SPHERE_FIT_REQUIREMENTS
62 class SphereFitImpl : public T
63 {
64 PONCA_FITTING_DECLARE_DEFAULT_TYPES
65 protected:
66 using VectorA = Eigen::Matrix<Scalar, DataPoint::Dim + 2, 1>;
67 using MatrixA = Eigen::Matrix<Scalar, DataPoint::Dim + 2, DataPoint::Dim + 2>;
68
69 public:
70 using Solver = Eigen::EigenSolver<MatrixA>;
71
72 protected:
73 // computation data
74 MatrixA m_matA{MatrixA::Zero()};
76 Solver m_solver;
77
78 public:
79 PONCA_EXPLICIT_CAST_OPERATORS(SphereFitImpl, sphereFit)
80 PONCA_FITTING_DECLARE_INIT_ADD_FINALIZE
81 PONCA_FITTING_IS_SIGNED(false)
82
83 PONCA_MULTIARCH inline const Solver& solver() const { return m_solver; }
84
85 }; // class SphereFit
86
88 template <class DataPoint, class _NFilter, typename T>
90
91#include "sphereFit.hpp"
92
93} // namespace Ponca
Aggregator class used to declare specialized structures using CRTP.
Definition basket.h:294
Algebraic Sphere fitting procedure on point set without normals.
Definition sphereFit.h:63
MatrixA m_matA
Covariance matrix of [1, p, p^2].
Definition sphereFit.h:74
SphereFitImpl< DataPoint, _NFilter, T > & sphereFit()
Explicit conversion to SphereFitImpl , to access methods potentially hidden by heritage.
Definition sphereFit.h:79
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition concepts.h:11