EgtExecutor :
- in InsertFile ora sono gestiti anche i Duplicati.
This commit is contained in:
@@ -816,3 +816,35 @@ ExeDuploGetOriginal( int nDupId)
|
||||
pGeomDB->GetInfo( nDupId, GDB_SI_DUPSOU, nOrigId) ;
|
||||
return nOrigId ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeInsertDuplo( int nInsGrp)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
// Cerco il gruppo dei duplicati sotto il gruppo di inserimento
|
||||
int nInsDplId = pGeomDB->GetFirstNameInGroup( nInsGrp, DUPLO_BASE) ;
|
||||
if ( nInsDplId == GDB_ID_NULL)
|
||||
return true ;
|
||||
// Recupero il gruppo base dei duplicati
|
||||
int nDuploBaseId = GetDuploBase( pGeomDB, true) ;
|
||||
if ( nDuploBaseId == GDB_ID_NULL)
|
||||
return false ;
|
||||
// Sistemo i duplicati
|
||||
int nId = pGeomDB->GetFirstInGroup( nInsDplId) ;
|
||||
while ( nId != GDB_ID_NULL) {
|
||||
int nNextId = pGeomDB->GetNext( nId) ;
|
||||
int nSouId ;
|
||||
if ( pGeomDB->GetInfo( nId, GDB_SI_DUPSOU, nSouId) && ExeIsPart( nSouId)) {
|
||||
pGeomDB->Relocate( nId, nDuploBaseId) ;
|
||||
}
|
||||
else
|
||||
pGeomDB->Erase( nId) ;
|
||||
nId = nNextId ;
|
||||
}
|
||||
// Rimuovo il gruppo dei duplicati di inserimento
|
||||
pGeomDB->Erase( nInsDplId) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user