FLImaging 7.8.25.3
LeastSquares3D.h
1#pragma once
7
8#include "FLFigureForwardDeclaration.h"
9#include "DefinitionsMathematics.h"
10
12namespace FLImaging
13{
15 namespace Foundation
16 {
17 template<typename T>
18 class CInternalLeastSquares3D;
19
25 template<typename T>
26 class FL_EXPORT CLeastSquares3D : public Base::CFLBase
27 {
28 public:
36
44
56 const CResult Clear();
57
75 const CResult Set(const Base::TPoint3<T>* pTpArrXYZ, int32_t i32Count);
76
95
114
134 const CResult Set(T* pTArrX, T* pTArrY, T* pTArrZ, int32_t i32Count);
135
153 const CResult Set(const CFLPoint3<T>* pFlpArrXYZ, int32_t i32Count);
154
170 const CResult Set(const CFLPointArray3<T>& flpaData);
171
187 const CResult Set(const CFLPointArray3<T>* pFlpaData);
188
204 const CResult Assign(const CFLPointArray3<double>& flpaData);
205
221 const CResult Assign(const CFLPointArray3<float>& flpaData);
222
238 const CResult Assign(const CFLPointArray3<double>* pFlpaData);
239
255 const CResult Assign(const CFLPointArray3<float>* pFlpaData);
256
275
294
313
332
351
370
389
408
428 const CResult Assign(int32_t* pI32X, int32_t* pI32Y, int32_t* pI32Z, int32_t i32Count);
429
449 const CResult Assign(int64_t* pI64X, int64_t* pI64Y, int64_t* pI64Z, int32_t i32Count);
450
470 const CResult Assign(float* pF32X, float* pF32Y, float* pF32Z, int32_t i32Count);
471
491 const CResult Assign(double* pF64X, double* pF64Y, double* pF64Z, int32_t i32Count);
492
510 const CResult Assign(const CFLPoint3<float>* pData, int32_t i32Count);
511
529 const CResult Assign(const CFLPoint3<double>* pData, int32_t i32Count);
530
548 const CResult Add(int32_t i32X, int32_t i32Y, int32_t i32Z);
549
567 const CResult Add(int64_t i64X, int64_t i64Y, int64_t i64Z);
568
586 const CResult Add(float f32X, float f32Y, float f32Z);
587
605 const CResult Add(double f64X, double f64Y, double f64Z);
606
622 const CResult Add(const CFLPoint3<double>& flpData);
623
639 const CResult Add(const CFLPoint3<float>& flpData);
640
656 const CResult Add(const CFLPoint3<double>* pFlpData);
657
673 const CResult Add(const CFLPoint3<float>* pFlpData);
674
690 const CResult Add(const Base::TPoint3<double>& tpData);
691
707 const CResult Add(const Base::TPoint3<float>& tpData);
708
724 const CResult Add(const Base::TPoint3<int64_t>& tpData);
725
741 const CResult Add(const Base::TPoint3<int32_t>& tpData);
742
758 const CResult Add(const Base::TPoint3<double>* pTpData);
759
775 const CResult Add(const Base::TPoint3<float>* pTpData);
776
792 const CResult Add(const Base::TPoint3<int64_t>* pTpData);
793
809 const CResult Add(const Base::TPoint3<int32_t>* pTpData);
810
829
848
867
886
905
924
943
962
982 const CResult Add(double* pArrX, double* pArrY, double* pArrZ, int32_t i32Count);
983
1003 const CResult Add(float* pArrX, float* pArrY, float* pArrZ, int32_t i32Count);
1004
1024 const CResult Add(int64_t* pArrX, int64_t* pArrY, int64_t* pArrZ, int32_t i32Count);
1025
1045 const CResult Add(int32_t* pArrX, int32_t* pArrY, int32_t* pArrZ, int32_t i32Count);
1046
1060 Base::TPoint3<T>* Get(size_t stIndex) const;
1061
1079 const CResult Get(size_t stIndex, Base::TPoint3<T>** ppTpArrXYZ) const;
1080
1100 const CResult Get(size_t stIndex, T** ppTArrX, T** ppTArrY, T** ppTArrZ) const;
1101
1119 const CResult Get(size_t stIndex, CFLPoint3<T>** ppFlpArrXYZ) const;
1120
1130 size_t GetCount();
1131
1161 const CResult GetPlane(T& tA, T& tB, T& tC, T& tD, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1162
1192 const CResult GetSphere(T& tU, T& tV, T& tW, T& tR, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1193
1217 const CResult GetSphere(CFLSphere3<double>& flspResult, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1218
1242 const CResult GetSphere(CFLSphere3<float>& flspResult, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1243
1267 const CResult GetSphere(CFLSphere3<double>* pFlspResult, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1268
1292 const CResult GetSphere(CFLSphere3<float>* pFlspResult, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1293
1317 const CResult GetCircle(CFLCircle3<double>& flcResult, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1318
1342 const CResult GetCircle(CFLCircle3<float>& flcResult, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1343
1367 const CResult GetCircle(CFLCircle3<double>* pFlcResult, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1368
1392 const CResult GetCircle(CFLCircle3<float>* pFlcResult, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1393
1421 const CResult GetLine(CFLPoint3<T>& flpDirectionVector, CFLPoint3<T>& flpBasePosition, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1422
1450 const CResult GetLine(CFLPoint3<T>* pFlpDirectionVector, CFLPoint3<T>* pFlpBasePosition, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1451
1475 const CResult GetLine(CFLLine3<double>& fllResult, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1476
1500 const CResult GetLine(CFLLine3<float>& fllResult, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1501
1525 const CResult GetLine(CFLLine3<double>* pFllResult, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1526
1550 const CResult GetLine(CFLLine3<float>* pFllResult, int64_t i64OutlierThresholdCount = 0, double f64OutlierThreshold = 3., Base::CFLArray<int64_t>* pFlaOutlierIndices = nullptr) const;
1551
1552
1553 SupportToDuplicateObject(CLeastSquares3D, *this);
1554 DeclareGetClassType();
1555
1556 private:
1557 CInternalLeastSquares3D<T>* m_pInternal;
1558 };
1559
1560 typedef CLeastSquares3D<float> CLeastSquares3DF;
1561 typedef CLeastSquares3D<double> CLeastSquares3DD;
1562 }
1563}
1564
Template type array class.
Definition FLArray.h:71
Top-level base class of FLImaging.
Definition FLBase.h:36
Simplified class representing a 3-D point.
Definition TPoint3.h:37
FLImaging module execution result object.
Definition ResultsDef.h:1704
Represents a circle in 3D space.
Definition FLCircle3.h:26
A class representing a line 3d.
Definition FLLine3.h:28
A class representing a 3D point.
Definition FLPoint3.h:40
A base class representing array of 3d point.
Definition FLPointArray3.h:24
A class representing sphere.
Definition FLSphere3.h:25
3D least squares calculation class
Definition LeastSquares3D.h:27
const CResult Assign(const CFLPointArray3< float > &flpaData)
A function that allocates data and creates a copy of the array.
const CResult Add(const Base::TPoint3< double > &tpData)
Add data.
const CResult Assign(const Base::CFLArray< Base::TPoint3< float > > &flaData)
A function that allocates data and creates a copy of the array.
const CResult Assign(const CFLPointArray3< double > &flpaData)
A function that allocates data and creates a copy of the array.
const CResult GetLine(CFLLine3< float > *pFllResult, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the straight line that has the minimum distance difference between each point.
Base::TPoint3< T > * Get(size_t stIndex) const
Get the data of the specified index.
const CResult GetCircle(CFLCircle3< double > &flcResult, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the circle with the minimum distance difference between each point.
const CResult GetSphere(CFLSphere3< double > *pFlspResult, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the sphere with the minimum distance difference between each point.
CLeastSquares3D()
Default constructor.
const CResult Assign(const Base::CFLArray< Base::TPoint3< int64_t > > *pFlaData)
A function that allocates data and creates a copy of the array.
const CResult GetLine(CFLLine3< double > *pFllResult, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the straight line that has the minimum distance difference between each point.
const CResult Get(size_t stIndex, T **ppTArrX, T **ppTArrY, T **ppTArrZ) const
Get the data of the specified index.
const CResult Add(int32_t *pArrX, int32_t *pArrY, int32_t *pArrZ, int32_t i32Count)
Copy and add data.
const CResult GetLine(CFLLine3< float > &fllResult, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the straight line that has the minimum distance difference between each point.
const CResult Assign(int32_t *pI32X, int32_t *pI32Y, int32_t *pI32Z, int32_t i32Count)
A function that allocates data and creates a copy of the array.
const CResult Add(const CFLPoint3< double > &flpData)
Add data.
const CResult Assign(const CFLPoint3< double > *pData, int32_t i32Count)
A function that allocates data and creates a copy of the array.
const CResult Add(int32_t i32X, int32_t i32Y, int32_t i32Z)
Add data.
const CResult Add(float *pArrX, float *pArrY, float *pArrZ, int32_t i32Count)
Copy and add data.
const CResult Assign(int64_t *pI64X, int64_t *pI64Y, int64_t *pI64Z, int32_t i32Count)
A function that allocates data and creates a copy of the array.
const CResult Add(const Base::TPoint3< int32_t > &tpData)
Add data.
const CResult GetLine(CFLPoint3< T > &flpDirectionVector, CFLPoint3< T > &flpBasePosition, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the straight line that has the minimum distance difference between each point Get ...
const CResult GetSphere(CFLSphere3< double > &flspResult, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the sphere with the minimum distance difference between each point.
const CResult Set(const CFLPointArray3< T > &flpaData)
As a function that allocates data, it allocates only the array pointer address of the parameter witho...
const CResult Assign(const CFLPointArray3< double > *pFlpaData)
A function that allocates data and creates a copy of the array.
const CResult Add(const Base::TPoint3< int32_t > *pTpData)
Add data.
const CResult Assign(const Base::CFLArray< Base::TPoint3< double > > *pFlaData)
A function that allocates data and creates a copy of the array.
const CResult Set(const CFLPointArray3< T > *pFlpaData)
As a function that allocates data, it allocates only the array pointer address of the parameter witho...
const CResult Add(const Base::CFLArray< Base::TPoint3< int32_t > > *pFlaData)
Add data.
const CResult Add(float f32X, float f32Y, float f32Z)
Add data.
const CResult GetPlane(T &tA, T &tB, T &tC, T &tD, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the surface with the minimum distance difference between each point Get the coeffi...
const CResult Assign(const CFLPoint3< float > *pData, int32_t i32Count)
A function that allocates data and creates a copy of the array.
const CResult GetCircle(CFLCircle3< float > *pFlcResult, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the circle with the minimum distance difference between each point.
const CResult Assign(const CFLPointArray3< float > *pFlpaData)
A function that allocates data and creates a copy of the array.
const CResult Get(size_t stIndex, CFLPoint3< T > **ppFlpArrXYZ) const
Get the data of the specified index.
const CResult Assign(const Base::CFLArray< Base::TPoint3< int64_t > > &flaData)
A function that allocates data and creates a copy of the array.
const CResult GetCircle(CFLCircle3< double > *pFlcResult, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the circle with the minimum distance difference between each point.
const CResult Assign(const Base::CFLArray< Base::TPoint3< int32_t > > *pFlaData)
A function that allocates data and creates a copy of the array.
const CResult GetSphere(CFLSphere3< float > &flspResult, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the sphere with the minimum distance difference between each point.
const CResult GetSphere(CFLSphere3< float > *pFlspResult, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the sphere with the minimum distance difference between each point.
const CResult Add(double f64X, double f64Y, double f64Z)
Add data.
const CResult Assign(double *pF64X, double *pF64Y, double *pF64Z, int32_t i32Count)
A function that allocates data and creates a copy of the array.
const CResult Add(const Base::CFLArray< Base::TPoint3< int32_t > > &flaData)
Add data.
const CResult Set(const Base::CFLArray< Base::TPoint3< T > > *pFlaData)
As a function that allocates data, it allocates only the array pointer address of the parameter witho...
const CResult Add(double *pArrX, double *pArrY, double *pArrZ, int32_t i32Count)
Copy and add data.
const CResult Add(const Base::TPoint3< float > &tpData)
Add data.
const CResult Assign(const Base::CFLArray< Base::TPoint3< double > > &flaData)
A function that allocates data and creates a copy of the array.
const CResult Assign(const Base::CFLArray< Base::TPoint3< float > > *pFlaData)
A function that allocates data and creates a copy of the array.
const CResult Add(const Base::TPoint3< int64_t > *pTpData)
Add data.
const CResult Assign(const Base::CFLArray< Base::TPoint3< int32_t > > &flaData)
A function that allocates data and creates a copy of the array.
const CResult Add(const CFLPoint3< float > *pFlpData)
Add data.
const CResult Add(const Base::CFLArray< Base::TPoint3< double > > &flaData)
Add data.
const CResult GetCircle(CFLCircle3< float > &flcResult, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the circle with the minimum distance difference between each point.
const CResult Add(const Base::CFLArray< Base::TPoint3< int64_t > > *pFlaData)
Add data.
const CResult Add(const Base::TPoint3< float > *pTpData)
Add data.
const CResult GetSphere(T &tU, T &tV, T &tW, T &tR, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the sphere with the minimum distance difference between each point Get the coeffic...
const CResult Assign(float *pF32X, float *pF32Y, float *pF32Z, int32_t i32Count)
A function that allocates data and creates a copy of the array.
const CResult Add(const Base::TPoint3< int64_t > &tpData)
Add data.
const CResult Add(const Base::CFLArray< Base::TPoint3< float > > *pFlaData)
Add data.
const CResult Get(size_t stIndex, Base::TPoint3< T > **ppTpArrXYZ) const
Get the data of the specified index.
const CResult Set(const Base::CFLArray< Base::TPoint3< T > > &flaData)
As a function that allocates data, it allocates only the array pointer address of the parameter witho...
const CResult Set(T *pTArrX, T *pTArrY, T *pTArrZ, int32_t i32Count)
As a function that allocates data, it allocates only the array pointer address of the parameter witho...
const CResult Set(const CFLPoint3< T > *pFlpArrXYZ, int32_t i32Count)
As a function that allocates data, it allocates only the array pointer address of the parameter witho...
const CResult Add(const Base::CFLArray< Base::TPoint3< double > > *pFlaData)
Add data.
const CResult GetLine(CFLLine3< double > &fllResult, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the straight line that has the minimum distance difference between each point.
const CResult Add(const Base::CFLArray< Base::TPoint3< float > > &flaData)
Add data.
const CResult Clear()
Initialize the parameters.
const CResult Add(const Base::CFLArray< Base::TPoint3< int64_t > > &flaData)
Add data.
const CResult Add(const Base::TPoint3< double > *pTpData)
Add data.
virtual ~CLeastSquares3D()
Default destructor.
const CResult Set(const Base::TPoint3< T > *pTpArrXYZ, int32_t i32Count)
As a function that allocates data, it allocates only the array pointer address of the parameter witho...
const CResult Add(int64_t *pArrX, int64_t *pArrY, int64_t *pArrZ, int32_t i32Count)
Copy and add data.
const CResult GetLine(CFLPoint3< T > *pFlpDirectionVector, CFLPoint3< T > *pFlpBasePosition, int64_t i64OutlierThresholdCount=0, double f64OutlierThreshold=3., Base::CFLArray< int64_t > *pFlaOutlierIndices=nullptr) const
A function to find the straight line that has the minimum distance difference between each point Get ...
const CResult Add(int64_t i64X, int64_t i64Y, int64_t i64Z)
Add data.
const CResult Add(const CFLPoint3< double > *pFlpData)
Add data.
size_t GetCount()
Get the number of data.
const CResult Add(const CFLPoint3< float > &flpData)
Add data.
Definition AlgorithmBase.h:16