diff --git a/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__TryCatch.hxx b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__TryCatch.hxx index 6108c1173892..a9b950a9ada1 100644 --- a/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__TryCatch.hxx +++ b/cad/freecad/files/patch-src_3rdParty_salomesmesh_inc_SMESH__TryCatch.hxx @@ -1,57 +1,56 @@ --- src/3rdParty/salomesmesh/inc/SMESH_TryCatch.hxx.orig 2026-04-14 22:09:59 UTC +++ src/3rdParty/salomesmesh/inc/SMESH_TryCatch.hxx -@@ -65,11 +65,46 @@ +@@ -65,11 +65,45 @@ // Two onExceptionFun() are defined here: SMESH::throwSalomeEx() and SMESH::doNothing(). // To add your own catch close, define SMY_OWN_CATCH macro before including this file. +#include +#if OCC_VERSION_HEX >= 0x080000 #define SMESH_CATCH( onExceptionFun ) \ } \ catch (Standard_Failure& ex) \ { \ SMESH_Comment text("OCCT Exception: "); \ + text << ": " << ex.ExceptionType(); \ + if ( ex.what() && strlen( ex.what() )) \ + text << ": " << ex.what(); \ + SMESH_CAUGHT onExceptionFun( text ); \ + } \ + catch ( ::SMESH_ComputeError& ce ) \ + { \ + if ( !ce.myComment.empty() ) \ + SMESH_CAUGHT onExceptionFun( ce.myComment.c_str() ); \ + else if ( ce.IsCommon() ) \ + SMESH_CAUGHT onExceptionFun( ce.CommonName().c_str() ); \ + else \ + SMESH_CAUGHT onExceptionFun \ + (SMESH_Comment("SMESH_ComputeError: ") << ce.myName ); \ + } \ + catch ( const std::exception& ex) \ + { \ + SMESH_CAUGHT onExceptionFun( ex.what() ); \ + } \ + \ + SMY_OWN_CATCH \ + \ + catch (...) \ + { \ + SMESH_CAUGHT onExceptionFun("Unknown Exception caught"); \ + } +#else +#define SMESH_CATCH( onExceptionFun ) \ -+#define SMESH_CATCH( onExceptionFun ) \ + } \ + catch (Standard_Failure& ex) \ + { \ + SMESH_Comment text("OCCT Exception: "); \ text << ": " << ex.DynamicType()->Name(); \ if ( ex.GetMessageString() && strlen( ex.GetMessageString() )) \ text << ": " << ex.GetMessageString(); \ @@ -96,6 +131,7 @@ { \ SMESH_CAUGHT onExceptionFun("Unknown Exception caught"); \ } +#endif //------------------------------------------------------------------------------------- // Functions that can be used as an argument of SMESH_CATCH diff --git a/cad/freecad/files/patch-src_Mod_ReverseEngineering_App_ApproxSurface.cpp b/cad/freecad/files/patch-src_Mod_ReverseEngineering_App_ApproxSurface.cpp index 3803079e226a..9656ce818b18 100644 --- a/cad/freecad/files/patch-src_Mod_ReverseEngineering_App_ApproxSurface.cpp +++ b/cad/freecad/files/patch-src_Mod_ReverseEngineering_App_ApproxSurface.cpp @@ -1,47 +1,62 @@ --- src/Mod/ReverseEngineering/App/ApproxSurface.cpp.orig 2026-07-02 14:13:51 UTC +++ src/Mod/ReverseEngineering/App/ApproxSurface.cpp @@ -63,7 +63,7 @@ SplineBasisfunction::SplineBasisfunction( if (vKnots.Length() != vMults.Length() || iSize != sum) { // Throw exception - Standard_ConstructionError::Raise("BSplineBasis"); + throw Standard_ConstructionError("BSplineBasis"); } int k = 0; @@ -89,7 +89,7 @@ void SplineBasisfunction::SetKnots(TColStd_Array1OfRea void SplineBasisfunction::SetKnots(TColStd_Array1OfReal& vKnots, int iOrder) { if (_vKnotVector.Length() != vKnots.Length()) { - Standard_RangeError::Raise("BSplineBasis"); + throw Standard_RangeError("BSplineBasis"); } _vKnotVector = vKnots; @@ -105,7 +105,7 @@ void SplineBasisfunction::SetKnots(TColStd_Array1OfRea if (vKnots.Length() != vMults.Length() || _vKnotVector.Length() != sum) { // Throw exception - Standard_RangeError::Raise("BSplineBasis"); + throw Standard_RangeError("BSplineBasis"); } int k = 0; for (int i = vMults.Lower(); i <= vMults.Upper(); i++) { @@ -166,7 +166,7 @@ void BSplineBasis::AllBasisFunctions(double fParam, TC void BSplineBasis::AllBasisFunctions(double fParam, TColStd_Array1OfReal& vFuncVals) { if (vFuncVals.Length() != _iOrder) { - Standard_RangeError::Raise("BSplineBasis"); + throw Standard_RangeError("BSplineBasis"); } int iIndex = FindSpan(fParam); @@ -268,7 +268,7 @@ void BSplineBasis::DerivativesOfBasisFunction( { int iMax = iMaxDer; if (Derivat.Length() != iMax + 1) { - Standard_RangeError::Raise("BSplineBasis"); + throw Standard_RangeError("BSplineBasis"); } // kth derivatives (k> degrees) are zero if (iMax >= _iOrder) { +@@ -649,10 +649,10 @@ ParameterCorrection::ParameterCorrection( + , _usUCtrlpoints(usUCtrlpoints) + , _usVCtrlpoints(usVCtrlpoints) + , _vCtrlPntsOfSurf(0, usUCtrlpoints - 1, 0, usVCtrlpoints - 1) +- , _vUKnots(0, usUCtrlpoints - usUOrder + 1) +- , _vVKnots(0, usVCtrlpoints - usVOrder + 1) +- , _vUMults(0, usUCtrlpoints - usUOrder + 1) +- , _vVMults(0, usVCtrlpoints - usVOrder + 1) ++ , _vUKnots(0, (int)(usUCtrlpoints - usUOrder + 1)) ++ , _vVKnots(0, (int)(usVCtrlpoints - usVOrder + 1)) ++ , _vUMults(0, (int)(usUCtrlpoints - usUOrder + 1)) ++ , _vVMults(0, (int)(usVCtrlpoints - usVOrder + 1)) + { + _bGetUVDir = false; + _bSmoothing = false;