diff --git a/EXE_GdbObjAttribs.cpp b/EXE_GdbObjAttribs.cpp
index ed17f36..962a435 100644
--- a/EXE_GdbObjAttribs.cpp
+++ b/EXE_GdbObjAttribs.cpp
@@ -38,13 +38,56 @@ ExeCopyAttributes( int nSouId, int nDestId)
//-----------------------------------------------------------------------------
bool
-ExeSetLevel( int nId, int nLevel)
+ExeSetLevel( const INTVECTOR& vIds, int nLevel)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
- // imposto il livello
- bool bOk = pGeomDB->SetLevel( nId, nLevel) ;
+ // recupero pezzo e layer correnti
+ bool bCurrPartOff = false ;
+ bool bCurrLayerOff = false ;
+ int nCurrPartId = ExeGetCurrPart() ;
+ int nCurrLayerId = ExeGetCurrLayer() ;
+ // ciclo sul vettore degli identificativi
+ bool bOk = true ;
+ for ( int i = 0 ; i < ssize( vIds) && bOk ; ++ i) {
+ // impostazione livello
+ int nId = (( vIds[i] != GDB_ID_SEL) ? vIds[i] : pGeomDB->GetFirstSelectedObj()) ;
+ while ( nId != GDB_ID_NULL) {
+ // imposto il livello
+ if ( ! pGeomDB->SetLevel( nId, nLevel))
+ bOk = false ;
+ // se nascosto pezzo corrente o layer corrente
+ if ( nLevel != GDB_LV_USER) {
+ if ( nId == nCurrPartId)
+ bCurrPartOff = true ;
+ else if ( nId == nCurrLayerId)
+ bCurrLayerOff = true ;
+ }
+ // passo al successivo
+ nId = (( vIds[i] != GDB_ID_SEL) ? GDB_ID_NULL : pGeomDB->GetNextSelectedObj()) ;
+ }
+ }
+ // se pezzo o layer correnti da rideterminare
+ bool bPrevCmdLog = SetCmdLog( false) ;
+ if ( bCurrPartOff)
+ ExeResetCurrPartLayer() ;
+ else if ( bCurrLayerOff)
+ ExeSetCurrPartLayer( nCurrPartId, ExeGetFirstLayer( nCurrPartId, true)) ;
+ SetCmdLog( bPrevCmdLog) ;
+ // dichiaro progetto modificato
ExeSetModified() ;
+ // se richiesto, salvo il comando Lua equivalente
+ if ( IsCmdLog()) {
+ string sLevel = "GDB_LV.USER" ;
+ if ( nLevel == GDB_LV_SYSTEM)
+ sLevel = "GDB_LV.SYSTEM" ;
+ else if ( nLevel == GDB_LV_TEMP)
+ sLevel = "GDB_LV.TEMP" ;
+ string sLua = "EgtSetLevel({" + IdListToString( vIds) + "}," +
+ sLevel + ")" +
+ " -- Ok=" + ToString( bOk) ;
+ LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
+ }
return bOk ;
}
@@ -88,13 +131,56 @@ ExeGetCalcLevel( int nId, int* pnLevel)
//-----------------------------------------------------------------------------
bool
-ExeSetMode( int nId, int nMode)
+ExeSetMode( const INTVECTOR& vIds, int nMode)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
- // imposto il modo
- bool bOk = pGeomDB->SetMode( nId, nMode) ;
+ // recupero pezzo e layer correnti
+ bool bCurrPartOff = false ;
+ bool bCurrLayerOff = false ;
+ int nCurrPartId = ExeGetCurrPart() ;
+ int nCurrLayerId = ExeGetCurrLayer() ;
+ // ciclo sul vettore degli identificativi
+ bool bOk = true ;
+ for ( int i = 0 ; i < ssize( vIds) && bOk ; ++ i) {
+ // impostazione livello
+ int nId = (( vIds[i] != GDB_ID_SEL) ? vIds[i] : pGeomDB->GetFirstSelectedObj()) ;
+ while ( nId != GDB_ID_NULL) {
+ // imposto il modo
+ if ( ! pGeomDB->SetMode( nId, nMode))
+ bOk = false ;
+ // se nascosto pezzo corrente o layer corrente
+ if ( nMode != GDB_MD_STD) {
+ if ( nId == nCurrPartId)
+ bCurrPartOff = true ;
+ else if ( nId == nCurrLayerId)
+ bCurrLayerOff = true ;
+ }
+ // passo al successivo
+ nId = (( vIds[i] != GDB_ID_SEL) ? GDB_ID_NULL : pGeomDB->GetNextSelectedObj()) ;
+ }
+ }
+ // se pezzo o layer correnti da rideterminare
+ bool bPrevCmdLog = SetCmdLog( false) ;
+ if ( bCurrPartOff)
+ ExeResetCurrPartLayer() ;
+ else if ( bCurrLayerOff)
+ ExeSetCurrPartLayer( nCurrPartId, ExeGetFirstLayer( nCurrPartId, true)) ;
+ SetCmdLog( bPrevCmdLog) ;
+ // dichiaro progetto modificato
ExeSetModified() ;
+ // se richiesto, salvo il comando Lua equivalente
+ if ( IsCmdLog()) {
+ string sMode = "GDB_MD.STD" ;
+ if ( nMode == GDB_MD_LOCKED)
+ sMode = "GDB_MD.LOCKED" ;
+ else if ( nMode == GDB_MD_HIDDEN)
+ sMode = "GDB_MD.HIDDEN" ;
+ string sLua = "EgtSetMode({" + IdListToString( vIds) + "}," +
+ sMode + ")" +
+ " -- Ok=" + ToString( bOk) ;
+ LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
+ }
return bOk ;
}
@@ -149,11 +235,11 @@ ExeSetStatus( const INTVECTOR& vIds, int nStat)
int nCurrLayerId = ExeGetCurrLayer() ;
// ciclo sul vettore degli identificativi
bool bOk = true ;
- for ( size_t i = 0 ; i < vIds.size() && bOk ; ++ i) {
+ for ( int i = 0 ; i < ssize( vIds) && bOk ; ++ i) {
// impostazione stato
int nId = (( vIds[i] != GDB_ID_SEL) ? vIds[i] : pGeomDB->GetFirstSelectedObj()) ;
while ( nId != GDB_ID_NULL) {
- // imposto il modo
+ // imposto lo stato
if ( ! pGeomDB->SetStatus( nId, nStat))
bOk = false ;
// se nascosto pezzo corrente o layer corrente
diff --git a/EgtExecutor.rc b/EgtExecutor.rc
index 01e79d7..0ade074 100644
Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ
diff --git a/EgtExecutor.vcxproj b/EgtExecutor.vcxproj
index 241f4cb..8c74b69 100644
--- a/EgtExecutor.vcxproj
+++ b/EgtExecutor.vcxproj
@@ -105,7 +105,7 @@
true
false
false
- stdcpp17
+ stdcpp20
Windows
@@ -131,7 +131,7 @@ copy $(TargetPath) \EgtProg\DllD32
false
true
false
- stdcpp17
+ stdcpp20
-Wno-tautological-undefined-compare
@@ -166,7 +166,7 @@ copy $(TargetPath) \EgtProg\DllD64
StreamingSIMDExtensions2
true
true
- stdcpp17
+ stdcpp20
Windows
@@ -201,7 +201,7 @@ copy $(TargetPath) \EgtProg\Dll32
false
true
NotSet
- stdcpp17
+ stdcpp20
-Wno-tautological-undefined-compare
diff --git a/LUA_GdbObjAttribs.cpp b/LUA_GdbObjAttribs.cpp
index 99bc667..9b83f50 100644
--- a/LUA_GdbObjAttribs.cpp
+++ b/LUA_GdbObjAttribs.cpp
@@ -42,13 +42,13 @@ LuaCopyAttributes( lua_State* L)
static int
LuaSetLevel( lua_State* L)
{
- // 2 parametri : nId, nLevel
- int nId ;
- LuaCheckParam( L, 1, nId)
+ // 2 parametri : Ids, nLevel
+ INTVECTOR vId ;
+ LuaCheckParam( L, 1, vId)
int nLevel ;
LuaCheckParam( L, 2, nLevel)
// imposto lo stato
- bool bOk = ExeSetLevel( nId, nLevel) ;
+ bool bOk = ExeSetLevel( vId, nLevel) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
@@ -111,14 +111,14 @@ LuaGetCalcLevel( lua_State* L)
static int
LuaSetMode( lua_State* L)
{
- // 2 parametri : nId, nMode
- int nId ;
- LuaCheckParam( L, 1, nId)
+ // 2 parametri : Ids, nMode
+ INTVECTOR vId ;
+ LuaCheckParam( L, 1, vId)
int nMode ;
LuaCheckParam( L, 2, nMode)
LuaClearStack( L) ;
// imposto il modo
- bool bOk = ExeSetMode( nId, nMode) ;
+ bool bOk = ExeSetMode( vId, nMode) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
@@ -179,7 +179,7 @@ LuaGetCalcMode( lua_State* L)
static int
LuaSetStatus( lua_State* L)
{
- // 2 parametri : Id, nStatus
+ // 2 parametri : Ids, nStatus
INTVECTOR vId ;
LuaCheckParam( L, 1, vId)
int nStatus ;