diff --git a/src/ApplicationFramework/TKCDF/LDOM/LDOMBasicString.cxx b/src/ApplicationFramework/TKCDF/LDOM/LDOMBasicString.cxx index 60dcc96ba4..a72a4cbd31 100644 --- a/src/ApplicationFramework/TKCDF/LDOM/LDOMBasicString.cxx +++ b/src/ApplicationFramework/TKCDF/LDOM/LDOMBasicString.cxx @@ -110,6 +110,7 @@ LDOMBasicString::LDOMBasicString(const LDOMBasicString& anOther) break; case LDOM_Integer: myVal.i = anOther.myVal.i; + break; default:; } } @@ -167,7 +168,9 @@ LDOMBasicString& LDOMBasicString::operator=(const LDOMBasicString& anOther) break; case LDOM_Integer: myVal.i = anOther.myVal.i; - default:; + break; + default: + break; } return *this; } diff --git a/src/ApplicationFramework/TKCDF/LDOM/LDOM_BasicElement.cxx b/src/ApplicationFramework/TKCDF/LDOM/LDOM_BasicElement.cxx index fe86d4b083..edd85582d4 100644 --- a/src/ApplicationFramework/TKCDF/LDOM/LDOM_BasicElement.cxx +++ b/src/ApplicationFramework/TKCDF/LDOM/LDOM_BasicElement.cxx @@ -74,7 +74,8 @@ void LDOM_BasicElement::RemoveNodes() aTxt = NULL; break; } - default:; + default: + break; } aNode = aNext; } diff --git a/src/ApplicationFramework/TKCDF/PCDM/PCDM_ReadWriter.cxx b/src/ApplicationFramework/TKCDF/PCDM/PCDM_ReadWriter.cxx index cf641bfb07..91aa43f95a 100644 --- a/src/ApplicationFramework/TKCDF/PCDM/PCDM_ReadWriter.cxx +++ b/src/ApplicationFramework/TKCDF/PCDM/PCDM_ReadWriter.cxx @@ -57,6 +57,7 @@ void PCDM_ReadWriter::Open(const Handle(Storage_BaseDriver)& aDriver, break; case Storage_VSAlreadyOpen: aMsg << "; file was already opened"; + break; default: break; } diff --git a/src/FoundationClasses/TKernel/Standard/Standard_Macro.hxx b/src/FoundationClasses/TKernel/Standard/Standard_Macro.hxx index cc8369a17f..2daf95d045 100644 --- a/src/FoundationClasses/TKernel/Standard/Standard_Macro.hxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_Macro.hxx @@ -63,11 +63,21 @@ //! Expands to C++17 attribute statement "[[fallthrough]];" on compilers that //! declare support of C++17, or to "__attribute__((fallthrough));" on //! GCC 7+. -#if defined(__cplusplus) && (__cplusplus >= 201703L) - // part of C++17 standard - #define Standard_FALLTHROUGH [[fallthrough]]; +#if defined(__has_cpp_attribute) + #if __has_cpp_attribute(fallthrough) + // C++17 standard attribute is supported + #define Standard_FALLTHROUGH [[fallthrough]]; + #elif __has_cpp_attribute(clang::fallthrough) + // Clang-specific attribute + #define Standard_FALLTHROUGH [[clang::fallthrough]]; + #elif __has_cpp_attribute(gnu::fallthrough) + // GCC-specific attribute (rare, but possible) + #define Standard_FALLTHROUGH [[gnu::fallthrough]]; + #else + #define Standard_FALLTHROUGH + #endif #elif defined(__GNUC__) && (__GNUC__ >= 7) - // gcc 7+ + // GCC 7+ supports __attribute__((fallthrough)) #define Standard_FALLTHROUGH __attribute__((fallthrough)); #else #define Standard_FALLTHROUGH diff --git a/src/FoundationClasses/TKernel/Standard/Standard_MemoryUtils.hxx b/src/FoundationClasses/TKernel/Standard/Standard_MemoryUtils.hxx index 6afdde604a..69de257db0 100644 --- a/src/FoundationClasses/TKernel/Standard/Standard_MemoryUtils.hxx +++ b/src/FoundationClasses/TKernel/Standard/Standard_MemoryUtils.hxx @@ -49,7 +49,7 @@ template std::shared_ptr make_oshared(NCollection_OccAllocator&& theAlloc, Args&&... theArgs) { return std::allocate_shared, Args...>( - std::forward < NCollection_OccAllocator(> theAlloc), + std::forward>(theAlloc), std::forward(theArgs)...); } diff --git a/src/FoundationClasses/TKernel/Units/Units_UnitsDictionary.cxx b/src/FoundationClasses/TKernel/Units/Units_UnitsDictionary.cxx index d3b51dc9ed..854e180d8d 100644 --- a/src/FoundationClasses/TKernel/Units/Units_UnitsDictionary.cxx +++ b/src/FoundationClasses/TKernel/Units/Units_UnitsDictionary.cxx @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -93,14 +94,15 @@ static const char* readLine(TCollection_AsciiString& theLine, const char* theStr void Units_UnitsDictionary::Creates() { - Standard_Boolean ismove; - Standard_Integer i, j, k, charnumber, unitscomputed; - Standard_Real matrix[50][50], coeff = 0, move = 0; - Handle(Units_Token) token; - Handle(Units_UnitsSequence) theunitssequence; - Handle(Units_Unit) unit; - Handle(Units_ShiftedUnit) shiftedunit; - Handle(Units_Quantity) quantity; + Standard_Boolean ismove; + Standard_Integer i, j, k, charnumber, unitscomputed; + NCollection_Array2 matrix(0, 49, 0, 49); + Standard_Real coeff = 0, move = 0; + Handle(Units_Token) token; + Handle(Units_UnitsSequence) theunitssequence; + Handle(Units_Unit) unit; + Handle(Units_ShiftedUnit) shiftedunit; + Handle(Units_Quantity) quantity; thequantitiessequence = new Units_QuantitiesSequence(); @@ -125,23 +127,23 @@ void Units_UnitsDictionary::Creates() { unitscomputed = 0; for (i = 0; i <= numberofunits; i++) - matrix[i][i] = 1.; + matrix(i, i) = 1.; for (i = 0; i <= numberofunits; i++) { - if (matrix[i][0]) + if (matrix(i, 0)) unitscomputed++; } while (unitscomputed != numberofunits + 1) { for (j = 1; j <= numberofunits; j++) { - if (!matrix[j][0]) + if (!matrix(j, 0)) { for (i = 1; i < j; i++) { - if (matrix[j][i] && matrix[i][0]) + if (matrix(j, i) && matrix(i, 0)) { - matrix[j][0] = matrix[i][0] * matrix[j][i]; + matrix(j, 0) = matrix(i, 0) * matrix(j, i); unitscomputed++; if (unitscomputed == numberofunits + 1) break; @@ -149,9 +151,9 @@ void Units_UnitsDictionary::Creates() } for (k = j + 1; k <= numberofunits; k++) { - if (matrix[k][j] && matrix[k][0]) + if (matrix(k, j) && matrix(k, 0)) { - matrix[j][0] = matrix[k][0] / matrix[k][j]; + matrix(j, 0) = matrix(k, 0) / matrix(k, j); unitscomputed++; if (unitscomputed == numberofunits + 1) break; @@ -165,7 +167,7 @@ void Units_UnitsDictionary::Creates() for (i = 1; i <= theunitssequence->Length(); i++) { unit = theunitssequence->Value(i); - unit->Value(matrix[i][0]); + unit->Value(matrix(i, 0)); } } @@ -224,7 +226,7 @@ void Units_UnitsDictionary::Creates() for (i = 0; i < 50; i++) { for (j = 0; j < 50; j++) - matrix[i][j] = 0.; + matrix(i, j) = 0.; } // skip next line (dotted) @@ -330,19 +332,19 @@ void Units_UnitsDictionary::Creates() if (j < numberofunits) { - matrix[numberofunits][j] = coeff; + matrix(numberofunits, j) = coeff; } else { Units_UnitSentence unitsentence(unit2, thequantitiessequence); - matrix[numberofunits][0] = coeff * (unitsentence.Evaluate())->Value(); + matrix(numberofunits, 0) = coeff * (unitsentence.Evaluate())->Value(); } } else { if (numberofunits == 1) { - matrix[1][0] = coeff; + matrix(1, 0) = coeff; unit = theunitssequence->Value(numberofunits); unit->Value(coeff); } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx index 476ddfce0a..1cfb7317bd 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntCurve/IntCurve_IntConicConic_1.cxx @@ -2068,6 +2068,7 @@ void IntCurve_IntConicConic::Perform(const gp_Lin2d& L1, ParamEnd2 = ParamEnd - Org2SurL1; } } + break; default: //~~~ Segment Infini a droite break; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx index b55c809d24..ecb57b317a 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/IntPatch/IntPatch_ImpPrmIntersection.cxx @@ -486,6 +486,7 @@ void Recadre(const Standard_Boolean, U1 += M_PI + M_PI; while (U1 > (U1p + 1.5 * M_PI)) U1 -= M_PI + M_PI; + break; default: break; } @@ -504,6 +505,7 @@ void Recadre(const Standard_Boolean, U2 += M_PI + M_PI; while (U2 > (U2p + 1.5 * M_PI)) U2 -= M_PI + M_PI; + break; default: break; } diff --git a/src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_CurveTransition.cxx b/src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_CurveTransition.cxx index a7a9958f45..da5f8f1102 100644 --- a/src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_CurveTransition.cxx +++ b/src/ModelingAlgorithms/TKGeomAlgo/TopTrans/TopTrans_CurveTransition.cxx @@ -32,6 +32,8 @@ TopTrans_CurveTransition::TopTrans_CurveTransition() CurvFirst(0.0), CurvLast(0.0) { + TranFirst = TopAbs_FORWARD; + TranLast = TopAbs_FORWARD; } //======================================================================= diff --git a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx index baf37f65c1..c331330a46 100644 --- a/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx +++ b/src/ModelingAlgorithms/TKShHealing/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx @@ -108,6 +108,7 @@ ShapeConstruct_ProjectCurveOnSurface::ShapeConstruct_ProjectCurveOnSurface() myBuild = Standard_False; myAdjustOverDegen = 1; //: c0 //szv#4:S4163:12Mar99 was boolean myNbCashe = 0; //: q9 + myStatus = ShapeExtend::EncodeStatus(ShapeExtend_OK); } //================================================================================================= diff --git a/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cxx b/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cxx index 47885b8c5d..0359eb7c8a 100644 --- a/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cxx +++ b/src/ModelingData/TKG2d/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cxx @@ -51,8 +51,8 @@ void Geom2dLProp_NumericCurInf2d::PerformCurExt(const Handle(Geom2d_Curve)& C, { isDone = Standard_True; - Standard_Real EpsH = 1.e-4 * (UMax - UMin); - Standard_Real Tol = Precision::PConfusion(); + Standard_Real EpsH = 1.e-4 * (UMax - UMin); + constexpr Standard_Real Tol = Precision::PConfusion(); // la premiere recherce se fait avec une tolerance assez grande // car la derivee de la fonction est estimee assez grossierement. diff --git a/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_SysBase.cxx b/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_SysBase.cxx index 3c23766210..b9f908278f 100644 --- a/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_SysBase.cxx +++ b/src/ModelingData/TKGeomBase/AdvApp2Var/AdvApp2Var_SysBase.cxx @@ -14,6 +14,7 @@ // AdvApp2Var_SysBase.cxx #include #include +#include #include #include #include @@ -1850,11 +1851,11 @@ int mcrcomm_(integer* kop, integer* noct, intptr_t* iadr, integer* ier) integer i__1, i__2; /* Local variables */ - intptr_t ideb; - doublereal dtab[32000]; - intptr_t itab[160] /* was [4][40] */; - intptr_t ipre; - integer i__, j, k; + intptr_t ideb; + NCollection_Array1 dtab(0, 32000 - 1); + NCollection_Array1 itab(0, 160 - 1); // was [4][40] but now flattened to a single array + intptr_t ipre; + integer i__, j, k; /************************************************************************ *******/ @@ -1973,7 +1974,7 @@ int mcrcomm_(integer* kop, integer* noct, intptr_t* iadr, integer* ier) itab[(i__ << 2) - 4] = *noct / 8 + 1; itab[(i__ << 2) - 3] = ipre; itab[(i__ << 2) - 2] = *noct; - *iadr = reinterpret_cast(&dtab[ipre - 1]); + *iadr = reinterpret_cast(&dtab[static_cast(ipre) - 1]); itab[(i__ << 2) - 1] = *iadr; goto L9900; } diff --git a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC2d.cxx b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC2d.cxx index 03d736ca6b..3b7bef5b9d 100644 --- a/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC2d.cxx +++ b/src/ModelingData/TKGeomBase/Extrema/Extrema_ExtCC2d.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -34,6 +35,7 @@ Extrema_ExtCC2d::Extrema_ExtCC2d() myIsPar(Standard_False), mynbext(0), inverse(Standard_False), + myC(nullptr), myv1(0.0), myv2(0.0), mytolc1(0.0), @@ -109,6 +111,9 @@ void Extrema_ExtCC2d::Perform(const Adaptor2d_Curve2d& C1, P2f = Extrema_Curve2dTool::Value(*myC, U21); P2l = Extrema_Curve2dTool::Value(*myC, U22); + std::shared_ptr aXtream; + std::shared_ptr aParamSolver; + switch (type1) { // @@ -120,44 +125,45 @@ void Extrema_ExtCC2d::Perform(const Adaptor2d_Curve2d& C1, { case GeomAbs_Line: { inverse = Standard_True; - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*myC), - Extrema_Curve2dTool::Circle(C1), - Tol); - Results(Xtrem, U11, U12, U21, U22, 2 * M_PI, 0.); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Line(*myC), + Extrema_Curve2dTool::Circle(C1), + Tol); + Results(*aXtream, U11, U12, U21, U22, 2 * M_PI, 0.); } break; case GeomAbs_Circle: { - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), - Extrema_Curve2dTool::Circle(*myC)); - Results(Xtrem, U11, U12, U21, U22, 2 * M_PI, 2 * M_PI); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Circle(C1), + Extrema_Curve2dTool::Circle(*myC)); + Results(*aXtream, U11, U12, U21, U22, 2 * M_PI, 2 * M_PI); } break; case GeomAbs_Ellipse: { - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), - Extrema_Curve2dTool::Ellipse(*myC)); - Results(Xtrem, U11, U12, U21, U22, 2 * M_PI, 2 * M_PI); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Circle(C1), + Extrema_Curve2dTool::Ellipse(*myC)); + Results(*aXtream, U11, U12, U21, U22, 2 * M_PI, 2 * M_PI); } break; case GeomAbs_Parabola: { - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), - Extrema_Curve2dTool::Parabola(*myC)); - Results(Xtrem, U11, U12, U21, U22, 2 * M_PI, 0.); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Circle(C1), + Extrema_Curve2dTool::Parabola(*myC)); + Results(*aXtream, U11, U12, U21, U22, 2 * M_PI, 0.); } break; case GeomAbs_Hyperbola: { - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(C1), - Extrema_Curve2dTool::Hyperbola(*myC)); - Results(Xtrem, U11, U12, U21, U22, 2 * M_PI, 0.); + aXtream = + opencascade::make_shared(Extrema_Curve2dTool::Circle(C1), + Extrema_Curve2dTool::Hyperbola(*myC)); + Results(*aXtream, U11, U12, U21, U22, 2 * M_PI, 0.); } break; default: { - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); Standard_Real Period2 = 0.; if (Extrema_Curve2dTool::IsPeriodic(*myC)) Period2 = Extrema_Curve2dTool::Period(*myC); - Results(aParamSolver, U11, U12, U21, U22, 2 * M_PI, Period2); + Results(*aParamSolver, U11, U12, U21, U22, 2 * M_PI, Period2); } break; }; // switch(type2) @@ -173,50 +179,51 @@ void Extrema_ExtCC2d::Perform(const Adaptor2d_Curve2d& C1, { case GeomAbs_Line: { inverse = Standard_True; - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*myC), Extrema_Curve2dTool::Ellipse(C1)); - Results(Xtrem, U11, U12, U21, U22, 2 * M_PI, 0.); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Line(*myC), + Extrema_Curve2dTool::Ellipse(C1)); + Results(*aXtream, U11, U12, U21, U22, 2 * M_PI, 0.); } break; case GeomAbs_Circle: { inverse = Standard_True; - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(*myC), - Extrema_Curve2dTool::Ellipse(C1)); - Results(Xtrem, U11, U12, U21, U22, 2 * M_PI, 2 * M_PI); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Circle(*myC), + Extrema_Curve2dTool::Ellipse(C1)); + Results(*aXtream, U11, U12, U21, U22, 2 * M_PI, 2 * M_PI); } break; case GeomAbs_Ellipse: { - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); - Results(aParamSolver, U11, U12, U21, U22, 2 * M_PI, 2 * M_PI); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); + Results(*aParamSolver, U11, U12, U21, U22, 2 * M_PI, 2 * M_PI); } break; case GeomAbs_Parabola: { // Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(C1), // Extrema_Curve2dTool::Parabola(*myC)); - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); - Results(aParamSolver, U11, U12, U21, U22, 2 * M_PI, 0.); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); + Results(*aParamSolver, U11, U12, U21, U22, 2 * M_PI, 0.); } break; case GeomAbs_Hyperbola: { // Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(C1), // Extrema_Curve2dTool::Hyperbola(*myC)); - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); - Results(aParamSolver, U11, U12, U21, U22, 2 * M_PI, 0.); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); + Results(*aParamSolver, U11, U12, U21, U22, 2 * M_PI, 0.); } break; default: { - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); Standard_Real Period2 = 0.; if (Extrema_Curve2dTool::IsPeriodic(*myC)) Period2 = Extrema_Curve2dTool::Period(*myC); - Results(aParamSolver, U11, U12, U21, U22, 2 * M_PI, Period2); + Results(*aParamSolver, U11, U12, U21, U22, 2 * M_PI, Period2); } break; }; // switch(type2) @@ -232,55 +239,55 @@ void Extrema_ExtCC2d::Perform(const Adaptor2d_Curve2d& C1, { case GeomAbs_Line: { inverse = Standard_True; - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*myC), - Extrema_Curve2dTool::Parabola(C1)); - Results(Xtrem, U11, U12, U21, U22, 0., 0.); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Line(*myC), + Extrema_Curve2dTool::Parabola(C1)); + Results(*aXtream, U11, U12, U21, U22, 0., 0.); } break; case GeomAbs_Circle: { inverse = Standard_True; - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(*myC), - Extrema_Curve2dTool::Parabola(C1)); - Results(Xtrem, U11, U12, U21, U22, 0., 2 * M_PI); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Circle(*myC), + Extrema_Curve2dTool::Parabola(C1)); + Results(*aXtream, U11, U12, U21, U22, 0., 2 * M_PI); } break; case GeomAbs_Ellipse: { // inverse = Standard_True; // Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(*myC), // Extrema_Curve2dTool::Parabola(C1)); - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); - Results(aParamSolver, U11, U12, U21, U22, 0., 2 * M_PI); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); + Results(*aParamSolver, U11, U12, U21, U22, 0., 2 * M_PI); } break; case GeomAbs_Parabola: { // Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Parabola(C1), // Extrema_Curve2dTool::Parabola(*myC)); - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); - Results(aParamSolver, U11, U12, U21, U22, 0., 0.); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); + Results(*aParamSolver, U11, U12, U21, U22, 0., 0.); } break; case GeomAbs_Hyperbola: { // inverse = Standard_True; // Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(*myC), // Extrema_Curve2dTool::Parabola(C1)); - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); - Results(aParamSolver, U11, U12, U21, U22, 0., 0.); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); + Results(*aParamSolver, U11, U12, U21, U22, 0., 0.); } break; default: { - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); Standard_Real Period2 = 0.; if (Extrema_Curve2dTool::IsPeriodic(*myC)) Period2 = Extrema_Curve2dTool::Period(*myC); - Results(aParamSolver, U11, U12, U21, U22, 0., Period2); + Results(*aParamSolver, U11, U12, U21, U22, 0., Period2); } break; }; // switch(type2) @@ -296,54 +303,54 @@ void Extrema_ExtCC2d::Perform(const Adaptor2d_Curve2d& C1, { case GeomAbs_Line: { inverse = Standard_True; - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(*myC), - Extrema_Curve2dTool::Hyperbola(C1)); - Results(Xtrem, U11, U12, U21, U22, 0., 0.); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Line(*myC), + Extrema_Curve2dTool::Hyperbola(C1)); + Results(*aXtream, U11, U12, U21, U22, 0., 0.); } break; case GeomAbs_Circle: { inverse = Standard_True; - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Circle(*myC), - Extrema_Curve2dTool::Hyperbola(C1)); - Results(Xtrem, U11, U12, U21, U22, 0., 2 * M_PI); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Circle(*myC), + Extrema_Curve2dTool::Hyperbola(C1)); + Results(*aXtream, U11, U12, U21, U22, 0., 2 * M_PI); } break; case GeomAbs_Ellipse: { // inverse = Standard_True; // Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Ellipse(*myC), // Extrema_Curve2dTool::Hyperbola(C1)); - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); - Results(aParamSolver, U11, U12, U21, U22, 0., 2 * M_PI); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); + Results(*aParamSolver, U11, U12, U21, U22, 0., 2 * M_PI); } break; case GeomAbs_Parabola: { // Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(C1), // Extrema_Curve2dTool::Parabola(*myC)); - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); - Results(aParamSolver, U11, U12, U21, U22, 0., 0.); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); + Results(*aParamSolver, U11, U12, U21, U22, 0., 0.); } break; case GeomAbs_Hyperbola: { // Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Hyperbola(C1), // Extrema_Curve2dTool::Hyperbola(*myC)); - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); - Results(aParamSolver, U11, U12, U21, U22, 0., 0.); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); + Results(*aParamSolver, U11, U12, U21, U22, 0., 0.); } break; default: { - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); Standard_Real Period2 = 0.; if (Extrema_Curve2dTool::IsPeriodic(*myC)) Period2 = Extrema_Curve2dTool::Period(*myC); - Results(aParamSolver, U11, U12, U21, U22, 0., Period2); + Results(*aParamSolver, U11, U12, U21, U22, 0., Period2); } break; }; // switch(type2) @@ -358,44 +365,46 @@ void Extrema_ExtCC2d::Perform(const Adaptor2d_Curve2d& C1, switch (type2) { case GeomAbs_Line: { - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), - Extrema_Curve2dTool::Line(*myC), - Tol); - Results(Xtrem, U11, U12, U21, U22, 0., 0.); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Line(C1), + Extrema_Curve2dTool::Line(*myC), + Tol); + Results(*aXtream, U11, U12, U21, U22, 0., 0.); } break; case GeomAbs_Circle: { - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), - Extrema_Curve2dTool::Circle(*myC), - Tol); - Results(Xtrem, U11, U12, U21, U22, 0., 2 * M_PI); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Line(C1), + Extrema_Curve2dTool::Circle(*myC), + Tol); + Results(*aXtream, U11, U12, U21, U22, 0., 2 * M_PI); } break; case GeomAbs_Ellipse: { - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), Extrema_Curve2dTool::Ellipse(*myC)); - Results(Xtrem, U11, U12, U21, U22, 0., 2 * M_PI); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Line(C1), + Extrema_Curve2dTool::Ellipse(*myC)); + Results(*aXtream, U11, U12, U21, U22, 0., 2 * M_PI); } break; case GeomAbs_Parabola: { - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), - Extrema_Curve2dTool::Parabola(*myC)); - Results(Xtrem, U11, U12, U21, U22, 0., 0.); + aXtream = opencascade::make_shared(Extrema_Curve2dTool::Line(C1), + Extrema_Curve2dTool::Parabola(*myC)); + Results(*aXtream, U11, U12, U21, U22, 0., 0.); } break; case GeomAbs_Hyperbola: { - Extrema_ExtElC2d Xtrem(Extrema_Curve2dTool::Line(C1), - Extrema_Curve2dTool::Hyperbola(*myC)); - Results(Xtrem, U11, U12, U21, U22, 0., 0.); + aXtream = + opencascade::make_shared(Extrema_Curve2dTool::Line(C1), + Extrema_Curve2dTool::Hyperbola(*myC)); + Results(*aXtream, U11, U12, U21, U22, 0., 0.); } break; default: { - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); Standard_Real Period2 = 0.; if (Extrema_Curve2dTool::IsPeriodic(*myC)) Period2 = Extrema_Curve2dTool::Period(*myC); - Results(aParamSolver, U11, U12, U21, U22, 0., Period2); + Results(*aParamSolver, U11, U12, U21, U22, 0., Period2); } break; }; // switch(type2) @@ -406,16 +415,16 @@ void Extrema_ExtCC2d::Perform(const Adaptor2d_Curve2d& C1, // La premiere courbe est une BezierCurve ou une BSplineCurve: // default: { - Extrema_ECC2d aParamSolver(C1, *myC); - aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); - aParamSolver.Perform(); + aParamSolver = opencascade::make_shared(C1, *myC); + aParamSolver->SetSingleSolutionFlag(GetSingleSolutionFlag()); + aParamSolver->Perform(); Standard_Real Period1 = 0.; if (Extrema_Curve2dTool::IsPeriodic(C1)) Period1 = Extrema_Curve2dTool::Period(C1); Standard_Real Period2 = 0.; if (Extrema_Curve2dTool::IsPeriodic(*myC)) Period2 = Extrema_Curve2dTool::Period(*myC); - Results(aParamSolver, U11, U12, U21, U22, Period1, Period2); + Results(*aParamSolver, U11, U12, U21, U22, Period1, Period2); } break; };