EgtExecutor 2.1i3 :
- aggiunte funzioni Exe e Lua SurfTmSwapFacets, SurfTmGetFacetBBox e SurfTmGetFacetBBoxGlob.
This commit is contained in:
+69
-1
@@ -283,7 +283,7 @@ LuaCopySurfTmFacet( lua_State* L)
|
||||
int nDestGrpId ;
|
||||
LuaCheckParam( L, 3, nDestGrpId)
|
||||
LuaClearStack( L) ;
|
||||
// recupero i contorni della faccetta della superficie
|
||||
// copio la faccia della superficie nel gruppo indicato
|
||||
int nNewId = ExeCopySurfTmFacet( nId, nFacet, nDestGrpId) ;
|
||||
// restituisco il risultato
|
||||
if ( nNewId != GDB_ID_NULL)
|
||||
@@ -293,6 +293,71 @@ LuaCopySurfTmFacet( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSurfTmSwapFacets( lua_State* L)
|
||||
{
|
||||
// 3 parametri : nId, nFacet1, nFacet2
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
int nFacet1 ;
|
||||
LuaCheckParam( L, 2, nFacet1)
|
||||
int nFacet2 ;
|
||||
LuaCheckParam( L, 3, nFacet2)
|
||||
LuaClearStack( L) ;
|
||||
// eseguo scambio facce della superficie
|
||||
bool bOk = ExeSurfTmSwapFacets( nId, nFacet1, nFacet2) ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSurfTmGetFacetBBox( lua_State* L)
|
||||
{
|
||||
// 3 parametri : nId, nFacet, nFlag
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
int nFacet ;
|
||||
LuaCheckParam( L, 2, nFacet)
|
||||
int nFlag ;
|
||||
LuaCheckParam( L, 3, nFlag)
|
||||
LuaClearStack( L) ;
|
||||
// recupero il bounding box della faccia in locale
|
||||
BBox3d b3Box ;
|
||||
bool bOk = ExeSurfTmGetFacetBBox( nId, nFacet, nFlag, b3Box) ;
|
||||
// restituisco il risultato
|
||||
if ( bOk)
|
||||
LuaSetParam( L, b3Box) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaSurfTmGetFacetBBoxGlob( lua_State* L)
|
||||
{
|
||||
// 3 parametri : nId, nFacet, nFlag
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
int nFacet ;
|
||||
LuaCheckParam( L, 2, nFacet)
|
||||
int nFlag ;
|
||||
LuaCheckParam( L, 3, nFlag)
|
||||
LuaClearStack( L) ;
|
||||
// recupero il bounding box della faccia in locale
|
||||
BBox3d b3Box ;
|
||||
bool bOk = ExeSurfTmGetFacetBBoxGlob( nId, nFacet, nFlag, b3Box) ;
|
||||
// restituisco il risultato
|
||||
if ( bOk)
|
||||
LuaSetParam( L, b3Box) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCutSurfTmPlane( lua_State* L)
|
||||
@@ -353,6 +418,9 @@ LuaInstallGdbModifySurf( LuaMgr& luaMgr)
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtGetSurfTmSilhouette", LuaGetSurfTmSilhouette) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExtractSurfTmFacetLoops", LuaExtractSurfTmFacetLoops) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCopySurfTmFacet", LuaCopySurfTmFacet) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSwapFacets", LuaSurfTmSwapFacets) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetFacetBBox", LuaSurfTmGetFacetBBox) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetFacetBBoxGlob", LuaSurfTmGetFacetBBoxGlob) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCutSurfTmPlane", LuaCutSurfTmPlane) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCutSurfTmClosedCurve", LuaCutSurfTmClosedCurve) ;
|
||||
return bOk ;
|
||||
|
||||
Reference in New Issue
Block a user