EgtGeomKernel 1.6d8 :

- possibilità di salvare solo un gruppo o una entità del progetto.
This commit is contained in:
Dario Sassi
2015-04-30 20:41:23 +00:00
parent 21b34288bd
commit d446b03086
10 changed files with 112 additions and 51 deletions
+23 -4
View File
@@ -133,6 +133,13 @@ GdbGroup::Clone( int nId) const
//----------------------------------------------------------------------------
bool
GdbGroup::Save( NgeWriter& ngeOut) const
{
return ( SaveEmpty( ngeOut) && SaveChildren( ngeOut)) ;
}
//----------------------------------------------------------------------------
bool
GdbGroup::SaveEmpty( NgeWriter& ngeOut) const
{
// tipo entità e identificativi
if ( ! ngeOut.WriteKey( NGE_A_GRP))
@@ -156,14 +163,26 @@ GdbGroup::Save( NgeWriter& ngeOut) const
if ( ! ngeOut.WriteFrame( m_frF, ";", true))
return false ;
// salvataggio dei figli
return true ;
}
//----------------------------------------------------------------------------
bool
GdbGroup::SaveChildren( NgeWriter& ngeOut) const
{
// ciclo sui figli
const GdbObj* pGdbObj = GetFirstObj() ;
while ( pGdbObj != nullptr) {
if ( ! pGdbObj->Save( ngeOut))
return false ;
// recupero il livello dell'oggetto
int nLevel = GDB_LV_USER ;
pGdbObj->GetLevel( nLevel) ;
// se non temporaneo, lo salvo
if ( nLevel != GDB_LV_TEMP) {
if ( ! pGdbObj->Save( ngeOut))
return false ;
}
pGdbObj = pGdbObj->GetNext() ;
}
return true ;
}