10#include "../../defines.h"
11#include "../concepts.h"
13#include <Eigen/Geometry>
15#define PLANE_REQUIREMENTS ProvidesBasketUnitBase<T>
36 template <
class DataPo
int,
class _NFilter,
typename T>
37 requires PLANE_REQUIREMENTS
38 class Plane :
public T,
public Eigen::Hyperplane<typename DataPoint::Scalar, DataPoint::Dim>
40 PONCA_FITTING_DECLARE_DEFAULT_TYPES
44 using EigenBase = Eigen::Hyperplane<typename DataPoint::Scalar, DataPoint::Dim>;
58 EigenBase::coeffs().setZero();
66 return !EigenBase::coeffs().isApprox(EigenBase::Coefficients::Zero());
71 return EigenBase::isApprox(
other);
77 return !((*this) ==
other);
84 PONCA_MULTIARCH
inline void setPlane(
const VectorType&
_dir,
const VectorType&
_pos)
100 Base::m_nFilter.changeNeighborhoodFrame(
newbasis);
102 EigenBase::offset() -= EigenBase::normal().dot(
diff);
109 return EigenBase::signedDistance(VectorType::Zero());
117 const VectorType lq = Base::getNeighborFrame().convertToLocalBasis(
_q);
125 return Base::getNeighborFrame().convertToGlobalBasis(
126 EigenBase::projection(Base::getNeighborFrame().convertToLocalBasis(
_q)));
133 return EigenBase::normal();
140 return EigenBase::normal();
148 return EigenBase::signedDistance(
_lq);
154 return EigenBase::normal();
Aggregator class used to declare specialized structures using CRTP.
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.
Plane< DataPoint, _NFilter, T > & projectionOperator()
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 .
Plane< DataPoint, _NFilter, T > & implicitPrimitive()
Explicit conversion to Plane , to access methods potentially hidden by heritage.
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()
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.