c4642fb6f2
- eliminati prototipi collisioni con triangoli - aggiornati altri prototipi.
54 lines
1.8 KiB
C++
54 lines
1.8 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2018-2018
|
|
//----------------------------------------------------------------------------
|
|
// File : EGkDistPointTria.h Data : 11.12.18 Versione : 1.9l2
|
|
// Contenuto : Dichiarazione della classe distanza Punto da Trimesh.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 06.12.18 LM Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGkSurfTriMesh.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 DistPointSurfTm
|
|
{
|
|
public :
|
|
EGK_EXPORT DistPointSurfTm( const Point3d& ptP, const ISurfTriMesh& tmSurf) ;
|
|
|
|
public :
|
|
EGK_EXPORT bool GetDist( double& dDist) ;
|
|
EGK_EXPORT bool IsEpsilon( double dTol)
|
|
{ return ( m_dDist >= 0. && ( m_dDist < EPS_ZERO || m_dDist < dTol)) ; }
|
|
EGK_EXPORT bool IsSmall( void)
|
|
{ return IsEpsilon( EPS_SMALL) ; }
|
|
EGK_EXPORT bool IsZero( void)
|
|
{ return IsEpsilon( EPS_ZERO) ; }
|
|
EGK_EXPORT bool GetMinDistPoint( Point3d& ptMinDistPoint) ;
|
|
EGK_EXPORT bool GetMinDistTriaIndex( int& nMinDistTriaIndex) ;
|
|
EGK_EXPORT bool IsPointInside( void)
|
|
{ return m_bIsInside ; }
|
|
|
|
private :
|
|
void Calculate( const Point3d& ptP, const ISurfTriMesh& tmSurf) ;
|
|
|
|
private :
|
|
double m_dDist ;
|
|
Point3d m_ptMinDistPoint ;
|
|
int m_nMinDistTriaIndex ;
|
|
bool m_bIsInside ;
|
|
} ;
|