EgtMachKernel :
- aggiunta funzione KeepFixture - estesa funzione KeepRawPart.
This commit is contained in:
+16
-3
@@ -396,7 +396,7 @@ Disposition::Apply( bool bVerifyTab)
|
||||
}
|
||||
break ;
|
||||
case MoveRawData::ROT :
|
||||
if ( ! ApplyRotationToRawPart( vMvrData.nRawId, vMvrData.ptP.x, vMvrData.ptP.y, vMvrData.ptP.z)) {
|
||||
if ( ! ApplyRotationToRawPart( vMvrData.nRawId, vMvrData.ptP.x, vMvrData.ptP.y, vMvrData.ptP.z, false)) {
|
||||
string sOut = "Error in ApplyRotationToRawPart " + ToString( vMvrData.nRawId) ;
|
||||
LOG_ERROR( GetEMkLogger(), sOut.c_str()) ;
|
||||
}
|
||||
@@ -860,7 +860,7 @@ Disposition::RotateRawPart( int nRawId, const Vector3d& vtAx, double dAngRotDeg)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Disposition::ApplyRotationToRawPart( int nRawId, double dAngCDeg, double dAngADeg, double dAngC1Deg)
|
||||
Disposition::ApplyRotationToRawPart( int nRawId, double dAngCDeg, double dAngADeg, double dAngC1Deg, bool bAddToList)
|
||||
{
|
||||
// verifica validità grezzo
|
||||
if ( m_pMchMgr == nullptr || ! m_pMchMgr->VerifyRawPart( nRawId, false))
|
||||
@@ -880,6 +880,17 @@ Disposition::ApplyRotationToRawPart( int nRawId, double dAngCDeg, double dAngADe
|
||||
return false ;
|
||||
// eseguo spostamento per riportare il centro nella posizione originale
|
||||
pfrRaw->Translate( ptCen - ptNewCen) ;
|
||||
// se da aggiungere alla lista
|
||||
if ( bAddToList) {
|
||||
auto iIter = find_if( m_vMvrData.begin(), m_vMvrData.end(),
|
||||
[ nRawId]( const MoveRawData& Mrv)
|
||||
{ return ( Mrv.nRawId == nRawId &&
|
||||
( Mrv.nType == MoveRawData::COR || Mrv.nType == MoveRawData::CEN)) ; }) ;
|
||||
if ( iIter == m_vMvrData.end())
|
||||
m_vMvrData.emplace_back( nRawId, MoveRawData::ROT, Point3d( dAngCDeg, dAngADeg, dAngC1Deg), 0) ;
|
||||
else
|
||||
*iIter = MoveRawData( nRawId, MoveRawData::ROT, Point3d( dAngCDeg, dAngADeg, dAngC1Deg), 0) ;
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
|
||||
@@ -905,7 +916,8 @@ Disposition::RemoveRawPart( int nRawId)
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Disposition::GetFixtureData( int nInd, string& sName, int& nId, Point3d& ptPos, double& dAngDeg) const
|
||||
Disposition::GetFixtureData( int nInd, string& sName, int& nId, Point3d& ptPos,
|
||||
double& dAngDeg, double& dMov) const
|
||||
{
|
||||
// verifico MachMgr e GeomDB
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
@@ -918,6 +930,7 @@ Disposition::GetFixtureData( int nInd, string& sName, int& nId, Point3d& ptPos,
|
||||
nId = m_vFixData[nInd].nId ;
|
||||
ptPos = m_vFixData[nInd].ptPos ;
|
||||
dAngDeg = m_vFixData[nInd].dAng ;
|
||||
dMov = m_vFixData[nInd].dMov ;
|
||||
return true ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user