MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::PointAccumulator Class Reference

Class to accumulate points and make best line / plane approximation. More...

#include <MRMesh/MRBestFit.h>

Public Member Functions

void addPoint (const Vector3d &pt)
void addPoint (const Vector3d &pt, double weight)
void addPoint (const Vector3f &pt)
void addPoint (const Vector3f &pt, float weight)
Plane3d getBestPlane () const
 computes the best approximating plane from the accumulated points
Plane3f getBestPlanef () const
Line3d getBestLine () const
 computes the best approximating line from the accumulated points
Line3f getBestLinef () const
bool getCenteredCovarianceEigen (Vector3d &centroid, Matrix3d &eigenvectors, Vector3d &eigenvalues) const
 computes centroid and eigenvectors/eigenvalues of the covariance matrix of the accumulated points
bool getCenteredCovarianceEigen (Vector3f &centroid, Matrix3f &eigenvectors, Vector3f &eigenvalues) const
AffineXf3d getBasicXf () const
AffineXf3f getBasicXf3f () const
std::array< AffineXf3d, 4 > get4BasicXfs () const
std::array< AffineXf3f, 4 > get4BasicXfs3f () const
bool valid () const

Detailed Description

Class to accumulate points and make best line / plane approximation.

Member Function Documentation

◆ addPoint() [1/4]

void MR::PointAccumulator::addPoint ( const Vector3d & pt)

◆ addPoint() [2/4]

void MR::PointAccumulator::addPoint ( const Vector3d & pt,
double weight )

◆ addPoint() [3/4]

void MR::PointAccumulator::addPoint ( const Vector3f & pt)
inline

◆ addPoint() [4/4]

void MR::PointAccumulator::addPoint ( const Vector3f & pt,
float weight )
inline

◆ get4BasicXfs()

std::array< AffineXf3d, 4 > MR::PointAccumulator::get4BasicXfs ( ) const

returns 4 transformations, each maps (0,0,0) into point centroid, and maps vectors (1,0,0), (0,1,0), (0,0,1) into +/- first, +/- second, +/- third eigenvectors (forming positive reference frame) corresponding to ascending eigenvalues

◆ get4BasicXfs3f()

std::array< AffineXf3f, 4 > MR::PointAccumulator::get4BasicXfs3f ( ) const

◆ getBasicXf()

AffineXf3d MR::PointAccumulator::getBasicXf ( ) const

returns the transformation that maps (0,0,0) into point centroid, and maps vectors (1,0,0), (0,1,0), (0,0,1) into first, second, third eigenvectors corresponding to ascending eigenvalues

◆ getBasicXf3f()

AffineXf3f MR::PointAccumulator::getBasicXf3f ( ) const
inline

◆ getBestLine()

Line3d MR::PointAccumulator::getBestLine ( ) const

computes the best approximating line from the accumulated points

◆ getBestLinef()

Line3f MR::PointAccumulator::getBestLinef ( ) const
inline

◆ getBestPlane()

Plane3d MR::PointAccumulator::getBestPlane ( ) const

computes the best approximating plane from the accumulated points

◆ getBestPlanef()

Plane3f MR::PointAccumulator::getBestPlanef ( ) const
inline

◆ getCenteredCovarianceEigen() [1/2]

bool MR::PointAccumulator::getCenteredCovarianceEigen ( Vector3d & centroid,
Matrix3d & eigenvectors,
Vector3d & eigenvalues ) const

computes centroid and eigenvectors/eigenvalues of the covariance matrix of the accumulated points

◆ getCenteredCovarianceEigen() [2/2]

bool MR::PointAccumulator::getCenteredCovarianceEigen ( Vector3f & centroid,
Matrix3f & eigenvectors,
Vector3f & eigenvalues ) const

◆ valid()

bool MR::PointAccumulator::valid ( ) const
inline

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