EgtGeomKernel 2.3c3 :
- corretta CurveComposite::ModifyJoint per gestire anche estremi di curva aperta - corretta propagazione tipo precedente/successivo in intersezione di curve composite - GeomDB::ChangeId ora se i due Id sono identici non fa alcunché ed esce con successo.
This commit is contained in:
+17
-15
@@ -1759,30 +1759,32 @@ CurveComposite::ModifyJoint( int nU, const Point3d& ptNewJoint)
|
||||
return false ;
|
||||
// numero di curve
|
||||
int nCrvCount = GetCurveCount() ;
|
||||
// verifico l'indice della giunzione
|
||||
if ( nU < 0 || nU > nCrvCount)
|
||||
return false ;
|
||||
// recupero il puntatore alla curva precedente (se esiste)
|
||||
ICurve* pPrevCrv = nullptr ;
|
||||
if ( nU > 0 && nU <= nCrvCount)
|
||||
if ( nU > 0)
|
||||
pPrevCrv = m_CrvSmplS[ nU - 1] ;
|
||||
else if ( nU == 0 && IsClosed())
|
||||
else if ( IsClosed())
|
||||
pPrevCrv = m_CrvSmplS[ nCrvCount - 1] ;
|
||||
// recupero il puntatore alla curva successiva (se esiste)
|
||||
ICurve* pNextCrv = nullptr ;
|
||||
if ( nU >= 0 && nU < nCrvCount)
|
||||
if ( nU < nCrvCount)
|
||||
pNextCrv = m_CrvSmplS[ nU] ;
|
||||
else if ( nU == nCrvCount && IsClosed())
|
||||
else if ( IsClosed())
|
||||
pNextCrv = m_CrvSmplS[ 0] ;
|
||||
// se non esiste curva precedente o curva successiva, errore
|
||||
if ( pPrevCrv == nullptr || pNextCrv == nullptr)
|
||||
// modifico il punto finale dell'eventuale entità precedente
|
||||
if ( pPrevCrv != nullptr && ! pPrevCrv->ModifyEnd( ptNewJoint))
|
||||
return false ;
|
||||
// modifico il punto finale dell'entità precedente
|
||||
if ( ! pPrevCrv->ModifyEnd( ptNewJoint))
|
||||
return false ;
|
||||
// modifico il punto iniziale dell'entità successiva
|
||||
if ( ! pNextCrv->ModifyStart( ptNewJoint)) {
|
||||
// c'è stato errore, ripristino punto finale dell'entità precedente
|
||||
Point3d ptJ ;
|
||||
pNextCrv->GetStartPoint( ptJ) ;
|
||||
pPrevCrv->ModifyEnd( ptJ) ;
|
||||
// modifico il punto iniziale dell'eventuale entità successiva
|
||||
if ( pNextCrv != nullptr && ! pNextCrv->ModifyStart( ptNewJoint)) {
|
||||
// c'è stato errore, ripristino punto finale dell'eventuale entità precedente
|
||||
if ( pPrevCrv != nullptr) {
|
||||
Point3d ptJ ;
|
||||
pNextCrv->GetStartPoint( ptJ) ;
|
||||
pPrevCrv->ModifyEnd( ptJ) ;
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user