Abstract base class for approximation of a geometry to a given set of points. More...
#include <Approximation.h>
Public Member Functions | |
void | AddPoint (const Base::Vector3f &rcVector) |
Add point for the fit algorithm. | |
void | AddPoints (const std::list< Base::Vector3f > &rsPointList) |
Add points for the fit algorithm. | |
void | AddPoints (const std::set< Base::Vector3f > &rsPointSet) |
Add points for the fit algorithm. | |
void | AddPoints (const std::vector< Base::Vector3f > &rvPointVect) |
Add points for the fit algorithm. | |
Approximation () | |
Construction. | |
void | Clear () |
Deletes the inserted points and frees any allocated resources. | |
unsigned long | CountPoints () const |
Determines the number of the current added points. | |
bool | Done () const |
Returns true if Fit() has been called for the current set of points, false otherwise. | |
virtual float | Fit ()=0 |
Pure virtual function to fit the geometry to the given points. | |
Base::Vector3f | GetGravity () const |
Returns the center of gravity of the current added points. | |
float | GetLastResult () const |
Returns the result of the last fit. | |
const std::list< Base::Vector3f > & | GetPoints () const |
Get all added points. | |
virtual | ~Approximation () |
Destroys the object and frees any allocated resources. | |
Protected Member Functions | |
void | GetMgcVectorArray (std::vector< Wm4::Vector3< float > > &rcPts) const |
Creates a vector of Wm4::Vector3 elements. | |
Static Protected Member Functions | |
static void | Convert (const Base::Vector3f &, Wm4::Vector3< float > &) |
Converts point from Base::Vector3f to Wm4::Vector3. | |
static void | Convert (const Wm4::Vector3< float > &, Base::Vector3f &) |
Converts point from Wm4::Vector3 to Base::Vector3f. | |
Protected Attributes | |
bool | _bIsFitted |
Flag, whether the fit has been called. | |
float | _fLastResult |
Stores the last result of the fit. | |
std::list< Base::Vector3f > | _vPoints |
Holds the points for the fit algorithm. |
Abstract base class for approximation of a geometry to a given set of points.
Definition at line 43 of file Approximation.h.
MeshCore::Approximation::Approximation | ( | ) | [inline] |
Construction.
Definition at line 49 of file Approximation.h.
virtual MeshCore::Approximation::~Approximation | ( | ) | [inline, virtual] |
Destroys the object and frees any allocated resources.
Definition at line 53 of file Approximation.h.
void Approximation::AddPoint | ( | const Base::Vector3f & | rcVector | ) |
Add point for the fit algorithm.
Definition at line 80 of file Approximation.cpp.
References _bIsFitted, and _vPoints.
Referenced by Reen::ParameterCorrection::CalcEigenvectors(), MeshCore::MeshEigensystem::CalculateLocalSystem(), MeshCore::MeshRefPointToPoints::GetNormal(), MeshCore::AbstractPolygonTriangulator::GetTransformToFitPlane(), MeshCore::MeshPlaneVisitor::MeshPlaneVisitor(), MeshCore::AbstractPolygonTriangulator::ProjectOntoSurface(), MeshCore::MeshSmoothing::Smooth(), and MeshCore::MeshPlaneVisitor::Visit().
void Approximation::AddPoints | ( | const std::list< Base::Vector3f > & | rsPointList | ) |
Add points for the fit algorithm.
Definition at line 102 of file Approximation.cpp.
References _bIsFitted, and _vPoints.
void Approximation::AddPoints | ( | const std::set< Base::Vector3f > & | rsPointSet | ) |
Add points for the fit algorithm.
Definition at line 94 of file Approximation.cpp.
References _bIsFitted, and _vPoints.
void Approximation::AddPoints | ( | const std::vector< Base::Vector3f > & | rvPointVect | ) |
Add points for the fit algorithm.
Definition at line 86 of file Approximation.cpp.
References _bIsFitted, and _vPoints.
Referenced by CmdApproxPlane::activated(), and best_fit::PointCloud_Coarse().
void Approximation::Clear | ( | void | ) |
Deletes the inserted points and frees any allocated resources.
Definition at line 124 of file Approximation.cpp.
References _bIsFitted, and _vPoints.
Referenced by best_fit::PointCloud_Coarse().
void Approximation::Convert | ( | const Base::Vector3f & | pt, | |
Wm4::Vector3< float > & | Wm4 | |||
) | [static, protected] |
Converts point from Base::Vector3f to Wm4::Vector3.
Definition at line 66 of file Approximation.cpp.
References Base::Vector3< _Precision >::x, Wm4::Vector3< Real >::X(), Base::Vector3< _Precision >::y, Wm4::Vector3< Real >::Y(), Base::Vector3< _Precision >::z, and Wm4::Vector3< Real >::Z().
void Approximation::Convert | ( | const Wm4::Vector3< float > & | Wm4, | |
Base::Vector3f & | pt | |||
) | [static, protected] |
Converts point from Wm4::Vector3 to Base::Vector3f.
Definition at line 61 of file Approximation.cpp.
References Base::Vector3< _Precision >::Set(), Wm4::Vector3< Real >::X(), Wm4::Vector3< Real >::Y(), and Wm4::Vector3< Real >::Z().
Referenced by MeshCore::QuadraticFit::CalcEigenValues(), MeshCore::SurfaceFit::GetCurvatureInfo(), and MeshCore::QuadraticFit::GetCurvatureInfo().
unsigned long Approximation::CountPoints | ( | ) | const |
Determines the number of the current added points.
Definition at line 119 of file Approximation.cpp.
References _vPoints.
Referenced by MeshCore::SurfaceFit::Fit(), MeshCore::QuadraticFit::Fit(), MeshCore::PlaneFit::Fit(), MeshCore::PlaneFit::GetSignedStdDeviation(), MeshCore::PlaneFit::GetStdDeviation(), and MeshCore::AbstractPolygonTriangulator::ProjectOntoSurface().
bool Approximation::Done | ( | ) | const |
Returns true if Fit() has been called for the current set of points, false otherwise.
Definition at line 135 of file Approximation.cpp.
References _bIsFitted.
Referenced by MeshCore::MeshPlaneVisitor::AllowVisit().
virtual float MeshCore::Approximation::Fit | ( | ) | [pure virtual] |
Pure virtual function to fit the geometry to the given points.
This function must be implemented by every subclass.
Implemented in MeshCore::PlaneFit, MeshCore::QuadraticFit, MeshCore::SurfaceFit, and MeshCore::PolynomialFit.
Base::Vector3f Approximation::GetGravity | ( | ) | const |
Returns the center of gravity of the current added points.
Definition at line 110 of file Approximation.cpp.
References _vPoints.
Referenced by best_fit::PointCloud_Coarse(), and MeshCore::PlaneFit::ProjectToPlane().
float Approximation::GetLastResult | ( | ) | const |
Returns the result of the last fit.
Definition at line 130 of file Approximation.cpp.
References _fLastResult.
void Approximation::GetMgcVectorArray | ( | std::vector< Wm4::Vector3< float > > & | rcPts | ) | const [protected] |
Creates a vector of Wm4::Vector3 elements.
Definition at line 71 of file Approximation.cpp.
References _vPoints.
Referenced by MeshCore::QuadraticFit::Fit().
const std::list<Base::Vector3f>& MeshCore::Approximation::GetPoints | ( | ) | const [inline] |
Get all added points.
Definition at line 73 of file Approximation.h.
bool MeshCore::Approximation::_bIsFitted [protected] |
Flag, whether the fit has been called.
Definition at line 119 of file Approximation.h.
Referenced by AddPoint(), AddPoints(), MeshCore::QuadraticFit::CalcEigenValues(), MeshCore::QuadraticFit::CalcZValues(), Clear(), Done(), MeshCore::SurfaceFit::Fit(), MeshCore::QuadraticFit::Fit(), MeshCore::PlaneFit::Fit(), MeshCore::PlaneFit::GetBase(), MeshCore::QuadraticFit::GetCoeff(), MeshCore::SurfaceFit::GetCurvatureInfo(), MeshCore::QuadraticFit::GetCurvatureInfo(), MeshCore::PlaneFit::GetDirU(), MeshCore::PlaneFit::GetDirV(), MeshCore::PlaneFit::GetDistanceToPlane(), MeshCore::PlaneFit::GetNormal(), MeshCore::PlaneFit::GetSignedStdDeviation(), MeshCore::PlaneFit::GetStdDeviation(), and MeshCore::SurfaceFit::Value().
float MeshCore::Approximation::_fLastResult [protected] |
Stores the last result of the fit.
Definition at line 120 of file Approximation.h.
Referenced by MeshCore::SurfaceFit::Fit(), MeshCore::QuadraticFit::Fit(), MeshCore::PlaneFit::Fit(), and GetLastResult().
std::list< Base::Vector3f > MeshCore::Approximation::_vPoints [protected] |
Holds the points for the fit algorithm.
Definition at line 118 of file Approximation.h.
Referenced by AddPoint(), AddPoints(), Clear(), CountPoints(), MeshCore::PolynomialFit::Fit(), MeshCore::PlaneFit::Fit(), GetGravity(), GetMgcVectorArray(), MeshCore::PlaneFit::GetSignedStdDeviation(), MeshCore::PlaneFit::GetStdDeviation(), MeshCore::SurfaceFit::PolynomFit(), and MeshCore::PlaneFit::ProjectToPlane().