EgtExecutor :
- nella creazione di curve composite da altre curve si cerca di riutilizzare gli Id delle curve cancellate - lo stesso per le superfici - aggiunte funzioni Exe e Lua AddCurveCompoCurve.
This commit is contained in:
@@ -1318,6 +1318,62 @@ ExeCloseCurveCompo( int nId)
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
MyAddCurveCompoCurve( int nId, int nAddCrvId, bool bEraseOrig)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// recupero la curva composita
|
||||
ICurveComposite* pCompo = GetCurveComposite( pGeomDB->GetGeoObj( nId)) ;
|
||||
if ( pCompo == nullptr)
|
||||
return false ;
|
||||
// recupero il riferimento locale
|
||||
Frame3d frLoc ;
|
||||
if ( ! pGeomDB->GetGlobFrame( nId, frLoc))
|
||||
return false ;
|
||||
// recupero la curva
|
||||
const ICurve* pCrv = GetCurve( pGeomDB->GetGeoObj( nAddCrvId)) ;
|
||||
if ( pCrv == nullptr)
|
||||
return false ;
|
||||
// recupero il riferimento della curva
|
||||
Frame3d frSou ;
|
||||
if ( ! pGeomDB->GetGlobFrame( nAddCrvId, frSou))
|
||||
return false ;
|
||||
// creo una copia della curva
|
||||
PtrOwner<ICurve> pCopCrv( pCrv->Clone()) ;
|
||||
if ( IsNull( pCopCrv))
|
||||
return false ;
|
||||
// se i riferimenti sono diversi, eseguo la trasformazione
|
||||
if ( ! AreSameFrame( frSou, frLoc))
|
||||
pCopCrv->LocToLoc( frSou, frLoc) ;
|
||||
// aggiungo alla composita
|
||||
if ( ! pCompo->AddCurve( Release( pCopCrv)))
|
||||
return false ;
|
||||
// se richiesto, cancello la curva originale
|
||||
if ( bEraseOrig)
|
||||
pGeomDB->Erase( nAddCrvId) ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeAddCurveCompoCurve( int nId, int nAddCrvId, bool bEraseOrig)
|
||||
{
|
||||
// eseguo
|
||||
bool bOk = MyAddCurveCompoCurve( nId, nAddCrvId, bEraseOrig) ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtAddCurveCompoCurve(" + IdToString( nId) + "," +
|
||||
IdToString( nAddCrvId) + "," +
|
||||
( bEraseOrig ? "true" : "false") + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco l'identificativo della nuova entità
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
bool
|
||||
ExeAddCurveCompoLine( int nId, const Point3d& ptP, int nRefType)
|
||||
|
||||
Reference in New Issue
Block a user