//---------------------------------------------------------------------------- // EgalTech 2020-2020 //---------------------------------------------------------------------------- // File : DistLineLine.h Data : 06.11.20 Versione : 2.2k1 // Contenuto : Dichiarazione della classe distanza fra elementi lineari. // // // // Modifiche : 06.11.20 LM Creazione modulo. // // //---------------------------------------------------------------------------- #pragma once #include "/EgtDev/Include/EGkVector3d.h" #include "/EgtDev/Include/EGkPoint3d.h" //---------------------------------------------------------------------------- class DistLineLine { public : DistLineLine( const Point3d& ptSt1, const Point3d& ptEn1, const Point3d& ptSt2, const Point3d& ptEn2, bool bIsSegment1 = true, bool bIsSegment2 = true) ; DistLineLine( const Point3d& ptSt1, const Vector3d& vtD1, double dLen1, const Point3d& ptSt2, const Vector3d& vtD2, double dLen2, bool bIsSegment1 = true, bool bIsSegment2 = true) ; public : bool GetSqDist( double& dSqDist) ; bool GetDist( double& dDist) ; bool IsEpsilon( double dTol) { double dSqDist ; return ( GetSqDist( dSqDist) && ( dSqDist < SQ_EPS_ZERO || dSqDist < dTol * dTol)) ; } bool IsSmall( void) { return IsEpsilon( EPS_SMALL) ; } bool IsZero( void) { return IsEpsilon( EPS_ZERO) ; } bool GetMinDistPoints( Point3d& ptMinDist1, Point3d& ptMinDist2) ; bool GetPositionsAtMinDistPoints( double& dPos1, double& dPos2) ; private : void Calculate( const Point3d& ptSt1, const Vector3d& vtD1, double dLen1, const Point3d& ptSt2, const Vector3d& vtD2, double dLen2, bool bIsSegment1, bool bIsSegment2) ; private: double m_dSqDist ; double m_dDist ; double m_dPos1 ; double m_dPos2 ; Point3d m_ptMinDist1 ; Point3d m_ptMinDist2 ; } ;