EgtInterface 1.6a7 :

- aggiunta gestione nome file di progetto e suo stato
- aggiunta gestione pezzo e layer
- riordino generale.
This commit is contained in:
Dario Sassi
2015-01-30 08:16:05 +00:00
parent f039e22297
commit 0c41c8c631
20 changed files with 868 additions and 178 deletions
+22 -13
View File
@@ -80,17 +80,20 @@ __stdcall EgtImportDxf( const wchar_t* wsFilePath)
bool
EgtImportDxf( const string& sFilePath)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_GEOMDB( pGseCtx, false)
bool bOk = true ;
// importo il file DXF
// aggiungo un gruppo pezzo
int nPartId = pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, Frame3d()) ;
int nPartId = pGseCtx->m_pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, Frame3d()) ;
// preparo l'importatore
PtrOwner<IImportDxf> pImpDxf( CreateImportDxf()) ;
bOk = bOk && ! IsNull( pImpDxf) ;
// eseguo l'importazione
bOk = bOk && pImpDxf->Import( sFilePath, pGeomDB, nPartId) ;
bOk = bOk && pImpDxf->Import( sFilePath, pGseCtx->m_pGeomDB, nPartId) ;
// aggiorno stato file corrente
pGseCtx->m_sFilePath = sFilePath ;
pGseCtx->m_bModified = true ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLuaPath = sFilePath ;
@@ -114,18 +117,21 @@ __stdcall EgtImportStl( const wchar_t* wsFilePath)
bool
EgtImportStl( const string& sFilePath)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_GEOMDB( pGseCtx, false)
bool bOk = true ;
// importo il file STL
// aggiungo un gruppo pezzo e un gruppo layer
int nPartId = pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, Frame3d()) ;
int nLayerId = pGeomDB->AddGroup( GDB_ID_NULL, nPartId, Frame3d()) ;
int nPartId = pGseCtx->m_pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, Frame3d()) ;
int nLayerId = pGseCtx->m_pGeomDB->AddGroup( GDB_ID_NULL, nPartId, Frame3d()) ;
// preparo l'importatore
PtrOwner<IImportStl> pImpStl( CreateImportStl()) ;
bOk = bOk && ! IsNull( pImpStl) ;
// eseguo l'importazione
bOk = bOk && pImpStl->Import( sFilePath, pGeomDB, nLayerId) ;
bOk = bOk && pImpStl->Import( sFilePath, pGseCtx->m_pGeomDB, nLayerId) ;
// aggiorno stato file corrente
pGseCtx->m_sFilePath = sFilePath ;
pGseCtx->m_bModified = true ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLuaPath = sFilePath ;
@@ -149,17 +155,20 @@ __stdcall EgtImportCnc( const wchar_t* wsFilePath)
bool
EgtImportCnc( const string& sFilePath)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
GseContext* pGseCtx = GetCurrGseContext() ;
VERIFY_CTX_GEOMDB( pGseCtx, false)
bool bOk = true ;
// importo il file CNC
// aggiungo un gruppo pezzo
int nPartId = pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, Frame3d()) ;
int nPartId = pGseCtx->m_pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, Frame3d()) ;
// preparo l'importatore
PtrOwner<IImportCnc> pImpCnc( CreateImportCnc()) ;
bOk = bOk && ! IsNull( pImpCnc) ;
// eseguo l'importazione
bOk = bOk && pImpCnc->Import( sFilePath, pGeomDB, nPartId) ;
bOk = bOk && pImpCnc->Import( sFilePath, pGseCtx->m_pGeomDB, nPartId) ;
// aggiorno stato file corrente
pGseCtx->m_sFilePath = sFilePath ;
pGseCtx->m_bModified = true ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLuaPath = sFilePath ;