EgtGeomKernel 1.5d5 :

- aggiunta scrittura binaria
- tolte GetKey, Load e Save da interfaccia IGeoObj.
This commit is contained in:
Dario Sassi
2014-04-14 15:57:58 +00:00
parent 39db15e41e
commit f956fd20cc
37 changed files with 829 additions and 198 deletions
+17 -14
View File
@@ -17,6 +17,8 @@
#include "GeoObjFactory.h"
#include "CurveAux.h"
#include "Attribs.h"
#include "NgeWriter.h"
#include "GeoObjRW.h"
#include "/EgtDev/Include/EGkGdbFunct.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include <new>
@@ -81,25 +83,25 @@ GdbGeo::GetType( void) const
//----------------------------------------------------------------------------
bool
GdbGeo::Save( std::ostream& osOut) const
GdbGeo::Save( NgeWriter& ngeOut) const
{
bool bOk = true ;
// recupero il gestore di lettura/scrittura dell'entità
IGeoObjRW* pGObjRW = dynamic_cast<IGeoObjRW*>( m_pGeoObj) ;
if ( pGObjRW == nullptr)
return false ;
// tipo entità
osOut << m_pGeoObj->GetKey() << endl ;
// nome
osOut << m_nId << "@" << GetParentId() << endl ;
// tipo entità e identificativi
ngeOut.WriteKey( pGObjRW->GetNgeId(), true) ;
ngeOut.WriteInt( m_nId, "@") ;
ngeOut.WriteInt( GetParentId(), nullptr, true) ;
// attributi
if ( ! GdbObj::SaveAttribs( osOut))
bOk = false ;
if ( ! GdbObj::SaveAttribs( ngeOut))
return false ;
// parametri geometrici
osOut << "G" << endl ;
if ( ! m_pGeoObj->Save( osOut))
bOk = false ;
return bOk ;
ngeOut.WriteKey( NGE_G, true) ;
return pGObjRW->Save( ngeOut) ;
}
//----------------------------------------------------------------------------
@@ -150,7 +152,8 @@ GdbGeo::Load( const std::string& sType, Scanner& TheScanner, int& nParentId)
return false ;
// parametri geometrici
return m_pGeoObj->Load( TheScanner) ;
IGeoObjRW* pGObjRW = dynamic_cast<IGeoObjRW*>( m_pGeoObj) ;
return ( pGObjRW != nullptr && pGObjRW->Load( TheScanner)) ;
}
//----------------------------------------------------------------------------