//---------------------------------------------------------------------------- // EgalTech 2017-2017 //---------------------------------------------------------------------------- // File : EGkDistPointTria.h Data : 19.10.17 Versione : 1.8j4 // Contenuto : Dichiarazione della classe distanza Punto da Triangolo. // // // // Modifiche : 19.10.17 DS Creazione modulo. // // //---------------------------------------------------------------------------- #pragma once #include "/EgtDev/Include/EGkTriangle3d.h" //----------------------- Macro per import/export ---------------------------- #undef EGK_EXPORT #if defined( I_AM_EGK) // da definirsi solo nella DLL #define EGK_EXPORT __declspec( dllexport) #else #define EGK_EXPORT __declspec( dllimport) #endif //----------------------------------------------------------------------------- class DistPointTriangle { public : EGK_EXPORT DistPointTriangle( const Point3d& ptP, const Triangle3d& Tria) ; public : EGK_EXPORT bool GetSqDist( double& dSqDist) ; EGK_EXPORT bool GetDist( double& dDist) ; EGK_EXPORT bool IsEpsilon( double dTol) { double dSqDist ; return ( GetSqDist( dSqDist) && ( dSqDist < SQ_EPS_ZERO || dSqDist < dTol * dTol)) ; } EGK_EXPORT bool IsSmall( void) { return IsEpsilon( EPS_SMALL) ; } EGK_EXPORT bool IsZero( void) { return IsEpsilon( EPS_ZERO) ; } EGK_EXPORT bool GetMinDistPoint( Point3d& ptMinDist) ; private : void Calculate( const Point3d& ptP, const Triangle3d& Tria) ; private : double m_dSqDist ; double m_dDist ; Point3d m_ptMinDist ; } ;