diff --git a/EXE_GdbObjSelection.cpp b/EXE_GdbObjSelection.cpp index 90aec2c..4f9441f 100644 --- a/EXE_GdbObjSelection.cpp +++ b/EXE_GdbObjSelection.cpp @@ -84,10 +84,16 @@ ExeSelectObj( int nId) bool ExeDeselectObj( int nId) { + GseContext* pGseCtx = GetCurrGseContext() ; + VERIFY_CTX_GEOMDB( pGseCtx, false) IGeomDB* pGeomDB = GetCurrGeomDB() ; - VERIFY_GEOMDB( pGeomDB, false) // deseleziono l'oggetto bool bOk = pGeomDB->DeselectObj( nId) ; + // eventuale sistemazione ultimi selezionati + if ( nId == pGseCtx->m_siSel.nLastId) + pGseCtx->m_siSel.ResetLast() ; + else if ( nId == pGseCtx->m_siSel.nPrevId) + pGseCtx->m_siSel.ResetPrev() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtDeselectObj(" + ToString( nId) + ")" + @@ -125,6 +131,8 @@ ExeSelectAll( bool bOnlyIfVisible) // passo al successivo nId1 = ExeGetNextPart( nId1, bOnlyIfVisible) ; } + // reset info ultimi due selezionati + pGseCtx->m_siSel.Reset() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtSelectAll(" + string( bOnlyIfVisible ? "true" : "false") + ")" + @@ -139,10 +147,13 @@ ExeSelectAll( bool bOnlyIfVisible) bool ExeDeselectAll( void) { + GseContext* pGseCtx = GetCurrGseContext() ; + VERIFY_CTX_GEOMDB( pGseCtx, false) IGeomDB* pGeomDB = GetCurrGeomDB() ; - VERIFY_GEOMDB( pGeomDB, false) // deseleziono tutto bool bOk = pGeomDB->ClearSelection() ; + // reset info ultimi due selezionati + pGseCtx->m_siSel.Reset() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtDeselectAll()" @@ -164,6 +175,8 @@ ExeSelectGroupObjs( int nGroupId) // verifico sia un gruppo if ( pGeomDB->GetGdbType( nGroupId) == GDB_TY_GROUP) { bOk = pGeomDB->SelectGroupObjs( nGroupId, pGseCtx->m_nObjFilterForSelect) ; + // reset info ultimi due selezionati + pGseCtx->m_siSel.Reset() ; } else bOk = false ; diff --git a/EXE_Macro.h b/EXE_Macro.h index 03c5314..ac5307d 100644 --- a/EXE_Macro.h +++ b/EXE_Macro.h @@ -1,7 +1,7 @@ //---------------------------------------------------------------------------- -// EgalTech 2014-2020 +// EgalTech 2014-2022 //---------------------------------------------------------------------------- -// File : EXE_Macro Data : 02.09.20 Versione : 2.2i1 +// File : EXE_Macro Data : 15.08.22 Versione : 2.4h1 // Contenuto : Macro locali per moduli EXE. // // @@ -41,31 +41,31 @@ #endif //----------------------------------------------------------------------------- -#define VERIFY_CTX( pC, Ret) VERIFY_NULL( pC, "Context invalid", Ret) +#define VERIFY_CTX( pC, Ret) VERIFY_NULL( pC, "Context invalid", Ret) //----------------------------------------------------------------------------- -#define VERIFY_GEOMDB( pG, Ret) VERIFY_NULL( pG, "GeomDB invalid", Ret) +#define VERIFY_GEOMDB( pG, Ret) VERIFY_NULL( pG, "GeomDB invalid", Ret) //----------------------------------------------------------------------------- -#define VERIFY_CTX_GEOMDB( pC, Ret) VERIFY_2NULL( pC, pC->m_pGeomDB, "Context or GeomDB invalid", Ret) +#define VERIFY_CTX_GEOMDB( pC, Ret) VERIFY_2NULL( pC, ( pC != nullptr ? pC->m_pGeomDB : nullptr), "Context or GeomDB invalid", Ret) //----------------------------------------------------------------------------- #define VERIFY_MACHMGR( pM, Ret) VERIFY_NULL( pM, "MachMgr invalid", Ret) //----------------------------------------------------------------------------- -#define VERIFY_CTX_MACHMGR( pC, Ret) VERIFY_2NULL( pC, pC->m_pMachMgr, "Context or MachMgr invalid", Ret) +#define VERIFY_CTX_MACHMGR( pC, Ret) VERIFY_2NULL( pC, ( pC != nullptr ? pC->m_pMachMgr : nullptr), "Context or MachMgr invalid", Ret) //----------------------------------------------------------------------------- -#define VERIFY_SCENE( pS, Ret) VERIFY_NULL( pS, "Scene invalid", Ret) +#define VERIFY_SCENE( pS, Ret) VERIFY_NULL( pS, "Scene invalid", Ret) //----------------------------------------------------------------------------- -#define VERIFY_CTX_SCENE( pC, Ret) VERIFY_2NULL( pC, pC->m_pScene, "Context or Scene invalid", Ret) +#define VERIFY_CTX_SCENE( pC, Ret) VERIFY_2NULL( pC, ( pC != nullptr ? pC->m_pScene : nullptr), "Context or Scene invalid", Ret) //----------------------------------------------------------------------------- -#define VERIFY_TSCEXEC( pT, Ret) VERIFY_NULL( pT, "TscExecutor invalid", Ret) +#define VERIFY_TSCEXEC( pT, Ret) VERIFY_NULL( pT, "TscExecutor invalid", Ret) //----------------------------------------------------------------------------- #define VERIFY_BEAMMGR( pM, Ret) VERIFY_NULL( pM, "BeamMgr invalid", Ret) //----------------------------------------------------------------------------- -#define VERIFY_CTX_BEAMMGR( pC, Ret) VERIFY_2NULL( pC, pC->m_pBeamMgr, "Context or BeamMgr invalid", Ret) +#define VERIFY_CTX_BEAMMGR( pC, Ret) VERIFY_2NULL( pC, ( pC != nullptr ? pC->m_pBeamMgr : nullptr), "Context or BeamMgr invalid", Ret) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 7c9bc29..832453c 100644 Binary files a/EgtExecutor.rc and b/EgtExecutor.rc differ diff --git a/GseContext.h b/GseContext.h index bd452e2..db22967 100644 --- a/GseContext.h +++ b/GseContext.h @@ -36,6 +36,10 @@ struct SelInfo { { nPrevId = nLastId ; nPrevSub = nLastSub ; ptPrevSel = ptLastSel ; nLastId = nI ; nLastSub = nS ; ptLastSel = ptP ; } void Reset( void) { nLastId = GDB_ID_NULL ; nLastSub = 0 ; ptLastSel = ORIG ; nPrevId = GDB_ID_NULL ; nPrevSub = 0 ; ptPrevSel = ORIG ; } + void ResetLast( void) + { nLastId = nPrevId ; nLastSub = nPrevSub ; ptLastSel = ptPrevSel ; nPrevId = GDB_ID_NULL ; nPrevSub = 0 ; ptPrevSel = ORIG ; } + void ResetPrev( void) + { nPrevId = GDB_ID_NULL ; nPrevSub = 0 ; ptPrevSel = ORIG ; } } ; //---------------------------------------------------------------------------- diff --git a/LUA_GdbCreateSurf.cpp b/LUA_GdbCreateSurf.cpp index f859db0..be0f9f0 100644 --- a/LUA_GdbCreateSurf.cpp +++ b/LUA_GdbCreateSurf.cpp @@ -616,7 +616,11 @@ LuaCreateSurfTmRuled( lua_State* L) LuaGetParam( L, 4, dLinTol) ; LuaClearStack( L) ; // creo STM riempiendo un contorno piano - int nType = ( sType == "MD" ? RUL_TYPE_MINDIST : RUL_TYPE_ISOPAR) ; + int nType = RUL_TYPE_ISOPAR ; + if ( sType == "MD") + nType = RUL_TYPE_MINDIST ; + else if ( sType == "IP_SM") + nType = RUL_TYPE_ISOPAR_SMOOTH ; int nId = ExeCreateSurfTmRuled( nParentId, nPtOrCrvId1, nPtOrCrvId2, nType, dLinTol) ; // restituisco il risultato if ( nId != GDB_ID_NULL)