EgtMachKernel :

- aggiunta funzione KeepFixture
- estesa funzione KeepRawPart.
This commit is contained in:
Dario Sassi
2016-10-17 07:54:39 +00:00
parent d682572702
commit 1a862d9758
8 changed files with 112 additions and 15 deletions
+33
View File
@@ -162,6 +162,39 @@ MachMgr::AddFixture( const string& sName, const Point3d& ptPos, double dAngRotDe
return pDisp->AddFixture( sName, ptPos, dAngRotDeg, dMov) ;
}
//----------------------------------------------------------------------------
bool
MachMgr::KeepFixture( int nFxtId, int nSouPhase)
{
// verifico validità e recupero fasi in cui è presente
INTVECTOR vPhase ;
if ( ! GetFixturePhases( nFxtId, vPhase))
return false ;
// se fase corrente già presente, non devo fare alcunché
if ( find( vPhase.begin(), vPhase.end(), m_nCurrPhase) != vPhase.end())
return true ;
// se fase di origine non definita, esco con successo
if ( nSouPhase == 0)
return true ;
// copio il posizionamento
Disposition* pSouDisp = GetDisposition( m_pGeomDB->GetUserObj( GetPhaseDisposition( nSouPhase))) ;
Disposition* pDisp = GetDisposition( m_pGeomDB->GetUserObj( GetPhaseDisposition( m_nCurrPhase))) ;
if ( pSouDisp == nullptr || pDisp == nullptr)
return false ;
for ( int i = 0 ; ; ++ i) {
string sName ; int nId ; Point3d ptPos ; double dAngDeg ; double dMov ;
if ( pSouDisp->GetFixtureData( i, sName, nId, ptPos, dAngDeg, dMov)) {
if ( nId == nFxtId) {
pDisp->AddFixture( sName, ptPos, dAngDeg, dMov) ;
break ;
}
}
else
break ;
}
return true ;
}
//----------------------------------------------------------------------------
bool
MachMgr::RemoveFixture( int nFxtId)