12#include <Eigen/Geometry>
34template <
class DataPo
int,
class _NFilter,
typename T >
36 public Eigen::Hyperplane<typename DataPoint::Scalar, DataPoint::Dim >
38 PONCA_FITTING_DECLARE_DEFAULT_TYPES
42 using EigenBase = Eigen::Hyperplane<typename DataPoint::Scalar, DataPoint::Dim >;
45 enum { check = Base::PROVIDES_PRIMITIVE_BASE, PROVIDES_PLANE };
56 PONCA_MULTIARCH inline
void init()
59 EigenBase::coeffs().setZero();
65 PONCA_MULTIARCH [[nodiscard]]
inline bool isValid()
const{
66 return ! EigenBase::coeffs().isApprox(EigenBase::Coefficients::Zero());
70 return EigenBase::isApprox(other);
75 return ! ((*this) == other);
82 PONCA_MULTIARCH
inline void setPlane (
const VectorType& _dir,
98 VectorType diff = Base::getNeighborFilter().evalPos() - newbasis;
99 Base::getNeighborFilter().changeNeighborhoodFrame(newbasis);
101 EigenBase::offset() -= EigenBase::normal().dot(diff);
108 return EigenBase::signedDistance(VectorType::Zero());
116 const VectorType lq = Base::getNeighborFilter().convertToLocalBasis(_q);
124 return Base::getNeighborFilter().convertToGlobalBasis(EigenBase::projection(Base::getNeighborFilter().convertToLocalBasis(_q)));
131 return EigenBase::normal();
138 return EigenBase::normal();
144 return EigenBase::signedDistance(_lq);
148 return EigenBase::normal();
Implicit hyperplane defined by an homogeneous vector .
Eigen::Hyperplane< typename DataPoint::Scalar, DataPoint::Dim > EigenBase
Specialization of Eigen::Hyperplane inherited by Ponca::Plane.
VectorType project(const VectorType &_q) const
Project a point on the plane.
bool isValid() const
Tell if the plane as been correctly set. Used to set CONFLICT_ERROR_FOUND during fitting.
typename Base::VectorType VectorType
Alias to vector type.
VectorType primitiveGradientLocal(const VectorType &) const
Scalar field gradient direction at the evaluation point.
T Base
Base class of the procedure.
Scalar potential(const VectorType &_q) const
Value of the scalar field at the location .
VectorType primitiveGradient(const VectorType &) const
Scalar field gradient direction at .
Scalar potential() const
Value of the scalar field at the evaluation point.
typename DataPoint::Scalar Scalar
Alias to scalar type.
Plane< DataPoint, _NFilter, T > & plane()
Explicit conversion to Plane , to access methods potentially hidden by heritage.
bool operator!=(const Plane< DataPoint, NeighborFilter, T > &other) const
Comparison operator, convenience function.
Plane< DataPoint, _NFilter, T > & compactPlane()
Explicit conversion to Plane , to access methods potentially hidden by heritage.
Plane()
Default constructor.
VectorType primitiveGradient() const
Scalar field gradient direction at the evaluation point.
void changeBasis(const VectorType &newbasis)
Express the scalar field relatively to a new basis.
Scalar potentialLocal(const VectorType &_lq) const
Value of the scalar field at the evaluation point.
void init()
Set the scalar field values to 0.
This Source Code Form is subject to the terms of the Mozilla Public License, v.