MeshCore::Approximation Class Reference

Abstract base class for approximation of a geometry to a given set of points. More...

#include <Approximation.h>

Inheritance diagram for MeshCore::Approximation:
MeshCore::PlaneFit MeshCore::PolynomialFit MeshCore::QuadraticFit MeshCore::SurfaceFit

List of all members.

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.

Detailed Description

Abstract base class for approximation of a geometry to a given set of points.

Definition at line 43 of file Approximation.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

void Approximation::AddPoint ( const Base::Vector3f rcVector  ) 
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]
void Approximation::Convert ( const Wm4::Vector3< float > &  Wm4,
Base::Vector3f pt 
) [static, protected]
unsigned long Approximation::CountPoints (  )  const
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.

Returns:
Base::Vector3f

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.

Returns:
float Quality 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.


Member Data Documentation

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().


The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:02:23 2011 for FreeCAD by  doxygen 1.6.1