12#include <Eigen/Geometry>
34template <
class DataPo
int,
class _WFunctor,
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 };
58 Base::init(_basisCenter);
59 EigenBase::coeffs().setZero();
65 PONCA_MULTIARCH
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,
93 return EigenBase::signedDistance(VectorType::Zero());
101 return EigenBase::signedDistance(Base::m_w.convertToLocalBasis(_q) );
108 return Base::m_w.convertToGlobalBasis(EigenBase::projection(Base::m_w.convertToLocalBasis(_q)));
115 return EigenBase::normal();
122 return EigenBase::normal();
Implicit hyperplane defined by an homogeneous vector .
Plane< DataPoint, _WFunctor, T > & plane()
Explicit conversion to Plane , to access methods potentially hidden by heritage.
Eigen::Hyperplane< typename DataPoint::Scalar, DataPoint::Dim > EigenBase
Specialization of Eigen::Hyperplane inherited by Ponca::Plane.
T Base
Base class of the procedure.
VectorType primitiveGradient() const
Scalar field gradient direction at the evaluation point.
VectorType project(const VectorType &_q) const
Project a point on the plane.
Plane()
Default constructor.
Plane< DataPoint, _WFunctor, T > & compactPlane()
Explicit conversion to Plane , to access methods potentially hidden by heritage.
Scalar potential(const VectorType &_q) const
Value of the scalar field at the location .
typename DataPoint::Scalar Scalar
Alias to scalar type.
bool isValid() const
Tell if the plane as been correctly set. Used to set CONFLICT_ERROR_FOUND during fitting.
Scalar potential() const
Value of the scalar field at the evaluation point.
VectorType primitiveGradient(const VectorType &) const
Scalar field gradient direction at .
typename Base::VectorType VectorType
Alias to vector type.
bool operator!=(const Plane< DataPoint, WFunctor, T > &other) const
Comparison operator, convenience function.
void init(const VectorType &_basisCenter=VectorType::Zero())
Set the scalar field values to 0.
This Source Code Form is subject to the terms of the Mozilla Public License, v.