EgtExecutor 1.6g7 :

- aggiunte ExeCreateCurveCompoByApproximation e la corrispondente per LUA_GdbCreateCurve.cpp
- corretta ExeCurveDomain
This commit is contained in:
Dario Sassi
2015-07-27 13:35:47 +00:00
parent de05786c53
commit b19dc441e7
5 changed files with 90 additions and 8 deletions
+31
View File
@@ -702,6 +702,36 @@ LuaCreateCurveCompoByInterpolation( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateCurveCompoByApproximation( lua_State* L)
{
// 4 o 5 parametri : ParentId, ptPs, nType, dLinTol [, nRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
PNTVECTOR vPnt ;
LuaCheckParam( L, 2, vPnt)
int nType ;
LuaGetParam( L, 3, nType) ;
double dLinTol ;
LuaGetParam( L, 4, dLinTol) ;
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 5, nRefType) ;
LuaClearStack( L) ;
PolyLine PL ;
// creo una polilinea a partire dai punti
for ( size_t i = 0 ; i < vPnt.size() ; ++ i)
PL.AddUPoint( 0, vPnt[i]) ;
// creo la curva composita
int nId = ExeCreateCurveCompoByApproximation( nParentId, PL, nType, dLinTol, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateCurveCompoFromPoints( lua_State* L)
@@ -912,6 +942,7 @@ LuaInstallGdbCreateCurve( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompo", LuaCreateCurveCompo) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoByChain", LuaCreateCurveCompoByChain) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoByInterpolation", LuaCreateCurveCompoByInterpolation) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoByApproximation", LuaCreateCurveCompoByApproximation) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoFromPoints", LuaCreateCurveCompoFromPoints) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoFromPointBulges", LuaCreateCurveCompoFromPointBulges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtRectangle2P", LuaCreateRectangle2P) ;