diff --git a/VolZmapVolume.cpp b/VolZmapVolume.cpp index 7b83bec..1ad3af4 100644 --- a/VolZmapVolume.cpp +++ b/VolZmapVolume.cpp @@ -501,9 +501,9 @@ VolZmap::MillingStep( int nCurrTool, m_nCurrTool = nCurrTool ; Tool& CurrTool = m_vTool[m_nCurrTool] ; - // Se non è definito l'utensile, non devo fare alcunchè + // Se non è definito l'utensile, non posso fare alcunchè if ( CurrTool.GetType() == Tool::UNDEF) - return true ; + return false ; // Controllo definizione vettori direzione if ( vtDs.IsSmall() || vtDe.IsSmall()) return false ; @@ -520,21 +520,15 @@ VolZmap::MillingStep( int nCurrTool, m_nConnectedCompoCount = - 1 ; // Punti e vettori descriventi il moto nel sistema intrinseco dello Zmap - Point3d ptPLs = ptPs ; - ptPLs.ToLoc( m_MapFrame) ; - Point3d ptPLe = ptPe ; - ptPLe.ToLoc( m_MapFrame) ; - Vector3d vtDLs = vtDs ; - vtDLs.ToLoc( m_MapFrame) ; + Point3d ptPLs = GetToLoc( ptPs, m_MapFrame) ; + Point3d ptPLe = GetToLoc( ptPe, m_MapFrame) ; + Vector3d vtDLs = GetToLoc( vtDs, m_MapFrame) ; vtDLs.Normalize() ; - Vector3d vtDLe = vtDe ; - vtDLe.ToLoc( m_MapFrame) ; + Vector3d vtDLe = GetToLoc( vtDe, m_MapFrame) ; vtDLe.Normalize() ; - Vector3d vtALs = vtAs ; - vtALs.ToLoc( m_MapFrame) ; + Vector3d vtALs = GetToLoc( vtAs, m_MapFrame) ; vtALs.Normalize() ; - Vector3d vtALe = vtAe ; - vtALe.ToLoc( m_MapFrame) ; + Vector3d vtALe = GetToLoc( vtAe, m_MapFrame) ; vtALe.Normalize() ; //static PerformanceCounter Counter ; @@ -624,7 +618,7 @@ VolZmap::MillingTranslationStep( const Point3d& ptPs, const Point3d& ptPe, const } } } - return true ; + return bOk ; } //---------------------------------------------------------------------------- @@ -677,21 +671,16 @@ VolZmap::SelectMotion( int nGrid, const Point3d& ptLs, const Point3d& ptLe, cons if ( vtMove.SqLenXY() < EPS_SMALL * EPS_SMALL) { switch ( CurrTool.GetType()) { case Tool::GEN : - GenTool_ZDrilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return GenTool_ZDrilling( nGrid, ptLs, ptLe, vtL) ; case Tool::CYLMILL : case Tool::BALLMILL : - CylBall_ZDrilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return CylBall_ZDrilling( nGrid, ptLs, ptLe, vtL) ; case Tool::CONEMILL : - Conus_ZDrilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return Conus_ZDrilling( nGrid, ptLs, ptLe, vtL) ; case Tool::MORTISER : - Mrt_ZDrilling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Mrt_ZDrilling( nGrid, ptLs, ptLe, vtL, vtAL) ; case Tool::CHISEL : - Chs_ZDrilling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Chs_ZDrilling( nGrid, ptLs, ptLe, vtL, vtAL) ; } } @@ -699,21 +688,16 @@ VolZmap::SelectMotion( int nGrid, const Point3d& ptLs, const Point3d& ptLe, cons else if ( abs( vtMove.z) < EPS_SMALL) { switch ( CurrTool.GetType()) { case Tool::GEN : - GenTool_ZMilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return GenTool_ZMilling( nGrid, ptLs, ptLe, vtL) ; case Tool::CYLMILL : case Tool::BALLMILL : - CylBall_ZPerp( nGrid, ptLs, ptLe, vtL) ; - break ; + return CylBall_ZPerp( nGrid, ptLs, ptLe, vtL) ; case Tool::CONEMILL : - Conus_ZPerp( nGrid, ptLs, ptLe, vtL) ; - break ; + return Conus_ZPerp( nGrid, ptLs, ptLe, vtL) ; case Tool::MORTISER : - Mrt_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Mrt_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; case Tool::CHISEL : - Chs_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Chs_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; } } @@ -721,18 +705,14 @@ VolZmap::SelectMotion( int nGrid, const Point3d& ptLs, const Point3d& ptLe, cons else { switch ( CurrTool.GetType()) { case Tool::GEN : - GenTool_ZMilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return GenTool_ZMilling( nGrid, ptLs, ptLe, vtL) ; case Tool::CYLMILL : case Tool::BALLMILL : - CylBall_ZMilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return CylBall_ZMilling( nGrid, ptLs, ptLe, vtL) ; case Tool::CONEMILL : - Conus_ZMilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return Conus_ZMilling( nGrid, ptLs, ptLe, vtL) ; case Tool::MORTISER : - Mrt_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Mrt_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; } } } @@ -751,62 +731,48 @@ VolZmap::SelectMotion( int nGrid, const Point3d& ptLs, const Point3d& ptLe, cons if ( dSqLOrt < EPS_SMALL * EPS_SMALL) { switch ( CurrTool.GetType()) { case Tool::GEN : - GenTool_Drilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return GenTool_Drilling( nGrid, ptLs, ptLe, vtL) ; case Tool::CYLMILL : case Tool::BALLMILL : - CylBall_XYDrilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return CylBall_XYDrilling( nGrid, ptLs, ptLe, vtL) ; case Tool::CONEMILL : - Conus_XYDrilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return Conus_XYDrilling( nGrid, ptLs, ptLe, vtL) ; case Tool::MORTISER : - Mrt_Drilling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Mrt_Drilling( nGrid, ptLs, ptLe, vtL, vtAL) ; case Tool::CHISEL : - Chs_Drilling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Chs_Drilling( nGrid, ptLs, ptLe, vtL, vtAL) ; } } // Fresatura con vettore movimento perpendicolare all'utensile else if ( dSqLLong < EPS_SMALL * EPS_SMALL) { switch ( CurrTool.GetType()) { case Tool::GEN : - GenTool_Milling( nGrid, ptLs, ptLe, vtL) ; - break ; + return GenTool_Milling( nGrid, ptLs, ptLe, vtL) ; case Tool::CYLMILL : case Tool::BALLMILL : - CylBall_XYPerp( nGrid, ptLs, ptLe, vtL) ; - break ; + return CylBall_XYPerp( nGrid, ptLs, ptLe, vtL) ; case Tool::CONEMILL : // Usiamo la generica per via dell'intsabilità di Conus_XYPerp - //Conus_XYPerp( i, ptLs[i], ptLe[i], vtLs[i]) ; - Conus_Milling( nGrid, ptLs, ptLe, vtL) ; - break ; + //return Conus_XYPerp( i, ptLs[i], ptLe[i], vtLs[i]) ; + return Conus_Milling( nGrid, ptLs, ptLe, vtL) ; case Tool::MORTISER : - Mrt_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Mrt_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; case Tool::CHISEL : - Chs_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Chs_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; } } // Fresatura con vettore movimento generico rispetto all'utensile else { switch ( CurrTool.GetType()) { case Tool::GEN : - GenTool_Milling( nGrid, ptLs, ptLe, vtL); - break ; + return GenTool_Milling( nGrid, ptLs, ptLe, vtL); case Tool::CYLMILL : case Tool::BALLMILL : - CylBall_XYMilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return CylBall_XYMilling( nGrid, ptLs, ptLe, vtL) ; case Tool::CONEMILL : - Conus_XYMilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return Conus_XYMilling( nGrid, ptLs, ptLe, vtL) ; case Tool::MORTISER : - Mrt_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Mrt_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; } } } @@ -824,48 +790,39 @@ VolZmap::SelectMotion( int nGrid, const Point3d& ptLs, const Point3d& ptLe, cons if ( dSqLOrt < EPS_SMALL * EPS_SMALL) { switch ( CurrTool.GetType()) { case Tool::GEN : - GenTool_Drilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return GenTool_Drilling( nGrid, ptLs, ptLe, vtL) ; case Tool::CYLMILL : case Tool::BALLMILL : - CylBall_Drilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return CylBall_Drilling( nGrid, ptLs, ptLe, vtL) ; case Tool::CONEMILL : - Conus_Drilling( nGrid, ptLs, ptLe, vtL) ; - break ; + return Conus_Drilling( nGrid, ptLs, ptLe, vtL) ; case Tool::MORTISER : - Mrt_Drilling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Mrt_Drilling( nGrid, ptLs, ptLe, vtL, vtAL) ; case Tool::CHISEL : - Chs_Drilling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Chs_Drilling( nGrid, ptLs, ptLe, vtL, vtAL) ; } } // Fresatura con vettore movimento generico rispetto all'utensile else { switch ( CurrTool.GetType()) { case Tool::GEN : - GenTool_Milling( nGrid, ptLs, ptLe, vtL) ; - break ; + return GenTool_Milling( nGrid, ptLs, ptLe, vtL) ; case Tool::CYLMILL : case Tool::BALLMILL : - CylBall_Milling( nGrid, ptLs, ptLe, vtL) ; - break ; + return CylBall_Milling( nGrid, ptLs, ptLe, vtL) ; case Tool::CONEMILL : - Conus_Milling( nGrid, ptLs, ptLe, vtL) ; - break ; + return Conus_Milling( nGrid, ptLs, ptLe, vtL) ; case Tool::MORTISER : - Mrt_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; - break ; + return Mrt_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; case Tool::CHISEL : // ammesso solo movimento perpendicolare all'asse utensile if ( dSqLLong < EPS_SMALL * EPS_SMALL) - Chs_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; + return Chs_Milling( nGrid, ptLs, ptLe, vtL, vtAL) ; break ; } } } - return true ; + return false ; }