EgtExecutor 1.8c3 :
- aggiunte funzioni Exe e Lua GetFirstGhostPart e GetNextGhostPart.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user