EgtMachKernel 2.3g4 :
- versione x64 compilata con Clang-cl/LLVM - modifiche varie per eliminare warning più gravi di questo compilatore.
This commit is contained in:
+31
-18
@@ -407,38 +407,49 @@ Operation::GetDistanceFromRawSide( int nPhase, const Point3d& ptP, const Vector3
|
||||
{
|
||||
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
|
||||
return false ;
|
||||
// recupero il grezzo in cui è incluso il punto
|
||||
// recupero il grezzo più vicino al punto (entro 100 mm)
|
||||
const double EXPAND_LEN = 100 ;
|
||||
BBox3d b3Pnt( ptP) ;
|
||||
b3Pnt.Expand( 10, 10, 0) ;
|
||||
int nRawId = m_pMchMgr->GetFirstRawPart() ;
|
||||
while ( nRawId != GDB_ID_NULL) {
|
||||
b3Pnt.Expand( EXPAND_LEN, EXPAND_LEN, 0) ;
|
||||
double dMinDist = INFINITO ;
|
||||
int nRawId = GDB_ID_NULL ;
|
||||
int nCurrRawId = m_pMchMgr->GetFirstRawPart() ;
|
||||
while ( nCurrRawId != GDB_ID_NULL) {
|
||||
// verifico che il grezzo compaia nella fase
|
||||
if ( m_pMchMgr->VerifyRawPartPhase( nRawId, nPhase)) {
|
||||
if ( m_pMchMgr->VerifyRawPartPhase( nCurrRawId, nPhase)) {
|
||||
// pre-filtro con il box
|
||||
BBox3d b3Raw ;
|
||||
int nRawSolidId = m_pGeomDB->GetFirstNameInGroup( nRawId, MACH_RAW_SOLID) ;
|
||||
int nRawSolidId = m_pGeomDB->GetFirstNameInGroup( nCurrRawId, MACH_RAW_SOLID) ;
|
||||
if ( m_pGeomDB->GetGlobalBBox( nRawSolidId, b3Raw) && b3Pnt.OverlapsXY( b3Raw)) {
|
||||
// porto il punto nel riferimento del grezzo (a Z=0 perchè ivi è il contorno)
|
||||
Frame3d frRaw ;
|
||||
m_pGeomDB->GetGroupGlobFrame( nRawId, frRaw) ;
|
||||
m_pGeomDB->GetGroupGlobFrame( nCurrRawId, frRaw) ;
|
||||
Point3d ptPL = ptP ;
|
||||
ptPL.ToLoc( frRaw) ;
|
||||
ptPL.z = 0 ;
|
||||
// verifica con il contorno
|
||||
int nOutCrvId = m_pGeomDB->GetFirstNameInGroup( nRawId, MACH_RAW_OUTLINE) ;
|
||||
int nOutCrvId = m_pGeomDB->GetFirstNameInGroup( nCurrRawId, MACH_RAW_OUTLINE) ;
|
||||
const ICurve* pCurve = GetCurve( m_pGeomDB->GetGeoObj( nOutCrvId)) ;
|
||||
if ( pCurve != nullptr) {
|
||||
int nSide ;
|
||||
double dDist ;
|
||||
DistPointCurve distPC( ptPL, *pCurve) ;
|
||||
if ( distPC.GetDist( dDist) && dDist < 100 * EPS_SMALL ||
|
||||
(distPC.GetSideAtMinDistPoint( 0, Z_AX, nSide) && nSide != MDS_RIGHT))
|
||||
break ;
|
||||
if ( distPC.GetDist( dDist)) {
|
||||
if ( dDist < 100 * EPS_SMALL ||
|
||||
(distPC.GetSideAtMinDistPoint( 0, Z_AX, nSide) && nSide != MDS_RIGHT)) {
|
||||
nRawId = nCurrRawId ;
|
||||
break ;
|
||||
}
|
||||
else if ( dDist < dMinDist) {
|
||||
dMinDist = dDist ;
|
||||
nRawId = nCurrRawId ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// passo al grezzo successivo
|
||||
nRawId = m_pMchMgr->GetNextRawPart( nRawId) ;
|
||||
nCurrRawId = m_pMchMgr->GetNextRawPart( nCurrRawId) ;
|
||||
}
|
||||
// se il punto non è interno ad alcun grezzo, distanza nulla
|
||||
if ( nRawId == GDB_ID_NULL) {
|
||||
@@ -457,14 +468,16 @@ Operation::GetDistanceFromRawSide( int nPhase, const Point3d& ptP, const Vector3
|
||||
return false ;
|
||||
// interseco il raggio di test (portato nel riferimento del contorno) con il contorno del grezzo
|
||||
const double RAY_LEN = 10000 ;
|
||||
const double EXTRA_LEN = EXPAND_LEN ;
|
||||
PtrOwner<ICurveLine> pRay( CreateCurveLine()) ;
|
||||
if ( IsNull( pRay) || ! pRay->SetPVL( ptP, vtDir, RAY_LEN))
|
||||
if ( IsNull( pRay) || ! pRay->SetPVL( ptP - vtDir * EXTRA_LEN, vtDir, RAY_LEN))
|
||||
return false ;
|
||||
pRay->ToLoc( frStm) ;
|
||||
IntersCurveCurve intCC( *pRay, *pOut) ;
|
||||
int nInters = intCC.GetIntersCount() ;
|
||||
IntCrvCrvInfo aInfo ;
|
||||
if ( intCC.GetIntCrvCrvInfo( 0, aInfo))
|
||||
dDist = aInfo.IciA[0].dU * RAY_LEN ;
|
||||
if ( nInters > 0 && intCC.GetIntCrvCrvInfo( nInters - 1, aInfo))
|
||||
dDist = aInfo.IciA[0].dU * RAY_LEN - EXTRA_LEN ;
|
||||
else
|
||||
dDist = 0 ;
|
||||
return true ;
|
||||
@@ -2036,11 +2049,11 @@ Operation::AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation*
|
||||
if ( nPrevClPathId == GDB_ID_NULL) {
|
||||
if ( pPrevOp == nullptr ||
|
||||
! pPrevOp->RemoveRise() ||
|
||||
! pPrevOp->AddRise( vAxNew1, dSafeZ - vAxPrev[2]), GDB_ID_NULL, bZHomeDown)
|
||||
! pPrevOp->AddRise( vAxNew1, dSafeZ - vAxPrev[2], GDB_ID_NULL, bZHomeDown))
|
||||
return false ;
|
||||
}
|
||||
else {
|
||||
if ( ! AddRise( vAxNew1, dSafeZ - vAxPrev[2], nPrevClPathId), bZHomeDown)
|
||||
if ( ! AddRise( vAxNew1, dSafeZ - vAxPrev[2], nPrevClPathId, bZHomeDown))
|
||||
return false ;
|
||||
}
|
||||
// aggiungo posizione elevata prima dell'inizio del percorso corrente
|
||||
@@ -2471,7 +2484,7 @@ Operation::CalcDeltaZForHeadRotation( const DBLVECTOR& vAxStart, const DBLVECTOR
|
||||
for ( int i = 0 ; i <= nStep ; ++ i) {
|
||||
vAng[0] = dR1Start + i * dR1Step ;
|
||||
vAng[1] = dR2Start + i * dR2Step ;
|
||||
vAng[2] = dR3Start + i * dR2Step ;
|
||||
vAng[2] = dR3Start + i * dR3Step ;
|
||||
Point3d ptTip ;
|
||||
if ( ! m_pMchMgr->GetCalcTipFromPositions( dL1, dL2, dL3, vAng, true, true, ptTip))
|
||||
return false ;
|
||||
|
||||
Reference in New Issue
Block a user