10#include "../../defines.h"
11#include "../concepts.h"
13#include "../primitive/plane.h"
14#include "../tools/mean.h"
16#define MEAN_PLANE_REQUIREMENTS ProvidesMeanPosition<T>&& ProvidesMeanNormal<T>&& ProvidesPlane<T>
31 template <
class DataPo
int,
class _NFilter,
typename T>
32 requires MEAN_PLANE_REQUIREMENTS
35 PONCA_FITTING_DECLARE_DEFAULT_TYPES
36 PONCA_FITTING_DECLARE_MATRIX_TYPE
40 PONCA_FITTING_APIDOC_FINALIZE
44 if (Base::finalize() ==
STABLE)
46 if (Base::plane().isValid())
48 Base::setPlane(Base::m_sumN / Base::getWeightSum(), Base::barycenterLocal());
50 return Base::m_eCurrentState;
52 PONCA_FITTING_IS_SIGNED(
true)
57 template <
class DataPo
int,
class _NFilter,
typename T>
Aggregator class used to declare specialized structures using CRTP.
Plane fitting procedure computing the mean position and orientation from oriented points.
FIT_RESULT finalize()
Finalize the procedure.
MeanPlaneFitImpl< DataPoint, _NFilter, T > & meanPlaneFit()
Explicit conversion to MeanPlaneFitImpl , to access methods potentially hidden by heritage.
This Source Code Form is subject to the terms of the Mozilla Public License, v.
FIT_RESULT
Enum corresponding to the state of a fitting method (and what the finalize function returns)
@ CONFLICT_ERROR_FOUND
Multiple classes of the fitting procedure initialize the primitive.
@ STABLE
The fitting is stable and ready to use.