EgtExecutor :

- aggiunta gestione giunzioni di curve composite
- riorganizzato ed esteso nesting di pezzi piani.
This commit is contained in:
Dario Sassi
2016-02-22 07:34:47 +00:00
parent 403d3a658d
commit 28f6f1240f
5 changed files with 563 additions and 265 deletions
+79
View File
@@ -958,6 +958,85 @@ ExeModifyArcByFlip( int nId)
return pArc->Flip() ;
}
//-------------------------------------------------------------------------------
bool
ExeAddCurveCompoJoint( int nId, double dU)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
bool bOk = true ;
// recupero la curva composita
ICurveComposite* pCompo = GetCurveComposite( pGeomDB->GetGeoObj( nId)) ;
bOk = bOk && ( pCompo != nullptr) ;
// eseguo la modifica
bOk = bOk && pCompo->AddJoint( dU) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtAddCurveCompoJoint(" + ToString( nId) + "," +
ToString( dU) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-------------------------------------------------------------------------------
bool
ExeModifyCurveCompoJoint( int nId, int nU, const Point3d& ptP, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
bool bOk = true ;
// recupero la curva composita
ICurveComposite* pCompo = GetCurveComposite( pGeomDB->GetGeoObj( nId)) ;
bOk = bOk && ( pCompo != nullptr) ;
// recupero il riferimento locale
Frame3d frLoc ;
bOk = bOk && pGeomDB->GetGlobFrame( nId, frLoc) ;
// porto in locale il nuovo punto
Point3d ptPL = GetPointLocal( pGeomDB, ptP, nRefType, frLoc) ;
// eseguo la modifica
bOk = bOk && pCompo->ModifyJoint( nU, ptPL) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtModifyCurveCompoJoint(" + ToString( nId) + "," +
ToString( nU) + ",{" +
ToString( ptP) + "}," +
RefTypeToString( nRefType) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-------------------------------------------------------------------------------
bool
ExeRemoveCurveCompoJoint( int nId, int nU)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
bool bOk = true ;
// recupero la curva composita
ICurveComposite* pCompo = GetCurveComposite( pGeomDB->GetGeoObj( nId)) ;
bOk = bOk && ( pCompo != nullptr) ;
// eseguo la modifica
bOk = bOk && pCompo->RemoveJoint( nU) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtRemoveCurveCompoJoint(" + ToString( nId) + "," +
ToString( nU) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-------------------------------------------------------------------------------
int
ExeExplodeCurveCompo( int nId, int* pnCount)