EgtExchange :

- aggiunti oggetti all'import3dm e corretti alcuni bug.
This commit is contained in:
Daniele Bariletti
2023-09-01 17:22:03 +02:00
parent 549f3d47bd
commit c5503427cb
4 changed files with 742 additions and 250 deletions
+35 -33
View File
@@ -44,7 +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) ;
//m_ExecMgr.Insert( "IMPORT3DM", &ExcExecutor::ExecuteImport3dm) ;
}
//----------------------------------------------------------------------------
@@ -237,35 +237,37 @@ 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 ;
}
////----------------------------------------------------------------------------
//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 ;
//
// //return true ;
//}