From 930ef442f5da4600e4e819f55ad6edc7a8848ef9 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 2 May 2017 09:36:31 +0000 Subject: [PATCH] EgtExecutor 1.8d4 : - aggiunta gestione BBox3d e Frame3d in Exe e Lua SetInfo e GetInfo. --- EXE_GdbObjAttribs.cpp | 22 ++++++++++++++++++++++ EgtExecutor.rc | Bin 15088 -> 15088 bytes LUA_GdbObjAttribs.cpp | 28 ++++++++++++++++++++++++++-- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/EXE_GdbObjAttribs.cpp b/EXE_GdbObjAttribs.cpp index 26de603..79311ba 100644 --- a/EXE_GdbObjAttribs.cpp +++ b/EXE_GdbObjAttribs.cpp @@ -534,6 +534,18 @@ ExeSetInfo( int nId, const string& sKey, const Point3d& ptP) return bOk ; } +//----------------------------------------------------------------------------- +bool +ExeSetInfo( int nId, const string& sKey, const BBox3d& b3Box) +{ + IGeomDB* pGeomDB = GetCurrGeomDB() ; + VERIFY_GEOMDB( pGeomDB, false) + // assegno la info + bool bOk = pGeomDB->SetInfo( nId, sKey, b3Box) ; + ExeSetModified() ; + return bOk ; +} + //----------------------------------------------------------------------------- bool ExeSetInfo( int nId, const string& sKey, const Frame3d& frFrame) @@ -606,6 +618,16 @@ ExeGetInfo( int nId, const string& sKey, Point3d& ptP) return pGeomDB->GetInfo( nId, sKey, ptP) ; } +//----------------------------------------------------------------------------- +bool +ExeGetInfo( int nId, const string& sKey, BBox3d& b3Box) +{ + IGeomDB* pGeomDB = GetCurrGeomDB() ; + VERIFY_GEOMDB( pGeomDB, false) + // recupero la info + return pGeomDB->GetInfo( nId, sKey, b3Box) ; +} + //----------------------------------------------------------------------------- bool ExeGetInfo( int nId, const string& sKey, Frame3d& frFrame) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index 85927ea1a2b0d7550da8ed7eb044fc5165d07a1b..e4846004934b390f617b8e68e37a1738da054219 100644 GIT binary patch delta 79 zcmexR`k{2gFE&P#&A-`PnSqoe*K!sx?>N)s4T4pSCX*exk~jAW*?>e(i-FY$N+HxV MD8kglDNT|90G!nul>h($ delta 79 zcmexR`k{2gFE&P_&A-`PnSqoe*K!sx?>N)s4T4pSMw1=6k~jAW*?>e(i-FY$N+HxV MD8kglDNT|90Gd4;g#Z8m diff --git a/LUA_GdbObjAttribs.cpp b/LUA_GdbObjAttribs.cpp index 1bce370..c0eed00 100644 --- a/LUA_GdbObjAttribs.cpp +++ b/LUA_GdbObjAttribs.cpp @@ -471,7 +471,7 @@ LuaRemoveName( lua_State* L) static int LuaSetInfo( lua_State* L) { - // 3 parametri : Id, Key, bVal|nVal|dVal|sVal|vtVal|ptVal + // 3 parametri : Id, Key, bVal|nVal|dVal|sVal|vtVal|ptVal|b3Val|frVal int nId ; LuaCheckParam( L, 1, nId) string sKey ; @@ -496,8 +496,18 @@ LuaSetInfo( lua_State* L) bOk = ExeSetInfo( nId, sKey, sVal) ; } else if ( lua_istable( L, 3)) { + Frame3d frVal ; + BBox3d b3Val ; Vector3d vtVal ; // va bene anche per Point3d - if ( LuaGetParam( L, 3, vtVal)) { + if ( LuaGetParam( L, 3, frVal)) { + LuaClearStack( L) ; + bOk = ExeSetInfo( nId, sKey, frVal) ; + } + else if ( LuaGetParam( L, 3, b3Val)) { + LuaClearStack( L) ; + bOk = ExeSetInfo( nId, sKey, b3Val) ; + } + else if ( LuaGetParam( L, 3, vtVal)) { LuaClearStack( L) ; bOk = ExeSetInfo( nId, sKey, vtVal) ; } @@ -555,6 +565,20 @@ LuaGetInfo( lua_State* L) else LuaSetParam( L) ; } + else if ( sType == "x" || sType == "X") { + BBox3d b3Val ; + if ( ExeGetInfo( nId, sKey, b3Val)) + LuaSetParam( L, b3Val) ; + else + LuaSetParam( L) ; + } + else if ( sType == "f" || sType == "F") { + Frame3d frVal ; + if ( ExeGetInfo( nId, sKey, frVal)) + LuaSetParam( L, frVal) ; + else + LuaSetParam( L) ; + } else { // "s" "S" string sInfo ; if ( ExeGetInfo( nId, sKey, sInfo))