EgtGeomKernel :

- cambiato Load, con uso di NgeReader.
This commit is contained in:
Dario Sassi
2014-04-15 06:48:39 +00:00
parent f956fd20cc
commit 2cbdfc1db9
33 changed files with 492 additions and 330 deletions
+13 -24
View File
@@ -16,6 +16,7 @@
#include "GdbGroup.h"
#include "IdManager.h"
#include "NgeWriter.h"
#include "NgeReader.h"
#include "/EgtDev/Include/EGkGdbFunct.h"
#include "/EgtDev/Include/EGnStringUtils.h"
@@ -107,7 +108,7 @@ GdbGroup::Save( NgeWriter& ngeOut) const
bool bOk = true ;
// tipo entità e identificativi
ngeOut.WriteKey( NGE_A_GRP, true) ;
ngeOut.WriteKey( NGE_A_GRP) ;
ngeOut.WriteInt( m_nId, "@") ;
ngeOut.WriteInt( GetParentId(), nullptr, true) ;
@@ -116,7 +117,7 @@ GdbGroup::Save( NgeWriter& ngeOut) const
bOk = false ;
// dati del riferimento
ngeOut.WriteKey( NGE_G, true) ;
ngeOut.WriteKey( NGE_G) ;
if ( ! m_gfrFrame.Save( ngeOut))
bOk = false ;
@@ -133,46 +134,34 @@ GdbGroup::Save( NgeWriter& ngeOut) const
//----------------------------------------------------------------------------
bool
GdbGroup::Load( const string& sType, Scanner& TheScanner, int& nParentId)
GdbGroup::Load( int nNgeId, NgeReader& ngeIn, int& nParentId)
{
string sLine ;
STRVECTOR vsParams ;
// leggo la prossima linea
if ( ! TheScanner.GetLine( sLine))
if ( ! ngeIn.ReadInt( m_nId, "@"))
return false ;
// la divido in parametri
Tokenize( sLine, "@", vsParams) ;
// 2 parametri : Id e ParentId
if ( vsParams.size() != 2)
return false ;
// assegno l'identificativo
if ( ! FromString( vsParams[0], m_nId))
return false ;
// assegno l'Id del padre
if ( ! FromString( vsParams[1], nParentId))
if ( ! ngeIn.ReadInt( nParentId, nullptr, true))
return false ;
// leggo la prossima linea
if ( ! TheScanner.GetLine( sLine))
int nKey ;
if ( ! ngeIn.ReadKey( nKey))
return false ;
// eventuali attributi
if ( sLine == "A") {
if ( ! GdbObj::LoadAttribs( TheScanner))
if ( nKey == NGE_A) {
if ( ! GdbObj::LoadAttribs( ngeIn))
return false ;
// leggo la prossima linea
if ( ! TheScanner.GetLine( sLine))
if ( ! ngeIn.ReadKey( nKey))
return false ;
}
// verifico inizio dati geometrici
if ( sLine != "G")
if ( nKey != NGE_G)
return false ;
// leggo i dati del riferimento
return m_gfrFrame.Load( TheScanner) ;
return m_gfrFrame.Load( ngeIn) ;
}
//----------------------------------------------------------------------------