EgtGeomKernel 1.5g2 :
- aggiunte intersezioni tra linee ed archi - aggiunte intersezioni tra archi e archi - aggiunte funzioni di utilità per angoli.
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "GeoObjFactory.h"
|
||||
#include "NgeWriter.h"
|
||||
#include "NgeReader.h"
|
||||
#include "/EgtDev/Include/EGkAngle.h"
|
||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||
#include "/EgtDev/Include/EgtPointerOwner.h"
|
||||
#include <new>
|
||||
@@ -1255,6 +1256,53 @@ CurveArc::InvertN( void)
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveArc::CalcPointAngle( const Point3d& ptP, double& dAngDeg) const
|
||||
{
|
||||
// verifico lo stato
|
||||
if ( m_nStatus != OK)
|
||||
return false ;
|
||||
|
||||
// posizione angolare del punto rispetto al centro a partire dalla direzione start
|
||||
bool bDet ;
|
||||
if ( ! m_VtS.GetRotation( ( ptP - m_PtCen), m_VtN, dAngDeg, bDet) || ! bDet)
|
||||
return false ;
|
||||
if ( m_dAngCenDeg > 0 && dAngDeg < - EPS_ANG_ZERO)
|
||||
dAngDeg += ANG_FULL ;
|
||||
else if ( m_dAngCenDeg < 0 && dAngDeg > EPS_ANG_ZERO)
|
||||
dAngDeg -= ANG_FULL ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveArc::CalcPointParamPosiz( const Point3d& ptP, double& dU, int& nPos) const
|
||||
{
|
||||
// calcolo la posizione angolare
|
||||
double dAngDeg ;
|
||||
if ( ! CalcPointAngle( ptP, dAngDeg))
|
||||
return false ;
|
||||
// calcolo parametro
|
||||
dU = dAngDeg / m_dAngCenDeg ;
|
||||
// verifica posizione punto su arco
|
||||
nPos = PP_NULL ; // fuori
|
||||
if ( fabs( DiffAngle( dAngDeg, 0) * DEGTORAD * m_dRad) < EPS_SMALL) {
|
||||
nPos = PP_START ; // vicino a inizio
|
||||
dU = AngleNearAngle( dAngDeg, 0) / m_dAngCenDeg ;
|
||||
dU = max( dU, 0.) ;
|
||||
}
|
||||
else if ( fabs( DiffAngle( dAngDeg, m_dAngCenDeg) * DEGTORAD * m_dRad) < EPS_SMALL) {
|
||||
nPos = PP_END ; // vicino a fine
|
||||
dU = AngleNearAngle( dAngDeg, m_dAngCenDeg) / m_dAngCenDeg ;
|
||||
dU = min( dU, 1.) ;
|
||||
}
|
||||
else if ( dU > 0 && dU < 1)
|
||||
nPos = PP_MID ; // nell'interno
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
CurveArc::ChangeRadius( double dNewRadius)
|
||||
|
||||
Reference in New Issue
Block a user