EgtExecutor :

- aggiunto parametro opzionale dExtraBox a funzione ExeCreateVolZmapFromSurfTm ed equivalente lua EgtVolZmapFromSurfTm.
This commit is contained in:
Dario Sassi
2025-09-19 11:14:40 +02:00
parent 3d3098ed0b
commit bbe59a3d90
2 changed files with 14 additions and 9 deletions
+7 -6
View File
@@ -152,7 +152,7 @@ ExeCreateVolZmapByRegionExtrusion( int nParentId, int nSfrId, double dDimZ, doub
//-------------------------------------------------------------------------------
int
ExeCreateVolZmapFromSurfTm( int nParentId, int nStmId, double dPrec, bool bTriDex)
ExeCreateVolZmapFromSurfTm( int nParentId, int nStmId, double dPrec, bool bTriDex, double dExtraBox)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
@@ -169,7 +169,7 @@ ExeCreateVolZmapFromSurfTm( int nParentId, int nStmId, double dPrec, bool bTriDe
// creo lo Zmap nel suo riferimento intrinseco
PtrOwner<IVolZmap> pVZM( CreateVolZmap()) ;
bOk = bOk && ! IsNull( pVZM) ;
bOk = bOk && pVZM->CreateFromTriMesh( *pStm, dPrec, bTriDex) ;
bOk = bOk && pVZM->CreateFromTriMesh( *pStm, dPrec, bTriDex, dExtraBox) ;
// lo porto nel riferimento di destinazione
bOk = bOk && pVZM->LocToLoc( frStm, frDest) ;
// inserisco lo Zmap nel DB
@@ -177,10 +177,11 @@ ExeCreateVolZmapFromSurfTm( int nParentId, int nStmId, double dPrec, bool bTriDe
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtVolZmapFromTriMesh(" + IdToString( nParentId) + "," +
ToString( nStmId) + "," +
ToString( dPrec) + "," +
( bTriDex ? "true" : "false") + ")" +
string sLua = "EgtVolZmapFromSurfTm(" + IdToString( nParentId) + "," +
ToString( nStmId) + "," +
ToString( dPrec) + "," +
( bTriDex ? "true" : "false") + "," +
ToString( dExtraBox) + ")" +
" -- Id=" + ToString( nNewId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
+7 -3
View File
@@ -121,7 +121,7 @@ LuaCreateVolZmapByRegionExtrusion( lua_State* L)
static int
LuaCreateVolZmapFromSurfTm( lua_State* L)
{
// 3 o 4 parametri : ParentId, StmId, dPrec [, bTriDex]
// 3 o 4 o 5 parametri : ParentId, StmId, dPrec [, bTriDex] [, dExtraBox]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nStmId ;
@@ -129,10 +129,14 @@ LuaCreateVolZmapFromSurfTm( lua_State* L)
double dPrec ;
LuaCheckParam( L, 3, dPrec)
bool bTriDex = true ;
LuaGetParam( L, 4, bTriDex) ;
double dExtraBox = 0 ;
if ( LuaGetParam( L, 4, bTriDex))
LuaGetParam( L, 5, dExtraBox) ;
else
LuaGetParam( L, 4, dExtraBox) ;
LuaClearStack( L) ;
// creo VZM da superficie trimesh
int nId = ExeCreateVolZmapFromSurfTm( nParentId, nStmId, dPrec, bTriDex) ;
int nId = ExeCreateVolZmapFromSurfTm( nParentId, nStmId, dPrec, bTriDex, dExtraBox) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetParam( L, nId) ;