EgtExecutor 2.3i1 :

- aggiunte funzione Exe e Lua Export3MF.
This commit is contained in:
DarioS
2021-09-08 08:38:26 +02:00
parent 3ebb735c1c
commit 5c059cd69d
5 changed files with 61 additions and 0 deletions
+16
View File
@@ -50,6 +50,7 @@ static const char* EEX_CREATEIMPORTSTL = "CreateImportStl" ;
static const char* EEX_CREATEIMPORT3MF = "CreateImport3MF" ;
static const char* EEX_CREATEEXPORTDXF = "CreateExportDxf" ;
static const char* EEX_CREATEEXPORTSTL = "CreateExportStl" ;
static const char* EEX_CREATEEXPORT3MF = "CreateExport3MF" ;
static const char* EEX_CREATEEXPORTSVG = "CreateExportSvg" ;
static const char* EEX_CREATEEEXEXECUTOR = "CreateExcExecutor" ;
@@ -325,6 +326,21 @@ MyCreateExportStl( void)
return pFun() ;
}
//-----------------------------------------------------------------------------
IExport3MF*
MyCreateExport3MF( void)
{
// verifico caricamento libreria EgtExchange
if ( s_hEEx == nullptr)
return nullptr ;
// recupero funzione creazione oggetto
typedef IExport3MF* (* PF_CreateExport3MF) ( void) ;
PF_CreateExport3MF pFun = (PF_CreateExport3MF)GetProcAddress( s_hEEx, EEX_CREATEEXPORT3MF) ;
if ( pFun == nullptr)
return nullptr ;
return pFun() ;
}
//-----------------------------------------------------------------------------
IExportSvg*
MyCreateExportSvg( void)
+2
View File
@@ -27,6 +27,7 @@ class IImportStl ;
class IImport3MF ;
class IExportDxf ;
class IExportStl ;
class IExport3MF ;
class IExportSvg ;
class IExcExecutor ;
@@ -49,5 +50,6 @@ IImportStl* MyCreateImportStl( void) ;
IImport3MF* MyCreateImport3MF( void) ;
IExportDxf* MyCreateExportDxf( void) ;
IExportStl* MyCreateExportStl( void) ;
IExport3MF* MyCreateExport3MF( void) ;
IExportSvg* MyCreateExportSvg( void) ;
IExcExecutor* MyCreateExcExecutor(void) ;
+25
View File
@@ -30,6 +30,7 @@
#include "/EgtDev/Include/EExImportBtlx.h"
#include "/EgtDev/Include/EExExportDxf.h"
#include "/EgtDev/Include/EExExportStl.h"
#include "/EgtDev/Include/EExExport3MF.h"
#include "/EgtDev/Include/EExExportSvg.h"
#include "/EgtDev/Include/EGnStringUtils.h"
#include "/EgtDev/Include/EGnFileUtils.h"
@@ -501,6 +502,30 @@ ExeExportStl( int nId, const string& sFilePath)
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeExport3MF( int nId, const string& sFilePath)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
bool bOk = true ;
// esporto il file STL
// preparo l'esportatore
PtrOwner<IExport3MF> pExp3MF( MyCreateExport3MF()) ;
bOk = bOk && ! IsNull( pExp3MF) ;
// eseguo l'esportazione
bOk = bOk && pExp3MF->Export( pGeomDB, nId, sFilePath) ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtExport3MF(" + ToString( nId) + ",'" +
StringToLuaString( sFilePath) + "')" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
//-----------------------------------------------------------------------------
bool
ExeExportSvg( int nId, const string& sFilePath, int nFilter)
BIN
View File
Binary file not shown.
+18
View File
@@ -207,6 +207,23 @@ LuaExportStl( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaExport3MF( lua_State* L)
{
// 2 parametri, GroupId e path del file da esportare
int nGroupId ;
LuaCheckParam( L, 1, nGroupId)
string sFilePath ;
LuaCheckParam( L, 2, sFilePath)
LuaClearStack( L) ;
// creo il file
bool bOk = ExeExport3MF( nGroupId, sFilePath) ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaExportSvg( lua_State* L)
@@ -242,6 +259,7 @@ LuaInstallExchange( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtAdvancedImport", LuaAdvancedImport) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtExportDxf", LuaExportDxf) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtExportStl", LuaExportStl) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtExport3MF", LuaExport3MF) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtExportSvg", LuaExportSvg) ;
return bOk ;
}