EgtExecutor 2.7k1 :

- ricompilazione per passaggio a C++ 20
- modifiche a funzioni exe/lua SetLevel e SetMode per ricevere un vettore di Id.
This commit is contained in:
Dario Sassi
2025-11-01 17:37:44 +01:00
parent 8fcf079126
commit 2b3574cefc
4 changed files with 107 additions and 21 deletions
+94 -8
View File
@@ -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
BIN
View File
Binary file not shown.
+4 -4
View File
@@ -105,7 +105,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<OpenMPSupport>false</OpenMPSupport>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -131,7 +131,7 @@ copy $(TargetPath) \EgtProg\DllD32</Command>
<OmitFramePointers>false</OmitFramePointers>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalOptions>-Wno-tautological-undefined-compare</AdditionalOptions>
</ClCompile>
<Link>
@@ -166,7 +166,7 @@ copy $(TargetPath) \EgtProg\DllD64</Command>
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@@ -201,7 +201,7 @@ copy $(TargetPath) \EgtProg\Dll32</Command>
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalOptions>-Wno-tautological-undefined-compare</AdditionalOptions>
</ClCompile>
<Link>
+9 -9
View File
@@ -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 ;