Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a5a0646ddc | |||
| b954be810c | |||
| 8500a0467e | |||
| 8145b4586c |
@@ -10,6 +10,8 @@
|
||||
// 03.07.18 DS Aggiunto ImportPnt.
|
||||
// 15.09.19 DS Aggiunto ExportSvg.
|
||||
// 14.12.20 DS Aggiunto ImportBtlx.
|
||||
// 23.06.23 DB Aggiunto Import3dm.
|
||||
// 21.09.23 DB Aggiunto Export3dm.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
@@ -53,6 +55,7 @@ static const char* EEX_CREATEIMPORT3DM = "CreateImport3dm" ;
|
||||
static const char* EEX_CREATEEXPORTDXF = "CreateExportDxf" ;
|
||||
static const char* EEX_CREATEEXPORTSTL = "CreateExportStl" ;
|
||||
static const char* EEX_CREATEEXPORT3MF = "CreateExport3MF" ;
|
||||
static const char* EEX_CREATEEXPORT3DM = "CreateExport3dm" ;
|
||||
static const char* EEX_CREATEEXPORTSVG = "CreateExportSvg" ;
|
||||
static const char* EEX_SETTHREEJSLIBDIR = "SetThreeJSLibDir" ;
|
||||
static const char* EEX_CREATEEXPORTTHREEJS = "CreateExportThreeJS" ;
|
||||
@@ -377,6 +380,21 @@ MyCreateExport3MF( void)
|
||||
return pFun() ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
IExport3dm*
|
||||
MyCreateExport3dm( void)
|
||||
{
|
||||
// verifico caricamento libreria EgtExchange
|
||||
if ( s_hEEx == nullptr)
|
||||
return nullptr ;
|
||||
// recupero funzione creazione oggetto
|
||||
typedef IExport3dm* (* PF_CreateExport3dm) ( void) ;
|
||||
PF_CreateExport3dm pFun = (PF_CreateExport3dm)GetProcAddress( s_hEEx, EEX_CREATEEXPORT3DM) ;
|
||||
if ( pFun == nullptr)
|
||||
return nullptr ;
|
||||
return pFun() ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
IExportSvg*
|
||||
MyCreateExportSvg( void)
|
||||
|
||||
@@ -29,6 +29,7 @@ class IImport3dm ;
|
||||
class IExportDxf ;
|
||||
class IExportStl ;
|
||||
class IExport3MF ;
|
||||
class IExport3dm ;
|
||||
class IExportThreeJS ;
|
||||
class IExportSvg ;
|
||||
class IExcExecutor ;
|
||||
@@ -55,6 +56,7 @@ IImport3dm* MyCreateImport3dm( void) ;
|
||||
IExportDxf* MyCreateExportDxf( void) ;
|
||||
IExportStl* MyCreateExportStl( void) ;
|
||||
IExport3MF* MyCreateExport3MF( void) ;
|
||||
IExport3dm* MyCreateExport3dm( void) ;
|
||||
bool MySetThreeJSLibDir( const std::string& sThreeJSLibDir) ;
|
||||
IExportThreeJS* MyCreateExportThreeJS( void) ;
|
||||
IExportSvg* MyCreateExportSvg( void) ;
|
||||
|
||||
+37
-2
@@ -32,6 +32,7 @@
|
||||
#include "/EgtDev/Include/EExExportDxf.h"
|
||||
#include "/EgtDev/Include/EExExportStl.h"
|
||||
#include "/EgtDev/Include/EExExport3MF.h"
|
||||
#include "/EgtDev/Include/EExExport3dm.h"
|
||||
#include "/EgtDev/Include/EExExportSvg.h"
|
||||
#include "/EgtDev/Include/EExExportThreeJS.h"
|
||||
#include "/EgtDev/Include/EGnStringUtils.h"
|
||||
@@ -373,7 +374,16 @@ ExeImport3dm( const string& sFilePath, double dScaleFactor)
|
||||
PtrOwner<IImport3dm> pImp3dm( MyCreateImport3dm()) ;
|
||||
bOk = bOk && ! IsNull( pImp3dm) ;
|
||||
// eseguo l'importazione
|
||||
bOk = bOk && pImp3dm->Import( sFilePath, pGseCtx->m_pGeomDB, nLayerId, dScaleFactor) ;
|
||||
const DimensionStyle& DimSt = pGseCtx->m_dsCurr ;
|
||||
double dExtLine = DimSt.dExtLineLen ;
|
||||
double dArrLen = DimSt.dArrowLen ;
|
||||
double dTextDist = DimSt.dTextDist ;
|
||||
bool bLenIsMM = ( DimSt.nLenIsMM == 2 ? ExeUiUnitsAreMM() : ( DimSt.nLenIsMM != 0 )) ;
|
||||
int nDecDig = DimSt.nDecDigit ;
|
||||
string sFont = DimSt.sFont ;
|
||||
double dTextHeight = DimSt.dTextHeight ;
|
||||
bOk = bOk && pImp3dm->Import( sFilePath, pGseCtx->m_pGeomDB, nLayerId, dScaleFactor,
|
||||
dTextHeight, dExtLine, dArrLen, dTextDist, bLenIsMM, nDecDig, sFont) ;
|
||||
// aggiorno stato file corrente
|
||||
if ( pGseCtx->m_sFilePath.empty())
|
||||
pGseCtx->m_sFilePath = sFilePath ;
|
||||
@@ -554,7 +564,7 @@ ExeExport3MF( int nId, const string& sFilePath, int nFilter)
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
bool bOk = true ;
|
||||
// esporto il file STL
|
||||
// esporto il file 3MF
|
||||
// preparo l'esportatore
|
||||
PtrOwner<IExport3MF> pExp3MF( MyCreateExport3MF()) ;
|
||||
bOk = bOk && ! IsNull( pExp3MF) ;
|
||||
@@ -572,6 +582,31 @@ ExeExport3MF( int nId, const string& sFilePath, int nFilter)
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
bool
|
||||
ExeExport3dm( int nId, const string& sFilePath, int nFilter)
|
||||
{
|
||||
IGeomDB* pGeomDB = GetCurrGeomDB() ;
|
||||
VERIFY_GEOMDB( pGeomDB, false)
|
||||
bool bOk = true ;
|
||||
// esporto il file 3dm
|
||||
// preparo l'esportatore
|
||||
PtrOwner<IExport3dm> pExp3dm( MyCreateExport3dm()) ;
|
||||
bOk = bOk && ! IsNull( pExp3dm) ;
|
||||
// eseguo l'esportazione
|
||||
bOk = bOk && pExp3dm->SetOptions( nFilter) ;
|
||||
bOk = bOk && pExp3dm->Export( pGeomDB, nId, sFilePath) ;
|
||||
// se richiesto, salvo il comando Lua equivalente
|
||||
if ( IsCmdLog()) {
|
||||
string sLua = "EgtExport3dm(" + 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)
|
||||
|
||||
@@ -262,6 +262,25 @@ LuaExport3MF( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaExport3dm( lua_State* L)
|
||||
{
|
||||
// 2 o 3 parametri : GroupId e path del file da esportare [, Filter]
|
||||
int nGroupId ;
|
||||
LuaCheckParam( L, 1, nGroupId)
|
||||
string sFilePath ;
|
||||
LuaCheckParam( L, 2, sFilePath)
|
||||
int nFilter = EEXFLT_DEFAULT ;
|
||||
LuaGetParam( L, 3, nFilter) ;
|
||||
LuaClearStack( L) ;
|
||||
// creo il file
|
||||
bool bOk = ExeExport3dm( nGroupId, sFilePath) ;
|
||||
// restituisco il risultato
|
||||
LuaSetParam( L, bOk) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaExportSvg( lua_State* L)
|
||||
@@ -319,6 +338,7 @@ LuaInstallExchange( LuaMgr& luaMgr)
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExportDxf", LuaExportDxf) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExportStl", LuaExportStl) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExport3MF", LuaExport3MF) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExport3dm", LuaExport3dm) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExportSvg", LuaExportSvg) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtExportThreeJS", LuaExportThreeJS) ;
|
||||
return bOk ;
|
||||
|
||||
Reference in New Issue
Block a user