EgtExecutor 1.8c3 :

- aggiunte funzioni Exe e Lua GetFirstGhostPart e GetNextGhostPart.
This commit is contained in:
Dario Sassi
2017-03-06 18:55:40 +00:00
parent 358915d2e7
commit dfb706d40f
4 changed files with 96 additions and 0 deletions
+50
View File
@@ -30,6 +30,14 @@ ExeIsUserObj( IGeomDB* pGeomDB, int nId)
return ( pGeomDB->GetCalcLevel( nId, nLev) && nLev == GDB_LV_USER) ;
}
//-------------------------------------------------------------------------------
static bool
ExeIsSystemObj( IGeomDB* pGeomDB, int nId)
{
int nLev ;
return ( pGeomDB->GetCalcLevel( nId, nLev) && nLev == GDB_LV_SYSTEM) ;
}
//-------------------------------------------------------------------------------
static bool
ExeIsVisibleObj( IGeomDB* pGeomDB, int nId)
@@ -65,6 +73,24 @@ ExeVerifyOrPrev( IGeomDB* pGeomDB, int nId, bool bOnlyVisible)
return GDB_ID_NULL ;
}
//-------------------------------------------------------------------------------
static int
ExeGhostVerifyOrNext( IGeomDB* pGeomDB, int nId)
{
while ( nId != GDB_ID_NULL) {
if ( ExeIsSystemObj( pGeomDB, nId) &&
pGeomDB->ExistsInfo( nId, GDB_SI_SOURCE)) {
int nPartId = GDB_ID_NULL ;
pGeomDB->GetInfo( nId, GDB_SI_SOURCE, nPartId) ;
int nRawId = pGeomDB->GetParentId( nPartId) ;
if ( ExeIsRawPart( nRawId))
return nId ;
}
nId = pGeomDB->GetNextGroup( nId) ;
}
return GDB_ID_NULL ;
}
//-------------------------------------------------------------------------------
bool
ExeIsPart( int nPartId)
@@ -318,6 +344,30 @@ ExeGetPrevLayer( int nId, bool bOnlyVisible)
return ExeVerifyOrPrev( pGeomDB, nLayerId, bOnlyVisible) ;
}
//-------------------------------------------------------------------------------
int
ExeGetFirstGhostPart( void)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero il primo gruppo sotto la radice
int nPartId = pGeomDB->GetFirstGroupInGroup( GDB_ID_ROOT) ;
// verifico oppure passo al primo successivo valido
return ExeGhostVerifyOrNext( pGeomDB, nPartId) ;
}
//-------------------------------------------------------------------------------
int
ExeGetNextGhostPart( int nId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero il successivo gruppo
int nPartId = pGeomDB->GetNextGroup( nId) ;
// verifico oppure passo al primo successivo valido
return ExeGhostVerifyOrNext( pGeomDB, nPartId) ;
}
//-------------------------------------------------------------------------------
bool
ExeEraseEmptyParts( void)