From d7d3532dcf24ab43d0f2b3fb2e390c22e700c015 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 6 Dec 2019 08:23:45 +0000 Subject: [PATCH] EgtExecutor : - a Exe/Lua ExportSvg aggiunto parametro Filter. --- EXE_Exchange.cpp | 6 ++++-- LUA_Exchange.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/EXE_Exchange.cpp b/EXE_Exchange.cpp index 93594e8..e59bc7d 100644 --- a/EXE_Exchange.cpp +++ b/EXE_Exchange.cpp @@ -308,7 +308,7 @@ ExeExportStl( int nId, const string& sFilePath) //----------------------------------------------------------------------------- bool -ExeExportSvg( int nId, const string& sFilePath) +ExeExportSvg( int nId, const string& sFilePath, int nFilter) { IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, false) @@ -318,11 +318,13 @@ ExeExportSvg( int nId, const string& sFilePath) PtrOwner pExpSvg( MyCreateExportSvg()) ; bOk = bOk && ! IsNull( pExpSvg) ; // eseguo l'esportazione + pExpSvg->SetOptions( nFilter) ; bOk = bOk && pExpSvg->Export( pGeomDB, nId, sFilePath) ; // se richiesto, salvo il comando Lua equivalente if ( IsCmdLog()) { string sLua = "EgtExportSvg(" + ToString( nId) + ",'" + - StringToLuaString( sFilePath) + "')" + + StringToLuaString( sFilePath) + "'," + + ToString( nFilter) + ")" + " -- Ok=" + ToString( bOk) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } diff --git a/LUA_Exchange.cpp b/LUA_Exchange.cpp index 50fb549..23e4708 100644 --- a/LUA_Exchange.cpp +++ b/LUA_Exchange.cpp @@ -16,6 +16,7 @@ #include "LUA.h" #include "/EgtDev/Include/EXeExecutor.h" #include "/EgtDev/Include/EXeConst.h" +#include "/EgtDev/Include/EExExportConst.h" #include "/EgtDev/Include/EGkLuaAux.h" #include "/EgtDev/Include/EgnStringUtils.h" @@ -159,14 +160,16 @@ LuaExportStl( lua_State* L) static int LuaExportSvg( lua_State* L) { - // 2 parametri, GroupId e path del file da esportare + // 2 o 3 parametri, GroupId, Path del file da esportare [, Filter] int nGroupId ; LuaCheckParam( L, 1, nGroupId) string sFilePath ; LuaCheckParam( L, 2, sFilePath) + int nFilter = EEXFLT_DEFAULT ; + LuaCheckParam( L, 3, nFilter) LuaClearStack( L) ; // creo il file - bool bOk = ExeExportSvg( nGroupId, sFilePath) ; + bool bOk = ExeExportSvg( nGroupId, sFilePath, nFilter) ; // restituisco il risultato LuaSetParam( L, bOk) ; return 1 ;