EgtInterface 1.6b1 :
- gestione estrusione con facce di chiusura - gestione rivoluzione con facce di chiusura - razionalizzazione passaggio a locale.
This commit is contained in:
+46
-5
@@ -335,6 +335,13 @@ __stdcall EgtChangeId( int nId, int nNewId)
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// eseguo cambio di Id
|
||||
bool bOk = pGeomDB->ChangeId( nId, nNewId) ;
|
||||
// se pezzo corrente o layer corrente
|
||||
if ( bOk) {
|
||||
if ( nId == EgtGetCurrPart())
|
||||
EgtSetCurrPartLayer( nNewId, EgtGetCurrLayer()) ;
|
||||
else if ( nId == EgtGetCurrLayer())
|
||||
EgtSetCurrPartLayer( EgtGetCurrPart(), nNewId) ;
|
||||
}
|
||||
EgtSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
@@ -365,20 +372,28 @@ __stdcall EgtErase( int nId)
|
||||
}
|
||||
// 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) {
|
||||
// cancello
|
||||
if ( ! pGeomDB->Erase( nI))
|
||||
bOk = false ;
|
||||
// se cancellato pezzo corrente o layer corrente
|
||||
int nCurrPartId = EgtGetCurrPart() ;
|
||||
// verifico se cancellato pezzo corrente o layer corrente
|
||||
if ( nI == nCurrPartId)
|
||||
EgtResetCurrPartLayer() ;
|
||||
else if ( nI == EgtGetCurrLayer())
|
||||
EgtSetCurrPartLayer( nCurrPartId, EgtGetFirstVisibleLayer( nCurrPartId)) ;
|
||||
bErasedCurrPart = true ;
|
||||
else if ( nI == nCurrLayerId)
|
||||
bErasedCurrLayer = true ;
|
||||
// passo al successivo
|
||||
nI = pGeomDB->GetFirstSelectedObj() ;
|
||||
}
|
||||
// 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
|
||||
@@ -391,6 +406,32 @@ __stdcall EgtErase( int nId)
|
||||
return ( bOk ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL
|
||||
__stdcall EgtEmptyGroup( int nId)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
|
||||
// svuoto il gruppo
|
||||
bool bOk = pGeomDB->EmptyGroup( nId) ;
|
||||
// se cancellato pezzo corrente o layer corrente
|
||||
int nCurrPartId = EgtGetCurrPart() ;
|
||||
int nCurrLayerId = EgtGetCurrLayer() ;
|
||||
if ( ! pGeomDB->ExistsObj( nCurrPartId))
|
||||
EgtResetCurrPartLayer() ;
|
||||
else if ( ! pGeomDB->ExistsObj( nCurrLayerId))
|
||||
EgtSetCurrPartLayer( nCurrPartId, EgtGetFirstVisibleLayer( nCurrPartId)) ;
|
||||
EgtSetModified() ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtEmptyGroup(" + ToString( nId) + ")" +
|
||||
" -- Ok=" + ToString( bOk) ;
|
||||
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
|
||||
}
|
||||
// restituisco risultato
|
||||
return ( bOk ? TRUE : FALSE) ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
int
|
||||
__stdcall EgtGetType( int nId)
|
||||
|
||||
Reference in New Issue
Block a user