EgtExecutor 2.1e2 :
- aggiunta funzione Exe e Lua RemoveCurveCompoCurve.
This commit is contained in:
@@ -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)
|
||||
|
||||
Binary file not shown.
@@ -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) ;
|
||||
|
||||
Reference in New Issue
Block a user