EgtGeomKernel 1.5d5 :
- aggiunta scrittura binaria - tolte GetKey, Load e Save da interfaccia IGeoObj.
This commit is contained in:
+17
-14
@@ -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)) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user