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. 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... | |
unsigned long | 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... | |
Protected Member Functions | |
void | GetMgcVectorArray (std::vector< Wm4::Vector3< double > > &rcPts) const |
Creates a vector of Wm4::Vector3 elements. More... | |
Detailed Description
Abstract base class for approximation of a geometry to a given set of points.
Constructor & Destructor Documentation
◆ Approximation()
Approximation::Approximation | ( | ) |
Construction.
◆ ~Approximation()
|
virtual |
Destroys the object and frees any allocated resources.
References Clear().
Member Function Documentation
◆ AddPoint()
void Approximation::AddPoint | ( | const Base::Vector3f & | rcVector | ) |
Add point for the fit algorithm.
Referenced by MeshCore::MeshDistancePlanarSegment::AddFacet(), MeshCore::PlaneSurfaceFit::AddTriangle(), MeshCore::CylinderSurfaceFit::AddTriangle(), MeshCore::SphereSurfaceFit::AddTriangle(), Reen::ParameterCorrection::CalcEigenvectors(), MeshCore::MeshEigensystem::CalculateLocalSystem(), MeshCore::MeshRefPointToPoints::GetNormal(), MeshCore::AbstractPolygonTriangulator::GetTransformToFitPlane(), MeshCore::MeshDistancePlanarSegment::Initialize(), MeshCore::PlaneSurfaceFit::Initialize(), MeshCore::CylinderSurfaceFit::Initialize(), MeshCore::SphereSurfaceFit::Initialize(), MeshCore::MeshPlaneVisitor::MeshPlaneVisitor(), MeshCore::AbstractPolygonTriangulator::PostProcessing(), MeshCore::PlaneFitSmoothing::Smooth(), MeshCore::PlaneFitSmoothing::SmoothPoints(), and MeshCore::MeshPlaneVisitor::Visit().
◆ AddPoints() [1/4]
void Approximation::AddPoints | ( | const MeshPointArray & | points | ) |
Add points for the fit algorithm.
◆ AddPoints() [2/4]
void Approximation::AddPoints | ( | const std::list< Base::Vector3f > & | rsPointList | ) |
Add points for the fit algorithm.
◆ AddPoints() [3/4]
void Approximation::AddPoints | ( | const std::set< Base::Vector3f > & | rsPointSet | ) |
Add points for the fit algorithm.
◆ AddPoints() [4/4]
void Approximation::AddPoints | ( | const std::vector< Base::Vector3f > & | rvPointVect | ) |
Add points for the fit algorithm.
Referenced by ReverseEngineeringGui::Segmentation::accept(), MeshCore::FacetCurvature::Compute(), MeshCore::CylinderFit::Fit(), MeshCore::SphereFit::Fit(), MeshCore::CylinderFit::GetInitialAxisFromNormals(), MeshGui::PlaneFitParameter::getParameter(), MeshGui::CylinderFitParameter::getParameter(), MeshGui::SphereFitParameter::getParameter(), ReverseEngineeringGui::SegmentationManual::on_cylinderDetect_clicked(), ReverseEngineeringGui::SegmentationManual::on_planeDetect_clicked(), and ReverseEngineeringGui::SegmentationManual::on_sphereDetect_clicked().
◆ Clear()
void Approximation::Clear | ( | ) |
Deletes the inserted points and frees any allocated resources.
Referenced by MeshCore::MeshDistancePlanarSegment::Initialize(), MeshCore::PlaneSurfaceFit::Initialize(), MeshCore::CylinderSurfaceFit::Initialize(), MeshCore::SphereSurfaceFit::Initialize(), and ~Approximation().
◆ CountPoints()
unsigned long Approximation::CountPoints | ( | ) | const |
Determines the number of the current added points.
- Returns
- Number of points
Referenced by MeshCoreFit::SphereFit::Fit(), MeshCoreFit::CylinderFit::Fit(), MeshCore::PlaneFit::Fit(), MeshCore::QuadraticFit::Fit(), MeshCore::SurfaceFit::Fit(), MeshCore::CylinderFit::Fit(), MeshCore::SphereFit::Fit(), MeshCore::PlaneFit::GetSignedStdDeviation(), MeshCoreFit::SphereFit::GetStdDeviation(), MeshCoreFit::CylinderFit::GetStdDeviation(), MeshCore::PlaneFit::GetStdDeviation(), MeshCore::CylinderFit::GetStdDeviation(), MeshCore::SphereFit::GetStdDeviation(), and MeshCore::AbstractPolygonTriangulator::PostProcessing().
◆ Done()
bool Approximation::Done | ( | ) | const |
Returns true if Fit() has been called for the current set of points, false otherwise.
Referenced by MeshCore::MeshPlaneVisitor::AllowVisit(), MeshCore::PlaneSurfaceFit::Done(), MeshCore::CylinderSurfaceFit::Done(), MeshCore::SphereSurfaceFit::Done(), MeshCore::CylinderSurfaceFit::GetDistanceToSurface(), and MeshCore::MeshDistancePlanarSegment::TestFacet().
◆ 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::PolynomialFit, MeshCore::SphereFit, MeshCore::CylinderFit, MeshCore::SurfaceFit, MeshCore::QuadraticFit, MeshCore::PlaneFit, MeshCoreFit::CylinderFit, and MeshCoreFit::SphereFit.
◆ GetGravity()
Base::Vector3f Approximation::GetGravity | ( | ) | const |
Returns the center of gravity of the current added points.
- Returns
- Base::Vector3f
Referenced by MeshGui::CylinderFitParameter::getParameter(), ReverseEngineeringGui::SegmentationManual::on_cylinderDetect_clicked(), and MeshCore::PlaneFit::ProjectToPlane().
◆ GetLastResult()
float Approximation::GetLastResult | ( | ) | const |
Returns the result of the last fit.
- Returns
- float Quality of the last fit.
◆ GetMgcVectorArray()
|
protected |
Creates a vector of Wm4::Vector3 elements.
Referenced by MeshCore::QuadraticFit::Fit().
◆ GetPoints()
const std::list<Base::Vector3f>& MeshCore::Approximation::GetPoints | ( | ) | const |
Get all added points.
The documentation for this class was generated from the following files:
- src/Mod/Mesh/App/Core/Approximation.h
- src/Mod/Mesh/App/Core/Approximation.cpp