3#include <Core/RaCore.hpp>
6#include <Eigen/Eigenvalues>
30 static constexpr int DIM = _DIM;
31 using Matrix = Eigen::Matrix<Scalar, DIM, DIM>;
32 using Vector = Eigen::Matrix<Scalar, DIM, 1>;
38 Quadric(
const Matrix& a,
const Vector& b,
double c ) : m_a( a ), m_b( b ), m_c( c ) {}
46 Quadric(
const Vector& n, Scalar ndotp );
52 inline const Matrix&
getA()
const;
53 inline void setA(
const Matrix& a );
55 inline const Vector& getB()
const;
56 inline void setB(
const Vector& b );
58 inline const double& getC()
const;
59 inline void setC(
const double& c );
64 [[deprecated]]
void compute(
const Vector& n,
double ndotp );
68 inline typename Eigen::EigenSolver<Matrix3>::EigenvectorsType computeEigenVectorsA();
73 inline Quadric operator*(
const Scalar scal );
76 inline Quadric& operator*=( Scalar scal );
92 m_a( n * n.transpose() ), m_b( ndotp * n ), m_c( ndotp * ndotp ) {}
99 m_a = n * n.transpose();
120inline void Quadric<DIM>::setB(
const Vector& b ) {
125inline const double& Quadric<DIM>::getC()
const {
130inline void Quadric<DIM>::setC(
const double& c ) {
136 typename Eigen::EigenSolver<Matrix3> es( m_a );
137 return es.eigenvalues();
142 typename Eigen::EigenSolver<Matrix3> es( m_a );
143 return es.eigenvectors();
153 return Quadric<DIM>( m_a * scal, m_b * scal, m_c * scal );
165inline Quadric<DIM>& Quadric<DIM>::operator*=( Scalar scal ) {
void compute(const Vector &n, double ndotp)
Quadric()
Construct an initialized quadric.
const Matrix & getA() const
Getters and setters.
Quadric(const Matrix &a, const Vector &b, double c)
Construct and initialize a quadric.
Eigen::EigenSolver< Matrix3 >::EigenvalueType computeEigenValuesA()
Computes eigen values and vectors of matrix A.
Quadric operator+(const Quadric &q) const
Operators.
hepler function to manage enum as underlying types in VariableSet