EgtExecutor 1.6g4 :

- aggiunta EraseEmptyParts a EXE e LUA
- possibilità di registrare i SetGlobVar per LUA.
This commit is contained in:
Dario Sassi
2015-07-15 13:40:20 +00:00
parent c5fdfea88c
commit fece5ea9fb
4 changed files with 91 additions and 5 deletions
+40
View File
@@ -252,6 +252,46 @@ ExeGetNextLayer( int nId, bool bOnlyVisible)
return ExeVerifyOrNext( pGeomDB, nLayerId, bOnlyVisible) ;
}
//-------------------------------------------------------------------------------
bool
ExeEraseEmptyParts( void)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero il primo pezzo
int nPartId = ExeVerifyOrNext( pGeomDB, pGeomDB->GetFirstGroupInGroup( GDB_ID_ROOT), false) ;
// ciclo sui pezzi
while ( nPartId != GDB_ID_NULL) {
// verifico se il pezzo non contiene alcuna entità geometrica
bool bFound = false ;
// ciclo sui layer dei pezzi
int nLayerId = ExeVerifyOrNext( pGeomDB, pGeomDB->GetFirstGroupInGroup( nPartId), false) ;
while ( nLayerId != GDB_ID_NULL) {
// verifico se il layer contiene qualcosa
if ( pGeomDB->GetGroupObjs( nLayerId) > 0) {
bFound = true ;
break ;
}
// passo al layer successivo
nLayerId = ExeVerifyOrNext( pGeomDB, pGeomDB->GetNextGroup( nLayerId), false) ;
}
// salvo Id pezzo corrente
int nOldId = nPartId ;
// passo al pezzo successivo
nPartId = ExeVerifyOrNext( pGeomDB, pGeomDB->GetNextGroup( nPartId), false) ;
// se corrente da cancelare, procedo
if ( ! bFound)
pGeomDB->Erase( nOldId) ;
}
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtEraseEmptyParts()"
" -- Ok=" + ToString( true) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
return true ;
}
//-----------------------------------------------------------------------------
bool
ExeSelectPartObjs( int nPartId)