EgtGeomKernel :

- aggiunta relocate sia locale sia globale (per spostare oggetti da un gruppo ad un altro).
This commit is contained in:
Dario Sassi
2014-04-10 13:52:12 +00:00
parent cc86dbd73d
commit 1689225119
5 changed files with 101 additions and 8 deletions
+30
View File
@@ -89,6 +89,8 @@ GdbExecutor::GdbExecutor( void)
m_ExecMgr.Insert( "INF", &GdbExecutor::ExecuteInfo) ;
m_ExecMgr.Insert( "INFO", &GdbExecutor::ExecuteInfo) ;
m_ExecMgr.Insert( "COPY", &GdbExecutor::ExecuteCopy) ;
m_ExecMgr.Insert( "REL", &GdbExecutor::ExecuteRelocate) ;
m_ExecMgr.Insert( "RELOCATE", &GdbExecutor::ExecuteRelocate) ;
m_ExecMgr.Insert( "ERASE", &GdbExecutor::ExecuteErase) ;
m_ExecMgr.Insert( "MOV", &GdbExecutor::ExecuteTranslate) ;
m_ExecMgr.Insert( "MOVE", &GdbExecutor::ExecuteTranslate) ;
@@ -1506,6 +1508,34 @@ GdbExecutor::ExecuteCopy( const std::string& sCmd2, const STRVECTOR& vsParams)
return ( nIdNew != GDB_ID_NULL) ;
}
//----------------------------------------------------------------------------
bool
GdbExecutor::ExecuteRelocate( const std::string& sCmd2, const STRVECTOR& vsParams)
{
// 2 parametri ( Id, NewParentId)
if ( vsParams.size() != 2)
return false ;
// recupero lista nomi
INTVECTOR vnNames ;
if ( ! GetNamesParam( vsParams[0], vnNames))
return false ;
// recupero flag per globale
bool bGlob = ( sCmd2 == "GLOB" || sCmd2 == "G") ;
// esecuzione rilocazioni
INTVECTOR::iterator Iter ;
for ( Iter = vnNames.begin() ; Iter != vnNames.end() ; ++Iter) {
if ( bGlob) {
if ( ! m_pGDB->RelocateGlob( *Iter, GetIdParam( vsParams[1])))
return false ;
}
else {
if ( ! m_pGDB->Relocate( *Iter, GetIdParam( vsParams[1])))
return false ;
}
}
return true ;
}
//----------------------------------------------------------------------------
bool
GdbExecutor::ExecuteErase( const std::string& sCmd2, const STRVECTOR& vsParams)