EgtGeomKernel :
- gestione cancellazione oggetti puntati da GdbIterator - aggiunte a GdbIterator EraseAndGoToNext e EraseAndGoToPrev - possibilità di passare IGeomDB* al costruttore di GdbIterator.
This commit is contained in:
+19
-1
@@ -620,12 +620,30 @@ GeomDB::Erase( int nId)
|
||||
if ( pGdbObj == nullptr)
|
||||
return false ;
|
||||
|
||||
return Erase( pGdbObj) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
GeomDB::Erase( GdbObj* pGdbObj)
|
||||
{
|
||||
// deve essere valido
|
||||
if ( pGdbObj == nullptr)
|
||||
return false ;
|
||||
|
||||
// non si può cancellare il gruppo radice
|
||||
if ( pGdbObj == &m_GrpRadix)
|
||||
return false ;
|
||||
|
||||
// elimino da mappa dei nomi
|
||||
m_IdManager.RemoveObj( nId) ;
|
||||
m_IdManager.RemoveObj( pGdbObj->m_nId) ;
|
||||
|
||||
// eliminazione eventuale da lista dei selezionati
|
||||
m_SelManager.RemoveObj( pGdbObj) ;
|
||||
|
||||
// sistemazioni in eventuali GdbIterator con quell'oggetto corrente
|
||||
m_IterManager.ResetObjIfSame( pGdbObj) ;
|
||||
|
||||
// lo tolgo dalla lista
|
||||
pGdbObj->Remove() ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user