Files
EgtGeomKernel/DistPointLine.h
T
Dario Sassi 0ec9bceb16 EgtGeomKernel : Migliorata interfaccia calcolo distanza punto-curva,
inoltre sistemata gestione per punti singoli e tratti continui
2014-01-13 21:11:19 +00:00

53 lines
1.8 KiB
C++

//----------------------------------------------------------------------------
// EgalTech 2013-2014
//----------------------------------------------------------------------------
// File : DistPointLine.h Data : 02.01.14 Versione : 1.5a1
// Contenuto : Dichiarazione dell'oggetto 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)
{ Calculate( ptP, ptIni, vtDir, dLen, bIsSegment) ; }
public :
bool GetSqDist( double& dSqDist) ;
bool GetDist( double& dDist) ;
int GetNbrMinDist( void) { return (( m_dSqDist < 0) ? 0 : 1) ; }
bool GetMinDistPoint( Point3d& ptMinDist) ;
bool GetParamAtMinDistPoint( double& dParam) ;
private :
DistPointLine( void) ;
void Calculate( const Point3d& ptP,
const Point3d& ptIni, const Vector3d& vtDir, double dLen, bool bIsSegment) ;
private :
double m_dSqDist ;
double m_dDist ;
double m_dParam ;
Point3d m_ptMinDist ;
} ;