Approximation of a quadratic surface into a given set of points. More...
#include <Approximation.h>
Public Member Functions | |
void | CalcEigenValues (double &dLambda1, double &dLambda2, double &dLambda3, Base::Vector3f &clEV1, Base::Vector3f &clEV2, Base::Vector3f &clEV3) const |
Compute form matrix A and calculate Eigenvalues. More... | |
void | CalcZValues (double x, double y, double &dZ1, double &dZ2) const |
float | Fit () |
Invocation of fitting algorithm. More... | |
double | GetCoeff (std::size_t ulIndex) const |
Get the quadric coefficients. More... | |
const double & | GetCoeffArray () const |
Get the quadric coefficients as reference to the internal array. More... | |
bool | GetCurvatureInfo (double x, double y, double z, double &rfCurv0, double &rfcurv1) |
bool | GetCurvatureInfo (double x, double y, double z, double &rfCurv0, double &rfCurv1, Base::Vector3f &rkDir0, Base::Vector3f &rkDir1, double &dDistance) |
Calculate the curvatures of the quadric at a given point. More... | |
QuadraticFit () | |
Construction. More... | |
virtual | ~QuadraticFit () |
Destruction. More... | |
Public Member Functions inherited from MeshCore::Approximation | |
void | AddPoint (const Base::Vector3f &rcVector) |
Add point for the fit algorithm. More... | |
void | AddPoints (const MeshPointArray &points) |
Add points for the fit algorithm. More... | |
void | AddPoints (const std::list< Base::Vector3f > &rsPointList) |
Add points for the fit algorithm. More... | |
void | AddPoints (const std::set< Base::Vector3f > &rsPointSet) |
Add points for the fit algorithm. More... | |
void | AddPoints (const std::vector< Base::Vector3f > &rvPointVect) |
Add points for the fit algorithm. More... | |
Approximation () | |
Construction. More... | |
void | Clear () |
Deletes the inserted points and frees any allocated resources. More... | |
std::size_t | CountPoints () const |
Determines the number of the current added points. More... | |
bool | Done () const |
Returns true if Fit() has been called for the current set of points, false otherwise. More... | |
virtual float | Fit ()=0 |
Pure virtual function to fit the geometry to the given points. More... | |
Base::Vector3f | GetGravity () const |
Returns the center of gravity of the current added points. More... | |
float | GetLastResult () const |
Returns the result of the last fit. More... | |
const std::list< Base::Vector3f > & | GetPoints () const |
Get all added points. More... | |
virtual | ~Approximation () |
Destroys the object and frees any allocated resources. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from MeshCore::Approximation | |
void | GetMgcVectorArray (std::vector< Wm4::Vector3< double > > &rcPts) const |
Creates a vector of Wm4::Vector3 elements. More... | |
Approximation of a quadratic surface into a given set of points.
The implicit form of the surface is defined by F(x,y,z) = a * x^2 + b * y^2 + c * z^2 + 2d * x * y + 2e * x * z + 2f * y * z + g * x + h * y + * i * z + k = 0 Depending on the parameters (a,..,k) this surface defines a sphere, ellipsoid, cylinder, cone and so on.
MeshCore::QuadraticFit::QuadraticFit | ( | ) |
Construction.
|
virtual |
Destruction.
void QuadraticFit::CalcEigenValues | ( | double & | dLambda1, |
double & | dLambda2, | ||
double & | dLambda3, | ||
Base::Vector3f & | clEV1, | ||
Base::Vector3f & | clEV2, | ||
Base::Vector3f & | clEV3 | ||
) | const |
Compute form matrix A and calculate Eigenvalues.
dLambda1 | Eigenvalue 1 |
dLambda2 | Eigenvalue 2 |
dLambda3 | Eigenvalue 3 |
clEV1 | Eigenvector 1 |
clEV2 | Eigenvector 2 |
clEV3 | Eigenvector 3 |
void QuadraticFit::CalcZValues | ( | double | x, |
double | y, | ||
double & | dZ1, | ||
double & | dZ2 | ||
) | const |
|
virtual |
Invocation of fitting algorithm.
Implements MeshCore::Approximation.
References MeshCore::Approximation::CountPoints(), and MeshCore::Approximation::GetMgcVectorArray().
double QuadraticFit::GetCoeff | ( | std::size_t | ulIndex | ) | const |
Get the quadric coefficients.
ulIndex | Number of coefficient (0..9) |
const double & QuadraticFit::GetCoeffArray | ( | ) | const |
Get the quadric coefficients as reference to the internal array.
bool QuadraticFit::GetCurvatureInfo | ( | double | x, |
double | y, | ||
double | z, | ||
double & | rfCurv0, | ||
double & | rfcurv1 | ||
) |
References MeshCore::FunctionContainer::CurvatureInfo().
bool QuadraticFit::GetCurvatureInfo | ( | double | x, |
double | y, | ||
double | z, | ||
double & | rfCurv0, | ||
double & | rfCurv1, | ||
Base::Vector3f & | rkDir0, | ||
Base::Vector3f & | rkDir1, | ||
double & | dDistance | ||
) |
Calculate the curvatures of the quadric at a given point.
x | X-coordinate |
y | Y-coordinate |
z | Z-coordinate |
rfCurv0 | 1. principal curvature |
rfCurv1 | 2. principal curvature |
rkDir0 | Direction of 1. principal curvature |
rkDir1 | Direction of 2. principal curvature |
dDistance |
References MeshCore::FunctionContainer::CurvatureInfo(), MeshCore::FunctionContainer::GetGradient(), and Base::Vector3< _Precision >::Length().