EgtGeomKernel 1.4l3 : Modifiche a ApproxWithLines anche per CurveComposite.
Aggiunta classe PolyLine.
This commit is contained in:
@@ -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 ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user