EgtExchange:

- aggiunto l'import per file 3dm.
This commit is contained in:
Daniele Bariletti
2023-08-03 10:18:12 +02:00
parent 4049b25d7d
commit 549f3d47bd
8 changed files with 593 additions and 3 deletions
+35
View File
@@ -22,6 +22,7 @@
#include "/EgtDev/Include/EExImportCnc.h"
#include "/EgtDev/Include/EExImportDxf.h"
#include "/EgtDev/Include/EExImportStl.h"
#include "/EgtDev/Include/EExImport3dm.h"
using namespace std ;
@@ -43,6 +44,7 @@ ExcExecutor::ExcExecutor( void)
m_ExecMgr.Insert( "IMPORTCNC", &ExcExecutor::ExecuteImportCnc) ;
m_ExecMgr.Insert( "IMPORTDXF", &ExcExecutor::ExecuteImportDxf) ;
m_ExecMgr.Insert( "IMPORTSTL", &ExcExecutor::ExecuteImportStl) ;
m_ExecMgr.Insert( "IMPORT3DM", &ExcExecutor::ExecuteImport3dm) ;
}
//----------------------------------------------------------------------------
@@ -234,3 +236,36 @@ ExcExecutor::ExecuteImportStl( const string& sCmd2, const STRVECTOR& vsParams)
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExcExecutor::ExecuteImport3dm( const string& sCmd2, const STRVECTOR& vsParams)
{
// 2 o 3 parametri : nome del file, Id del gruppo[, ScaleFactor]
if ( vsParams.size() != 2 && vsParams.size() != 3)
return false ;
// eventuale conversione di token nel nome file
string sFile = vsParams[0] ;
m_pParser->DirReplace( sFile) ;
// recupero l'Id
int nId = m_pParser->GetIdParam( vsParams[1]) ;
if ( nId == CMD_ID_ERROR)
return false ;
// gestisco ScaleFactor
double dScaleFactor = 1 ;
if ( vsParams.size() >= 3)
FromString( vsParams[2], dScaleFactor) ;
// preparo l'importatore
IImport3dm* pImp3dm = CreateImport3dm() ;
if ( pImp3dm == nullptr) {
LOG_ERROR( GetEExLogger(), "Error : CreateImportStl")
return false ;
}
// eseguo l'importazione
bool bOk = pImp3dm->Import( sFile, m_pGDB, nId, dScaleFactor) ;
// cancello l'importatore
delete pImp3dm ;
return bOk ;
}