EgtExecutor :

- aggiunta funzione Exe e Lua MoveCurveCompoCurve.
This commit is contained in:
Dario Sassi
2021-04-05 16:25:43 +00:00
parent 8d218b85b7
commit 53575c745b
2 changed files with 53 additions and 1 deletions
+32 -1
View File
@@ -1748,6 +1748,37 @@ ExeRemoveCurveCompoJoint( int nId, int nU)
return bOk ;
}
//-------------------------------------------------------------------------------
bool
ExeMoveCurveCompoCurve( int nId, int nCrv, const Vector3d& vtMove, 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 movimento
Vector3d vtMoveL = GetVectorLocal( pGeomDB, vtMove, nRefType, frLoc) ;
// eseguo la modifica
bOk = bOk && pCompo->MoveCurve( nCrv, vtMove) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtMoveCurveCompoCurve(" + ToString( nId) + "," +
ToString( nCrv) + ",{" +
ToString( vtMove) + "}," +
RefTypeToString( nRefType) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-------------------------------------------------------------------------------
bool
ExeModifyCurveCompoCurveToArc( int nId, int nCrv, const Point3d& ptMid, int nRefType)
@@ -1764,7 +1795,7 @@ ExeModifyCurveCompoCurveToArc( int nId, int nCrv, const Point3d& ptMid, int nRef
// porto in locale il nuovo punto
Point3d ptMidL = GetPointLocal( pGeomDB, ptMid, nRefType, frLoc) ;
// eseguo la modifica
bOk = bOk && pCompo-> ModifyCurveToArc( nCrv, ptMidL) ;
bOk = bOk && pCompo->ModifyCurveToArc( nCrv, ptMidL) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {