EgtInterface 1.6b6 :

- aggiornamenti vari
- introdotto comando per merge (cucitura) di superfici
- migliorata gestione oggetti selezionati in comandi.
This commit is contained in:
Dario Sassi
2015-03-11 09:06:35 +00:00
parent 5e3c729190
commit b0389f3fda
28 changed files with 1168 additions and 614 deletions
+37 -34
View File
@@ -278,7 +278,7 @@ BOOL
__stdcall EgtRelocate( int nSouId, int nRefId, int nSonBeforeAfter)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo la rilocazione
bool bOk = pGeomDB->Relocate( nSouId, nRefId, nSonBeforeAfter) ;
EgtSetModified() ;
@@ -305,7 +305,7 @@ BOOL
__stdcall EgtRelocateGlob( int nSouId, int nRefId, int nSonBeforeAfter)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo la rilocazione mantenendo la posizione in globale
bool bOk = pGeomDB->RelocateGlob( nSouId, nRefId, nSonBeforeAfter) ;
EgtSetModified() ;
@@ -332,7 +332,7 @@ BOOL
__stdcall EgtChangeId( int nId, int nNewId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
VERIFY_GEOMDB( pGeomDB, FALSE)
// eseguo cambio di Id
bool bOk = pGeomDB->ChangeId( nId, nNewId) ;
// se pezzo corrente o layer corrente
@@ -356,54 +356,57 @@ __stdcall EgtChangeId( int nId, int nNewId)
//-----------------------------------------------------------------------------
BOOL
__stdcall EgtErase( int nId)
{
INTVECTOR vIds ;
vIds.push_back( nId) ;
return ( EgtErase( vIds) ? TRUE : FALSE) ;
}
//-----------------------------------------------------------------------------
bool
EgtErase( const INTVECTOR& vIds)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
VERIFY_GEOMDB( pGeomDB, false)
// eseguo cancellazione
bool bOk = true ;
// eseguo cancellazione singola
if ( nId != GDB_ID_SEL) {
bOk = pGeomDB->Erase( nId) ;
// se cancellato pezzo corrente o layer corrente
int nCurrPartId = EgtGetCurrPart() ;
if ( nId == nCurrPartId)
EgtResetCurrPartLayer() ;
else if ( nId == EgtGetCurrLayer())
EgtSetCurrPartLayer( nCurrPartId, EgtGetFirstVisibleLayer( nCurrPartId)) ;
}
// eseguo cancellazione dei selezionati
else {
int nCurrPartId = EgtGetCurrPart() ;
int nCurrLayerId = EgtGetCurrLayer() ;
bool bErasedCurrPart = false ;
bool bErasedCurrLayer = false ;
int nI = pGeomDB->GetFirstSelectedObj() ;
while ( nI != GDB_ID_NULL && bOk) {
bool bErasedCurrPart = false ;
bool bErasedCurrLayer = false ;
int nCurrPartId = EgtGetCurrPart() ;
int nCurrLayerId = EgtGetCurrLayer() ;
for ( size_t i = 0 ; i < vIds.size() ; ++ i) {
int nId = (( vIds[i] != GDB_ID_SEL) ? vIds[i] : pGeomDB->GetFirstSelectedObj()) ;
while ( nId != GDB_ID_NULL) {
// cancello
if ( ! pGeomDB->Erase( nI))
if ( ! pGeomDB->Erase( nId))
bOk = false ;
// verifico se cancellato pezzo corrente o layer corrente
if ( nI == nCurrPartId)
if ( nId == nCurrPartId)
bErasedCurrPart = true ;
else if ( nI == nCurrLayerId)
else if ( nId == nCurrLayerId)
bErasedCurrLayer = true ;
// passo al successivo
nI = pGeomDB->GetFirstSelectedObj() ;
nId = (( vIds[i] != GDB_ID_SEL) ? GDB_ID_NULL : pGeomDB->GetFirstSelectedObj()) ;
}
// se cancellato pezzo corrente o layer corrente
if ( bErasedCurrPart)
EgtResetCurrPartLayer() ;
else if ( bErasedCurrLayer)
EgtSetCurrPartLayer( nCurrPartId, EgtGetFirstVisibleLayer( nCurrPartId)) ;
}
// se cancellato pezzo corrente o layer corrente
if ( bErasedCurrPart)
EgtResetCurrPartLayer() ;
else if ( bErasedCurrLayer)
EgtSetCurrPartLayer( nCurrPartId, EgtGetFirstVisibleLayer( nCurrPartId)) ;
EgtSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtErase(" + ( nId != GDB_ID_SEL ? ToString( nId) : "GDB_ID_SEL") + ")" +
string sIds ;
for ( size_t i = 0 ; i < vIds.size() ; ++ i)
sIds += ( vIds[i] != GDB_ID_SEL ? ToString( vIds[i]) : "GDB_ID_SEL") + "," ;
sIds.pop_back() ;
string sLua = "EgtErase({" + sIds + "})" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco risultato
return ( bOk ? TRUE : FALSE) ;
return bOk ;
}
//-----------------------------------------------------------------------------
@@ -411,7 +414,7 @@ BOOL
__stdcall EgtEmptyGroup( int nId)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
VERIFY_GEOMDB( pGeomDB, FALSE)
// svuoto il gruppo
bool bOk = pGeomDB->EmptyGroup( nId) ;
// se cancellato pezzo corrente o layer corrente