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:
+94
-8
@@ -38,13 +38,56 @@ ExeCopyAttributes( int nSouId, int nDestId)
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeSetLevel( int nId, int nLevel)
|
ExeSetLevel( const INTVECTOR& vIds, int nLevel)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, false)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// imposto il livello
|
// recupero pezzo e layer correnti
|
||||||
bool bOk = pGeomDB->SetLevel( nId, nLevel) ;
|
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() ;
|
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 ;
|
return bOk ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,13 +131,56 @@ ExeGetCalcLevel( int nId, int* pnLevel)
|
|||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool
|
bool
|
||||||
ExeSetMode( int nId, int nMode)
|
ExeSetMode( const INTVECTOR& vIds, int nMode)
|
||||||
{
|
{
|
||||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||||
VERIFY_GEOMDB( pGeomDB, false)
|
VERIFY_GEOMDB( pGeomDB, false)
|
||||||
// imposto il modo
|
// recupero pezzo e layer correnti
|
||||||
bool bOk = pGeomDB->SetMode( nId, nMode) ;
|
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() ;
|
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 ;
|
return bOk ;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -149,11 +235,11 @@ ExeSetStatus( const INTVECTOR& vIds, int nStat)
|
|||||||
int nCurrLayerId = ExeGetCurrLayer() ;
|
int nCurrLayerId = ExeGetCurrLayer() ;
|
||||||
// ciclo sul vettore degli identificativi
|
// ciclo sul vettore degli identificativi
|
||||||
bool bOk = true ;
|
bool bOk = true ;
|
||||||
for ( size_t i = 0 ; i < vIds.size() && bOk ; ++ i) {
|
for ( int i = 0 ; i < ssize( vIds) && bOk ; ++ i) {
|
||||||
// impostazione stato
|
// impostazione stato
|
||||||
int nId = (( vIds[i] != GDB_ID_SEL) ? vIds[i] : pGeomDB->GetFirstSelectedObj()) ;
|
int nId = (( vIds[i] != GDB_ID_SEL) ? vIds[i] : pGeomDB->GetFirstSelectedObj()) ;
|
||||||
while ( nId != GDB_ID_NULL) {
|
while ( nId != GDB_ID_NULL) {
|
||||||
// imposto il modo
|
// imposto lo stato
|
||||||
if ( ! pGeomDB->SetStatus( nId, nStat))
|
if ( ! pGeomDB->SetStatus( nId, nStat))
|
||||||
bOk = false ;
|
bOk = false ;
|
||||||
// se nascosto pezzo corrente o layer corrente
|
// se nascosto pezzo corrente o layer corrente
|
||||||
|
|||||||
Binary file not shown.
+4
-4
@@ -105,7 +105,7 @@
|
|||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<MinimalRebuild>false</MinimalRebuild>
|
<MinimalRebuild>false</MinimalRebuild>
|
||||||
<OpenMPSupport>false</OpenMPSupport>
|
<OpenMPSupport>false</OpenMPSupport>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@@ -131,7 +131,7 @@ copy $(TargetPath) \EgtProg\DllD32</Command>
|
|||||||
<OmitFramePointers>false</OmitFramePointers>
|
<OmitFramePointers>false</OmitFramePointers>
|
||||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
<MinimalRebuild>false</MinimalRebuild>
|
<MinimalRebuild>false</MinimalRebuild>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
<AdditionalOptions>-Wno-tautological-undefined-compare</AdditionalOptions>
|
<AdditionalOptions>-Wno-tautological-undefined-compare</AdditionalOptions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
@@ -166,7 +166,7 @@ copy $(TargetPath) \EgtProg\DllD64</Command>
|
|||||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||||
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
|
||||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@@ -201,7 +201,7 @@ copy $(TargetPath) \EgtProg\Dll32</Command>
|
|||||||
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
|
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
|
||||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||||
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
<EnableEnhancedInstructionSet>NotSet</EnableEnhancedInstructionSet>
|
||||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
<LanguageStandard>stdcpp20</LanguageStandard>
|
||||||
<AdditionalOptions>-Wno-tautological-undefined-compare</AdditionalOptions>
|
<AdditionalOptions>-Wno-tautological-undefined-compare</AdditionalOptions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
|
|||||||
@@ -42,13 +42,13 @@ LuaCopyAttributes( lua_State* L)
|
|||||||
static int
|
static int
|
||||||
LuaSetLevel( lua_State* L)
|
LuaSetLevel( lua_State* L)
|
||||||
{
|
{
|
||||||
// 2 parametri : nId, nLevel
|
// 2 parametri : Ids, nLevel
|
||||||
int nId ;
|
INTVECTOR vId ;
|
||||||
LuaCheckParam( L, 1, nId)
|
LuaCheckParam( L, 1, vId)
|
||||||
int nLevel ;
|
int nLevel ;
|
||||||
LuaCheckParam( L, 2, nLevel)
|
LuaCheckParam( L, 2, nLevel)
|
||||||
// imposto lo stato
|
// imposto lo stato
|
||||||
bool bOk = ExeSetLevel( nId, nLevel) ;
|
bool bOk = ExeSetLevel( vId, nLevel) ;
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
LuaSetParam( L, bOk) ;
|
LuaSetParam( L, bOk) ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
@@ -111,14 +111,14 @@ LuaGetCalcLevel( lua_State* L)
|
|||||||
static int
|
static int
|
||||||
LuaSetMode( lua_State* L)
|
LuaSetMode( lua_State* L)
|
||||||
{
|
{
|
||||||
// 2 parametri : nId, nMode
|
// 2 parametri : Ids, nMode
|
||||||
int nId ;
|
INTVECTOR vId ;
|
||||||
LuaCheckParam( L, 1, nId)
|
LuaCheckParam( L, 1, vId)
|
||||||
int nMode ;
|
int nMode ;
|
||||||
LuaCheckParam( L, 2, nMode)
|
LuaCheckParam( L, 2, nMode)
|
||||||
LuaClearStack( L) ;
|
LuaClearStack( L) ;
|
||||||
// imposto il modo
|
// imposto il modo
|
||||||
bool bOk = ExeSetMode( nId, nMode) ;
|
bool bOk = ExeSetMode( vId, nMode) ;
|
||||||
// restituisco il risultato
|
// restituisco il risultato
|
||||||
LuaSetParam( L, bOk) ;
|
LuaSetParam( L, bOk) ;
|
||||||
return 1 ;
|
return 1 ;
|
||||||
@@ -179,7 +179,7 @@ LuaGetCalcMode( lua_State* L)
|
|||||||
static int
|
static int
|
||||||
LuaSetStatus( lua_State* L)
|
LuaSetStatus( lua_State* L)
|
||||||
{
|
{
|
||||||
// 2 parametri : Id, nStatus
|
// 2 parametri : Ids, nStatus
|
||||||
INTVECTOR vId ;
|
INTVECTOR vId ;
|
||||||
LuaCheckParam( L, 1, vId)
|
LuaCheckParam( L, 1, vId)
|
||||||
int nStatus ;
|
int nStatus ;
|
||||||
|
|||||||
Reference in New Issue
Block a user