EgtExecutor :

- aggiunta funzione Exe e Lua GetAllInGroup.
This commit is contained in:
Dario Sassi
2019-02-14 10:00:27 +00:00
parent 7a4f131fbe
commit 91a98e4bd9
2 changed files with 44 additions and 0 deletions
+24
View File
@@ -74,6 +74,30 @@ ExeGetGroupObjs( int nId)
return pGeomDB->GetGroupObjs( nId) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetAllInGroup( int nGroupId, INTVECTOR& vIds)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero il numero di oggetti nel gruppo
if ( ! pGeomDB->ExistsObj( nGroupId))
return false ;
// preparo il riempimento del vettore
vIds.clear() ;
int nCount = pGeomDB->GetGroupObjs( nGroupId) ;
if ( nCount == 0)
return true ;
vIds.reserve( nCount) ;
// eseguo il riempimento
int nEntId = pGeomDB->GetFirstInGroup( nGroupId) ;
while ( nEntId != GDB_ID_NULL) {
vIds.emplace_back( nEntId) ;
nEntId = pGeomDB->GetNext( nEntId) ;
}
return true ;
}
//-----------------------------------------------------------------------------
int
ExeGetFirstInGroup( int nGroupId)