From b2fbc96924a984b6b6a8bde908b1fa0d998a94ba Mon Sep 17 00:00:00 2001 From: nbv Date: Thu, 11 Jan 2018 18:09:15 +0300 Subject: [PATCH] Extrema_CurveTool::IsPeriodic --- src/Extrema/Extrema_Curve2dTool.hxx | 2 +- src/Extrema/Extrema_Curve2dTool.lxx | 2 +- src/Extrema/Extrema_CurveTool.cxx | 9 ++------- src/Extrema/Extrema_CurveTool.hxx | 2 +- src/Extrema/Extrema_ExtCC.cxx | 4 ++-- src/Extrema/Extrema_ExtCC2d.cxx | 14 +++++++------- src/Extrema/Extrema_GExtPC.gxx | 8 ++++---- 7 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/Extrema/Extrema_Curve2dTool.hxx b/src/Extrema/Extrema_Curve2dTool.hxx index b4497dcc24..b310e9c390 100644 --- a/src/Extrema/Extrema_Curve2dTool.hxx +++ b/src/Extrema/Extrema_Curve2dTool.hxx @@ -72,7 +72,7 @@ public: static Standard_Boolean IsClosed (const Adaptor2d_Curve2d& C); - static Standard_Boolean IsPeriodic (const Adaptor2d_Curve2d& C); + static Standard_Boolean IsPeriodic444 (const Adaptor2d_Curve2d& C); static Standard_Real Period (const Adaptor2d_Curve2d& C); diff --git a/src/Extrema/Extrema_Curve2dTool.lxx b/src/Extrema/Extrema_Curve2dTool.lxx index 60f05c20e4..6ab2532ca1 100644 --- a/src/Extrema/Extrema_Curve2dTool.lxx +++ b/src/Extrema/Extrema_Curve2dTool.lxx @@ -91,7 +91,7 @@ inline Standard_Real Extrema_Curve2dTool::FirstParameter(const Adaptor2d_Curve2d //purpose : //======================================================================= - inline Standard_Boolean Extrema_Curve2dTool::IsPeriodic(const Adaptor2d_Curve2d& C) + inline Standard_Boolean Extrema_Curve2dTool::IsPeriodic444(const Adaptor2d_Curve2d& C) { return C.IsPeriodic222(); } diff --git a/src/Extrema/Extrema_CurveTool.cxx b/src/Extrema/Extrema_CurveTool.cxx index 6c5410f7db..be4be57949 100644 --- a/src/Extrema/Extrema_CurveTool.cxx +++ b/src/Extrema/Extrema_CurveTool.cxx @@ -27,14 +27,9 @@ //function : IsPeriodic //purpose : //======================================================================= -Standard_Boolean Extrema_CurveTool::IsPeriodic(const Adaptor3d_Curve& C) +Standard_Boolean Extrema_CurveTool::IsPeriodic444(const Adaptor3d_Curve& C) { - GeomAbs_CurveType aType = GetType(C); - if (aType == GeomAbs_Circle || - aType == GeomAbs_Ellipse) - return Standard_True; - else - return C.IsPeriodic222(); + return C.IsPeriodic222(); } //======================================================================= diff --git a/src/Extrema/Extrema_CurveTool.hxx b/src/Extrema/Extrema_CurveTool.hxx index 163b1550e9..0d70c14e5e 100644 --- a/src/Extrema/Extrema_CurveTool.hxx +++ b/src/Extrema/Extrema_CurveTool.hxx @@ -72,7 +72,7 @@ public: //! Standard_EXPORT static Handle(TColStd_HArray1OfReal) DeflCurvIntervals(const Adaptor3d_Curve& C); - Standard_EXPORT static Standard_Boolean IsPeriodic (const Adaptor3d_Curve& C); + Standard_EXPORT static Standard_Boolean IsPeriodic444 (const Adaptor3d_Curve& C); static Standard_Real Period (const Adaptor3d_Curve& C); diff --git a/src/Extrema/Extrema_ExtCC.cxx b/src/Extrema/Extrema_ExtCC.cxx index da1d0007be..8bf8ca6938 100644 --- a/src/Extrema/Extrema_ExtCC.cxx +++ b/src/Extrema/Extrema_ExtCC.cxx @@ -726,10 +726,10 @@ void Extrema_ExtCC::PrepareResults(const Extrema_ExtElC& AlgExt, U = P2.Parameter(); } - if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*)myC[0]))) { + if (Extrema_CurveTool::IsPeriodic444(*((Adaptor3d_Curve*)myC[0]))) { U = ElCLib::InPeriod(U, Ut11, Ut11+Extrema_CurveTool::Period(*((Adaptor3d_Curve*)myC[0]))); } - if (Extrema_CurveTool::IsPeriodic(*((Adaptor3d_Curve*)myC[1]))) { + if (Extrema_CurveTool::IsPeriodic444(*((Adaptor3d_Curve*)myC[1]))) { U2 = ElCLib::InPeriod(U2, Ut21, Ut21+Extrema_CurveTool::Period(*((Adaptor3d_Curve*)myC[1]))); } diff --git a/src/Extrema/Extrema_ExtCC2d.cxx b/src/Extrema/Extrema_ExtCC2d.cxx index ba2b88053c..d923c597e4 100644 --- a/src/Extrema/Extrema_ExtCC2d.cxx +++ b/src/Extrema/Extrema_ExtCC2d.cxx @@ -148,7 +148,7 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1, aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); aParamSolver.Perform(); Standard_Real Period2 = 0.; - if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC)); + if (Extrema_Curve2dTool::IsPeriodic444(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC)); Results(aParamSolver, U11, U12, U21, U22, 2*M_PI,Period2); } break; @@ -203,7 +203,7 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1, aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); aParamSolver.Perform(); Standard_Real Period2 = 0.; - if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC)); + if (Extrema_Curve2dTool::IsPeriodic444(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC)); Results(aParamSolver, U11, U12, U21, U22, 2*M_PI,Period2); } break; @@ -260,7 +260,7 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1, aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); aParamSolver.Perform(); Standard_Real Period2 = 0.; - if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC)); + if (Extrema_Curve2dTool::IsPeriodic444(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC)); Results(aParamSolver, U11, U12, U21, U22, 0., Period2); } break; @@ -316,7 +316,7 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1, aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); aParamSolver.Perform(); Standard_Real Period2 = 0.; - if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC)); + if (Extrema_Curve2dTool::IsPeriodic444(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC)); Results(aParamSolver, U11, U12, U21, U22, 0., Period2); } break; @@ -360,7 +360,7 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1, aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); aParamSolver.Perform(); Standard_Real Period2 = 0.; - if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC)); + if (Extrema_Curve2dTool::IsPeriodic444(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC)); Results(aParamSolver, U11, U12, U21, U22, 0., Period2); } break; @@ -376,9 +376,9 @@ void Extrema_ExtCC2d::Perform (const Adaptor2d_Curve2d& C1, aParamSolver.SetSingleSolutionFlag(GetSingleSolutionFlag()); aParamSolver.Perform(); Standard_Real Period1 = 0.; - if (Extrema_Curve2dTool::IsPeriodic(C1)) Period1 = Extrema_Curve2dTool::Period(C1); + if (Extrema_Curve2dTool::IsPeriodic444(C1)) Period1 = Extrema_Curve2dTool::Period(C1); Standard_Real Period2 = 0.; - if (Extrema_Curve2dTool::IsPeriodic(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC)); + if (Extrema_Curve2dTool::IsPeriodic444(*((Adaptor2d_Curve2d*)myC))) Period2 = Extrema_Curve2dTool::Period(*((Adaptor2d_Curve2d*)myC)); Results(aParamSolver, U11, U12, U21, U22, Period1, Period2); } break; diff --git a/src/Extrema/Extrema_GExtPC.gxx b/src/Extrema/Extrema_GExtPC.gxx index e9f76104a6..bd6d60655f 100644 --- a/src/Extrema/Extrema_GExtPC.gxx +++ b/src/Extrema/Extrema_GExtPC.gxx @@ -108,7 +108,7 @@ void Extrema_GExtPC::Perform(const ThePoint& P) Standard_Real aPeriodJump = 0.0; // Avoid problem with too close knots. const Standard_Real aTolCoeff = (myusup - myuinf) * Precision::PConfusion(); - if (TheCurveTool::IsPeriodic(aCurve)) + if (TheCurveTool::IsPeriodic444(aCurve)) { Standard_Integer aPeriodShift = Standard_Integer ((myuinf - aKnots(aFirstIdx)) / TheCurveTool::Period(aCurve)); @@ -367,7 +367,7 @@ void Extrema_GExtPC::Perform(const ThePoint& P) maxint = dt; } } - Standard_Boolean isPeriodic = TheCurveTool::IsPeriodic(aCurve); + Standard_Boolean isPeriodic = TheCurveTool::IsPeriodic444(aCurve); TheVector V1; ThePoint PP; Standard_Real s1 = 0.0 ; @@ -467,7 +467,7 @@ void Extrema_GExtPC::Perform(const ThePoint& P) // Verification de la validite des parametres: ThePOnC PC = myExtPElC.Point(i); U = PC.Parameter(); - if (TheCurveTool::IsPeriodic(aCurve)) + if (TheCurveTool::IsPeriodic444(aCurve)) { U = ElCLib::InPeriod(U, myuinf, myuinf+TheCurveTool::Period(aCurve)); } @@ -527,7 +527,7 @@ void Extrema_GExtPC::IntervalPerform(const ThePoint& P) // Verification de la validite des parametres pour le cas trimme: ThePOnC PC = myExtPC.Point(i); U = PC.Parameter(); - if (TheCurveTool::IsPeriodic(*((TheCurve*)myC))) + if (TheCurveTool::IsPeriodic444(*((TheCurve*)myC))) { U = ElCLib::InPeriod(U, myuinf, myuinf+TheCurveTool::Period(*((TheCurve*)myC))); } -- 2.39.5