diff --git a/EXE_GdbModifyVol.cpp b/EXE_GdbModifyVol.cpp index 1e9ddc1..0af7bc7 100644 --- a/EXE_GdbModifyVol.cpp +++ b/EXE_GdbModifyVol.cpp @@ -338,7 +338,7 @@ ExeVolZmapMillingStep( int nId, const Point3d& ptPs, const Vector3d& vtDs, const //---------------------------------------------------------------------------- bool -ExeVolZmapGetDepth( int nId, const Point3d& ptP, const Vector3d& vtDir, int nRefType, +ExeVolZmapGetDepth( int nId, const Point3d& ptP, const Vector3d& vtDir, int nRefType, bool bExact, double& dInLen, double& dOutLen) { IGeomDB* pGeomDB = GetCurrGeomDB() ; @@ -351,13 +351,14 @@ ExeVolZmapGetDepth( int nId, const Point3d& ptP, const Vector3d& vtDir, int nRef Vector3d vtVL = GetVectorLocal( pGeomDB, vtDir, nRefType, frLoc) ; // recupero lo Zmap e calcolo profondità IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ; - bOk = bOk && ( pVZM != nullptr && pVZM->GetDepth( ptP, vtDir, dInLen, dOutLen)) ; + bOk = bOk && ( pVZM != nullptr && pVZM->GetDepth( ptP, vtDir, dInLen, dOutLen, bExact)) ; ExeSetModified() ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtVolZmapGetDepth(" + IdToString( nId) + ",{" + ToString( ptP) + "},{" + ToString( vtDir) + "}," + + ( bExact ? "true" : "false") + "," + RefTypeToString( nRefType) + ")" + " -- Ok=" + ToString( bOk) + "," + ToString( dInLen) + "," + ToString( dOutLen) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; diff --git a/LUA_GdbModifyVol.cpp b/LUA_GdbModifyVol.cpp index d53b27e..9e604cc 100644 --- a/LUA_GdbModifyVol.cpp +++ b/LUA_GdbModifyVol.cpp @@ -232,7 +232,7 @@ LuaVolZmapMillingStep( lua_State* L) static int LuaVolZmapGetDepth( lua_State* L) { - // 3 o 4 parametri : nId, ptP, vtDir [, nRefType] + // 3 o 4 o 5 parametri : nId, ptP, vtDir [, nRefType] [, bExact] int nId ; LuaCheckParam( L, 1, nId) Point3d ptP ; @@ -240,11 +240,15 @@ LuaVolZmapGetDepth( lua_State* L) Vector3d vtDir ; LuaCheckParam( L, 3, vtDir) int nRefType = RTY_DEFAULT ; - LuaGetParam( L, 4, nRefType) ; + bool bExact = false ; + if ( LuaGetParam( L, 4, nRefType)) + LuaGetParam( L, 5, bExact) ; + else + LuaGetParam( L, 4, bExact) ; LuaClearStack( L) ; // eseguo calcolo profondità dal punto lungo la direzione double dLen1, dLen2 ; - bool bOk = ExeVolZmapGetDepth( nId, ptP, vtDir, nRefType, dLen1, dLen2) ; + bool bOk = ExeVolZmapGetDepth( nId, ptP, vtDir, nRefType, bExact, dLen1, dLen2) ; // restituisco il risultato if ( bOk) { LuaSetParam( L, dLen1) ;