EgtExchange 1.5e4 :

- aggiunto fattore di scalatura a ImportDxf
- introdotto utilizzo dell'oggetto StmFromTriangleSoup in import STL.
This commit is contained in:
Dario Sassi
2014-05-19 20:05:42 +00:00
parent fca2574f79
commit 41ae0f33c3
7 changed files with 92 additions and 78 deletions
+7 -3
View File
@@ -115,8 +115,8 @@ ExcExecutor::ExecuteImportStl( const string& sCmd2, const STRVECTOR& vsParams)
bool
ExcExecutor::ExecuteImportDxf( const string& sCmd2, const STRVECTOR& vsParams)
{
// 2 parametri : nome del file e Id del gruppo
if ( vsParams.size() != 2)
// 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] ;
@@ -125,6 +125,10 @@ ExcExecutor::ExecuteImportDxf( const string& sCmd2, const STRVECTOR& vsParams)
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
IImportDxf* pImpDxf = CreateImportDxf() ;
@@ -133,7 +137,7 @@ ExcExecutor::ExecuteImportDxf( const string& sCmd2, const STRVECTOR& vsParams)
return false ;
}
// eseguo l'importazione
bool bOk = pImpDxf->Import( sFile, m_pGDB, nId) ;
bool bOk = pImpDxf->Import( sFile, m_pGDB, nId, dScaleFactor) ;
// cancello l'importatore
delete pImpDxf ;