EgtExecutor 2.1e2 :

- aggiunta funzione Exe e Lua RemoveCurveCompoCurve.
This commit is contained in:
Dario Sassi
2019-05-09 06:26:07 +00:00
parent 788a6d76c9
commit d002f12ce0
3 changed files with 40 additions and 0 deletions
+23
View File
@@ -1466,6 +1466,29 @@ ExeAddCurveCompoArc2P( int nId, const Point3d& ptMid, const Point3d& ptP, int nR
return bOk ;
}
//-------------------------------------------------------------------------------
bool
ExeRemoveCurveCompoCurve( int nId, bool bLast)
{
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->RemoveFirstOrLastCurve( bLast) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtRemoveCurveCompoCurve(" + ToString( nId) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-------------------------------------------------------------------------------
bool
ExeAddCurveCompoJoint( int nId, double dU)
BIN
View File
Binary file not shown.
+17
View File
@@ -636,6 +636,22 @@ LuaAddCurveCompoArc2P( lua_State* L)
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaRemoveCurveCompoCurve( lua_State* L)
{
// 1 o 2 parametri : Id, [, bLast]
int nId ;
LuaCheckParam( L, 1, nId)
bool bLast ;
LuaGetParam( L, 2, bLast) ;
LuaClearStack( L) ;
// rimuovo prima o ultima curva della composita
bool bOk = ExeRemoveCurveCompoCurve( nId, bLast) ;
LuaSetParam( L, bOk) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaAddCurveCompoJoint( lua_State* L)
@@ -818,6 +834,7 @@ LuaInstallGdbModifyCurve( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtAddCurveCompoLine", LuaAddCurveCompoLine) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtAddCurveCompoArcTg", LuaAddCurveCompoArcTg) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtAddCurveCompoArc2P", LuaAddCurveCompoArc2P) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveCurveCompoCurve", LuaRemoveCurveCompoCurve) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtAddCurveCompoJoint", LuaAddCurveCompoJoint) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtModifyCurveCompoJoint", LuaModifyCurveCompoJoint) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveCurveCompoJoint", LuaRemoveCurveCompoJoint) ;