650540e573
- semplificata e ottimizzata creazione di superficie trimesh box standard - miglioramenti sintattici vari.
59 lines
2.1 KiB
C++
59 lines
2.1 KiB
C++
//----------------------------------------------------------------------------
|
|
// EgalTech 2013-2014
|
|
//----------------------------------------------------------------------------
|
|
// File : DistPointLine.h Data : 02.01.14 Versione : 1.5a1
|
|
// Contenuto : Dichiarazione della classe distanza punto da linea/segmento.
|
|
//
|
|
//
|
|
//
|
|
// Modifiche : 30.12.12 DS Creazione modulo.
|
|
//
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
#pragma once
|
|
|
|
#include "/EgtDev/Include/EGkPoint3d.h"
|
|
#include "/EgtDev/Include/EGkCurveLine.h"
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
class DistPointLine
|
|
{
|
|
friend class DistPointCurve ;
|
|
|
|
public :
|
|
DistPointLine( const Point3d& ptP,
|
|
const ICurveLine& crvLine, bool bIsSegment = true) ;
|
|
DistPointLine( const Point3d& ptP,
|
|
const Point3d& ptIni, const Point3d& ptFin, bool bIsSegment = true) ;
|
|
DistPointLine( const Point3d& ptP,
|
|
const Point3d& ptIni, const Vector3d& vtDir, double dLen, bool bIsSegment = true) ;
|
|
|
|
public :
|
|
bool GetSqDist( double& dSqDist) const ;
|
|
bool GetDist( double& dDist) const ;
|
|
bool IsEpsilon( double dTol) const
|
|
{ double dSqDist ; return ( GetSqDist( dSqDist) && ( dSqDist < SQ_EPS_ZERO || dSqDist < dTol * dTol)) ; }
|
|
bool IsSmall( void) const
|
|
{ return IsEpsilon( EPS_SMALL) ; }
|
|
bool IsZero( void) const
|
|
{ return IsEpsilon( EPS_ZERO) ; }
|
|
int GetNbrMinDist( void) const
|
|
{ return (( m_dSqDist < 0) ? 0 : 1) ; }
|
|
bool GetMinDistPoint( Point3d& ptMinDist) const ;
|
|
bool GetParamAtMinDistPoint( double& dParam) const ;
|
|
|
|
private :
|
|
DistPointLine( void) ;
|
|
void Calculate( const Point3d& ptP,
|
|
const Point3d& ptIni, const Vector3d& vtDir, double dLen, bool bIsSegment) ;
|
|
|
|
private :
|
|
double m_dSqDist ;
|
|
mutable double m_dDist ;
|
|
double m_dParam ;
|
|
Point3d m_ptMinDist ;
|
|
} ;
|
|
|