EgtGeomKernel 1.4l3 : Modifiche a ApproxWithLines anche per CurveComposite.

Aggiunta classe PolyLine.
This commit is contained in:
Dario Sassi
2013-12-24 22:09:55 +00:00
parent 30f8c71894
commit 2cd7dcee57
14 changed files with 381 additions and 133 deletions
+47
View File
@@ -383,6 +383,40 @@ CurveComposite::GetLength( double& dLen) const
return true ;
}
//----------------------------------------------------------------------------
bool
CurveComposite::ApproxWithLines( double dLinTol, double dAngTolDeg, PolyLine& PL) const
{
bool bFirst ;
double dStartPar ;
Point3d ptP ;
PolyLine PLSmpl ;
PCRVSMPL_LIST::const_iterator Iter ;
bFirst = true ;
dStartPar = 0 ;
for ( Iter = m_CrvSmplS.begin() ; Iter != m_CrvSmplS.end() ; ++Iter) {
// recupero approssimazione per curva semplice
if ( ! (*Iter)->ApproxWithLines( dLinTol, dAngTolDeg, PLSmpl))
return false ;
// la accodo opportunamente a quella della curva composita
if ( bFirst) {
PL.Splice( PLSmpl) ;
bFirst = false ;
}
else {
PLSmpl.EraseFirstUPoint() ;
PLSmpl.AddOffsetToU( dStartPar) ;
PL.Splice( PLSmpl) ;
}
// incremento inizio parametro per prossima curva semplice
dStartPar += 1 ;
}
return true ;
}
//----------------------------------------------------------------------------
bool
CurveComposite::Reverse( void)
@@ -798,3 +832,16 @@ CurveComposite::GetNextCurve( void) const
else
return nullptr ;
}
//----------------------------------------------------------------------------
bool
CurveComposite::IsParamAtJoint( double dU) const
{
// se all'inizio, alla fine o lontano dagli interi
if ( fabs( dU) < EPS_ZERO ||
fabs( dU - m_nCounter) < EPS_ZERO ||
fabs( dU - (int) ( dU + EPS_ZERO)) > EPS_ZERO)
return false ;
else
return true ;
}