EgtExecutor 1.9f2 :

- aggiunte funzioni Exe e Lua Set/GetTableAreaOffset.
This commit is contained in:
Dario Sassi
2018-06-12 06:50:39 +00:00
parent 4bbfabfeb2
commit 9060a19e34
3 changed files with 62 additions and 0 deletions
+20
View File
@@ -883,6 +883,16 @@ ExeSetTable( const string& sTable)
return pMachMgr->SetTable( sTable) ;
}
//-----------------------------------------------------------------------------
bool
ExeSetTableAreaOffset( double dOffsXP, double dOffsYP, double dOffsXM, double dOffsYM)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// imposto l'offset dell'area utile della tavola corrente
return pMachMgr->SetTableAreaOffset( dOffsXP, dOffsYP, dOffsXM, dOffsYM) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetTable( string& sTable)
@@ -913,6 +923,16 @@ ExeGetTableArea( int nInd, BBox3d& b3Area)
return pMachMgr->GetTableArea( nInd, b3Area) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetTableAreaOffset( int nInd, BBox3d& b3AreaOffs)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// recupero l'estensione dell'area utile con offset della tavola corrente della macchinata corrente
return pMachMgr->GetTableAreaOffset( nInd, b3AreaOffs) ;
}
//-----------------------------------------------------------------------------
bool
ExeShowOnlyTable( bool bVal)
BIN
View File
Binary file not shown.
+42
View File
@@ -913,6 +913,27 @@ LuaSetTable( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaSetTableAreaOffset( lua_State* L)
{
// 4 parametri : dOffsXP, dOffsYP, dOffsXM, dOffsYM
double dOffsXP ;
LuaCheckParam( L, 1, dOffsXP)
double dOffsYP ;
LuaCheckParam( L, 2, dOffsYP)
double dOffsXM ;
LuaCheckParam( L, 3, dOffsXM)
double dOffsYM ;
LuaCheckParam( L, 4, dOffsYM)
LuaClearStack( L) ;
// imposto l'offset dell'area della tavola corrente
bool bOk = ExeSetTableAreaOffset( dOffsXP, dOffsYP, dOffsXM, dOffsYM) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetTableName( lua_State* L)
@@ -968,6 +989,25 @@ LuaGetTableArea( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaGetTableAreaOffset( lua_State* L)
{
// 1 parametro opzionale : [nInd]
int nInd = 1 ;
LuaGetParam( L, 1, nInd) ;
LuaClearStack( L) ;
// recupero la area utile offsettata nInd-esima della tavola corrente
BBox3d b3AreaOffs ;
bool bOk = ExeGetTableAreaOffset( nInd, b3AreaOffs) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, b3AreaOffs) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaAddFixture( lua_State* L)
@@ -3394,9 +3434,11 @@ LuaInstallMachMgr( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtRotatePartInRawPart", LuaRotatePartInRawPart) ;
// Table & Fixtures
bOk = bOk && luaMgr.RegisterFunction( "EgtSetTable", LuaSetTable) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetTableAreaOffset", LuaSetTableAreaOffset) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetTableName", LuaGetTableName) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetTableRef", LuaGetTableRef) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetTableArea", LuaGetTableArea) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetTableAreaOffset", LuaGetTableAreaOffset) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtAddFixture", LuaAddFixture) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtKeepFixture", LuaKeepFixture) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveFixture", LuaRemoveFixture) ;