Ponca  e26a0e88a45818354616c1a7180bcd203aecad3c
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
9#include "./algebraicSphere.h"
10
11
12namespace Ponca
13{
14
55template < class DataPoint, class _WFunctor, typename T >
56class SphereFitImpl : public T
57{
58PONCA_FITTING_DECLARE_DEFAULT_TYPES
59
60protected:
61 enum
62 {
63 Check = Base::PROVIDES_ALGEBRAIC_SPHERE
64 };
65protected:
66 typedef Eigen::Matrix<Scalar, DataPoint::Dim+2, 1> VectorA;
67 typedef Eigen::Matrix<Scalar, DataPoint::Dim+2, DataPoint::Dim+2> MatrixA;
68
69public:
70 using Solver = Eigen::EigenSolver<MatrixA>;
71
72protected:
73 // computation data
74 MatrixA m_matA {MatrixA::Zero()};
76 Solver m_solver;
77
78public:
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
88template < class DataPoint, class _WFunctor, typename T>
89using SphereFit =
90 SphereFitImpl<DataPoint, _WFunctor,
92
93
94
95#include "sphereFit.hpp"
96
97} //namespace Ponca
Algebraic Sphere primitive.
Algebraic Sphere fitting procedure on point set without normals.
Definition: sphereFit.h:57
MatrixA m_matA
Covariance matrix of [1, p, p^2].
Definition: sphereFit.h:74
SphereFitImpl< DataPoint, _WFunctor, 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.