diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index a22cde5..bc01485 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/MachMgr.h b/MachMgr.h index b772a3e..4832cd3 100644 --- a/MachMgr.h +++ b/MachMgr.h @@ -93,6 +93,7 @@ class MachMgr : public IMachMgr // Tables and Fixtures virtual bool SetTable( const std::string& sTable) ; virtual bool GetTableRef1( Point3d& ptPos) ; + virtual bool GetTableArea1( int& nAreaId) ; virtual int AddSubPiece( const std::string& sName, const Point3d& ptPos, double dAngRotDeg) ; virtual bool ShowOnlyTable( bool bVal) ; // Machine diff --git a/MachMgrFixtures.cpp b/MachMgrFixtures.cpp index 3d30818..168a566 100644 --- a/MachMgrFixtures.cpp +++ b/MachMgrFixtures.cpp @@ -47,6 +47,26 @@ MachMgr::GetTableRef1( Point3d& ptPos) return pDisp->GetTableRef1( ptPos) ; } +//---------------------------------------------------------------------------- +bool +MachMgr::GetTableArea1( int& nAreaId) +{ + // verifico DB geometrico + if ( m_pGeomDB == nullptr) + return false ; + // recupero la macchina corrente + Machine* pMch = GetCurrMachine() ; + if ( pMch == nullptr) + return false ; + // recupero la tavola corrente + int nTabId = pMch->GetCurrTable() ; + if ( nTabId == GDB_ID_NULL) + return false ; + // recupero l'oggetto che ne definisce l'area utile + nAreaId = m_pGeomDB->GetFirstNameInGroup( nTabId, MCH_TAREA + "1") ; + return ( nAreaId != GDB_ID_NULL) ; +} + //---------------------------------------------------------------------------- int MachMgr::AddSubPiece( const string& sName, const Point3d& ptPos, double dAngRotDeg) diff --git a/MachMgrParts.cpp b/MachMgrParts.cpp index 022b916..33a207e 100644 --- a/MachMgrParts.cpp +++ b/MachMgrParts.cpp @@ -90,6 +90,8 @@ MachMgr::AddPartToRawPart( int nPartId, int nRawId) if ( nGroup == GDB_ID_NULL || ! m_pGeomDB->GroupSwap( nPartId, nGroup, true, true)) return false ; + // impongo il livello system al gruppo + m_pGeomDB->SetLevel( nGroup, GDB_LV_SYSTEM) ; // mi assicuro sia visibile il pezzo e nascosto il gruppo m_pGeomDB->SetStatus( nPartId, GDB_ST_ON) ; m_pGeomDB->SetStatus( nGroup, GDB_ST_OFF) ; @@ -126,6 +128,8 @@ MachMgr::AddPartToRawPart( int nPartId, const Point3d& ptPos, int nRawId) if ( nGroup == GDB_ID_NULL || ! m_pGeomDB->GroupSwap( nPartId, nGroup, true, true)) return false ; + // impongo il livello system al gruppo + m_pGeomDB->SetLevel( nGroup, GDB_LV_SYSTEM) ; // mi assicuro sia visibile il pezzo e nascosto il gruppo m_pGeomDB->SetStatus( nPartId, GDB_ST_ON) ; m_pGeomDB->SetStatus( nGroup, GDB_ST_OFF) ; @@ -246,8 +250,9 @@ MachMgr::SwapRawPartParts( int nRawId, bool bToRawPart) int nBase ; if ( m_pGeomDB->GetInfo( nId, GDB_SI_BASE, nBase)) { m_pGeomDB->GroupSwap( nId, nBase, true, true) ; - // mi assicuro sia nascosto + // mi assicuro sia nascosto e di livello utente m_pGeomDB->SetStatus( nId, GDB_ST_OFF) ; + m_pGeomDB->SetLevel( nId, GDB_LV_USER) ; } } // passo al successivo @@ -264,7 +269,8 @@ MachMgr::ShowRootParts( bool bShow) int nId = m_pGeomDB->GetFirstGroupInGroup( GDB_ID_ROOT) ; while ( nId != GDB_ID_NULL) { // se pezzo, lo nascondo - if ( ! IsMachBase( nId) && ! IsMachAux( nId)) + int nLevel ; + if ( m_pGeomDB->GetCalcLevel( nId, nLevel) && nLevel == GDB_LV_USER) m_pGeomDB->SetStatus( nId, ( bShow ? GDB_ST_ON : GDB_ST_OFF)) ; // passo al successivo nId = m_pGeomDB->GetNextGroup( nId) ; diff --git a/MachineStruConst.h b/MachineStruConst.h index 0c89296..c9db8b8 100644 --- a/MachineStruConst.h +++ b/MachineStruConst.h @@ -69,6 +69,8 @@ enum MchHeadType { MCH_HT_NONE = 0, //---------------------------------------------------------------------------- // Identificativo iniziale riferimenti di tavola const std::string MCH_TREF = "R" ; +// Identificativo iniziale area di tavola +const std::string MCH_TAREA ="A" ; //---------------------------------------------------------------------------- // Identificativo iniziale gruppo uscita di teste