EgtExecutor 2.3d3 :

- in AddCurveCompoCurve, AddCurveCompoLine, AddCurveCompoArcTg e AddCurveCompoArc2P aggiunto parametro per operare in coda o in testa (in lua è opzionale)
- in ExeRemoveCurveCompoCurve ora si libera correttamente la memoria delle curve.
This commit is contained in:
Dario Sassi
2021-04-12 07:43:20 +00:00
parent 84a721f594
commit 1a786dad93
3 changed files with 45 additions and 25 deletions
+26 -12
View File
@@ -574,16 +574,18 @@ LuaCloseCurveCompo( lua_State* L)
static int
LuaAddCurveCompoCurve( lua_State* L)
{
// 2 o 3 parametri : Id, AddCrvId [, bEraseOrig]
// 2, 3 o 4 parametri : Id, AddCrvId [, bEraseOrig [, bEndVsStart]]
int nId ;
LuaCheckParam( L, 1, nId)
int nAddCrvId ;
LuaCheckParam( L, 2, nAddCrvId)
bool bEraseOrig = true ;
LuaGetParam( L, 3, bEraseOrig) ;
bool bEndVsStart = true ;
if ( LuaGetParam( L, 3, bEraseOrig))
LuaGetParam( L, 4, bEndVsStart) ;
LuaClearStack( L) ;
// aggiungo la curva in coda alla curva composita
bool bOk = ExeAddCurveCompoCurve( nId, nAddCrvId, bEraseOrig) ;
bool bOk = ExeAddCurveCompoCurve( nId, nAddCrvId, bEraseOrig, bEndVsStart) ;
LuaSetParam( L, bOk) ;
return 1 ;
}
@@ -592,16 +594,20 @@ LuaAddCurveCompoCurve( lua_State* L)
static int
LuaAddCurveCompoLine( lua_State* L)
{
// 2 o 3 parametri : Id, ptNew [, nRefType]
// 2, 3 o 4 parametri : Id, ptNew [, bEndVsStart] [, nRefType]
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptNew ;
LuaCheckParam( L, 2, ptNew)
bool bEndVsStart = true ;
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 3, nRefType) ;
if ( LuaGetParam( L, 3, bEndVsStart))
LuaGetParam( L, 4, nRefType) ;
else
LuaGetParam( L, 3, nRefType) ;
LuaClearStack( L) ;
// aggiungo una linea in coda alla curva composita
bool bOk = ExeAddCurveCompoLine( nId, ptNew, nRefType) ;
bool bOk = ExeAddCurveCompoLine( nId, ptNew, bEndVsStart, nRefType) ;
LuaSetParam( L, bOk) ;
return 1 ;
}
@@ -610,16 +616,20 @@ LuaAddCurveCompoLine( lua_State* L)
static int
LuaAddCurveCompoArcTg( lua_State* L)
{
// 2 o 3 parametri : Id, ptNew [, nRefType]
// 2, 3 o 4 parametri : Id, ptNew [, bEndVsStart] [, nRefType]
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptNew ;
LuaCheckParam( L, 2, ptNew)
bool bEndVsStart = true ;
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 3, nRefType) ;
if ( LuaGetParam( L, 3, bEndVsStart))
LuaGetParam( L, 4, nRefType) ;
else
LuaGetParam( L, 3, nRefType) ;
LuaClearStack( L) ;
// aggiungo un arco tangente in coda alla curva composita
bool bOk = ExeAddCurveCompoArcTg( nId, ptNew, nRefType) ;
bool bOk = ExeAddCurveCompoArcTg( nId, ptNew, bEndVsStart, nRefType) ;
LuaSetParam( L, bOk) ;
return 1 ;
}
@@ -628,18 +638,22 @@ LuaAddCurveCompoArcTg( lua_State* L)
static int
LuaAddCurveCompoArc2P( lua_State* L)
{
// 3 o 4 parametri : Id, ptMid, ptNew [, nRefType]
// 3, 4 o 5 parametri : Id, ptMid, ptNew [, bEndVsStart] [, nRefType]
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptMid ;
LuaCheckParam( L, 2, ptMid)
Point3d ptNew ;
LuaCheckParam( L, 3, ptNew)
bool bEndVsStart = true ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 4, bEndVsStart))
LuaGetParam( L, 5, nRefType) ;
else
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// aggiungo arco per 3P in coda alla curva composita
bool bOk = ExeAddCurveCompoArc2P( nId, ptMid, ptNew, nRefType) ;
bool bOk = ExeAddCurveCompoArc2P( nId, ptMid, ptNew, bEndVsStart, nRefType) ;
LuaSetParam( L, bOk) ;
return 1 ;
}
@@ -648,7 +662,7 @@ LuaAddCurveCompoArc2P( lua_State* L)
static int
LuaRemoveCurveCompoCurve( lua_State* L)
{
// 1 o 2 parametri : Id, [, bLast]
// 1 o 2 parametri : Id [, bLast]
int nId ;
LuaCheckParam( L, 1, nId)
bool bLast ;