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... | |
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... | |
Protected Member Functions | |
void | GetMgcVectorArray (std::vector< Wm4::Vector3< double > > &rcPts) const |
Creates a vector of Wm4::Vector3 elements. More... | |
Abstract base class for approximation of a geometry to a given set of points.
Approximation::Approximation | ( | ) |
Construction.
|
virtual |
Destroys the object and frees any allocated resources.
References Clear().
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::PlaneSurfaceFit::Initialize(), MeshCore::CylinderSurfaceFit::Initialize(), MeshCore::SphereSurfaceFit::Initialize(), MeshCore::MeshDistancePlanarSegment::Initialize(), MeshCore::MeshPlaneVisitor::MeshPlaneVisitor(), MeshCore::AbstractPolygonTriangulator::PostProcessing(), MeshCore::PlaneFitSmoothing::Smooth(), MeshCore::PlaneFitSmoothing::SmoothPoints(), and MeshCore::MeshPlaneVisitor::Visit().
void Approximation::AddPoints | ( | const MeshPointArray & | points | ) |
Add points for the fit algorithm.
void Approximation::AddPoints | ( | const std::list< Base::Vector3f > & | rsPointList | ) |
Add points for the fit algorithm.
void Approximation::AddPoints | ( | const std::set< Base::Vector3f > & | rsPointSet | ) |
Add points for the fit algorithm.
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().
void Approximation::Clear | ( | void | ) |
Deletes the inserted points and frees any allocated resources.
Referenced by MeshCore::PlaneSurfaceFit::Initialize(), MeshCore::CylinderSurfaceFit::Initialize(), MeshCore::SphereSurfaceFit::Initialize(), MeshCore::MeshDistancePlanarSegment::Initialize(), and ~Approximation().
std::size_t Approximation::CountPoints | ( | ) | const |
Determines the number of the current added points.
Referenced by MeshCore::PlaneFit::Fit(), MeshCore::QuadraticFit::Fit(), MeshCore::SurfaceFit::Fit(), MeshCore::CylinderFit::Fit(), MeshCore::SphereFit::Fit(), MeshCoreFit::CylinderFit::Fit(), MeshCoreFit::SphereFit::Fit(), MeshCore::PlaneFit::GetSignedStdDeviation(), MeshCore::PlaneFit::GetStdDeviation(), MeshCore::CylinderFit::GetStdDeviation(), MeshCore::SphereFit::GetStdDeviation(), MeshCoreFit::CylinderFit::GetStdDeviation(), MeshCoreFit::SphereFit::GetStdDeviation(), and MeshCore::AbstractPolygonTriangulator::PostProcessing().
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().
|
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, MeshCore::CylinderFit, MeshCore::SphereFit, MeshCore::PolynomialFit, MeshCoreFit::CylinderFit, and MeshCoreFit::SphereFit.
Base::Vector3f Approximation::GetGravity | ( | ) | const |
Returns the center of gravity of the current added points.
Referenced by MeshGui::CylinderFitParameter::getParameter(), ReverseEngineeringGui::SegmentationManual::on_cylinderDetect_clicked(), and MeshCore::PlaneFit::ProjectToPlane().
float Approximation::GetLastResult | ( | ) | const |
Returns the result of the last fit.
|
protected |
Creates a vector of Wm4::Vector3 elements.
Referenced by MeshCore::QuadraticFit::Fit().
const std::list< Base::Vector3f > & MeshCore::Approximation::GetPoints | ( | ) | const |
Get all added points.