EgtGeomKernel 1.5j7 :

- aggiunta gestione copia attributi di oggetti.
This commit is contained in:
Dario Sassi
2014-11-05 17:00:05 +00:00
parent dd0496d5eb
commit 4c68e36219
5 changed files with 36 additions and 0 deletions
BIN
View File
Binary file not shown.
+18
View File
@@ -67,6 +67,18 @@ GdbObj::CopyFrom( const GdbObj* pSou)
// copio Id
m_nId = pSou->m_nId ;
// copio gli attributi
return CopyAttribsFrom( pSou) ;
}
//----------------------------------------------------------------------------
bool
GdbObj::CopyAttribsFrom( const GdbObj* pSou)
{
// se l'oggetto sorgente non esiste
if ( pSou == nullptr)
return false ;
// copio gli attributi
if ( pSou->m_pAttribs != nullptr) {
m_pAttribs = pSou->m_pAttribs->Clone() ;
@@ -78,6 +90,12 @@ GdbObj::CopyFrom( const GdbObj* pSou)
// marcatura sempre disabilitata
m_pAttribs->ResetMark() ;
}
// altrimenti li cancello
else {
if ( m_pAttribs != nullptr)
delete m_pAttribs ;
m_pAttribs = nullptr ;
}
return true ;
}
+1
View File
@@ -49,6 +49,7 @@ class GdbObj
public :
GdbObj( void) ;
bool CopyFrom( const GdbObj* pSou) ;
bool CopyAttribsFrom( const GdbObj* pSou) ;
public :
bool SaveAttribs( NgeWriter& ngeOut) const ;
+16
View File
@@ -1384,6 +1384,22 @@ GeomDB::DumpAttributes( int nId, string& sOut, const char* szNewLine) const
}
}
//----------------------------------------------------------------------------
bool
GeomDB::CopyAttributes( int nIdSou, int nIdDest)
{
// verifico esistenza del sorgente
GdbObj* pGdOSou = GetGdbObj( nIdSou) ;
if ( pGdOSou == nullptr)
return false ;
// verifico esistenza della destinazione
GdbObj* pGdODest = GetGdbObj( nIdDest) ;
if ( pGdODest == nullptr)
return false ;
// eseguo la copia
return pGdODest->CopyAttribsFrom( pGdOSou) ;
}
//----------------------------------------------------------------------------
bool
GeomDB::SetLevel( int nId, int nLevel)
+1
View File
@@ -108,6 +108,7 @@ class GeomDB : public IGeomDB
virtual bool ClearSelection( void) ;
// attributes
virtual bool DumpAttributes( int nId, std::string& sOut, const char* szNewLine) const ;
virtual bool CopyAttributes( int nIdSou, int nIdDest) ;
virtual bool SetLevel( int nId, int nLevel) ;
virtual bool RevertLevel( int nId) ;
virtual bool GetLevel( int nId, int& nLevel) const ;