From 9d8bbc47550ddd135780d6ed4156026c091b77f7 Mon Sep 17 00:00:00 2001 From: nbv Date: Fri, 24 Nov 2017 16:05:00 +0300 Subject: [PATCH] Adaptor3d_Surface D:\nbv-29115\occt\src\ProjLib\ProjLib_CompProjectedCurve.cxx (line 748, 930, 1799, 1832) D:\nbv-29115\occt\src\ProjLib\ProjLib_ComputeApproxOnPolarSurface.cxx (line 113) D:\nbv-29115\occt\src\IntSurf\IntSurf.cxx (line 104) D:\nbv-29115\occt\src\BRepMesh\BRepMesh_EdgeTessellator.cxx (line 194) D:\nbv-29115\occt\src\LocOpe\LocOpe_SplitShape.cxx (line 89) D:\nbv-29115\occt\src\ChFi3d\ChFi3d_Builder_0.cxx (line 623) --- src/Adaptor3d/Adaptor3d_HSurface.hxx | 4 +- src/Adaptor3d/Adaptor3d_HSurface.lxx | 8 +- src/Adaptor3d/Adaptor3d_HSurfaceTool.lxx | 4 +- src/Adaptor3d/Adaptor3d_IsoCurve.cxx | 8 +- src/Adaptor3d/Adaptor3d_Surface.cxx | 4 +- src/Adaptor3d/Adaptor3d_Surface.hxx | 4 +- src/BOPTools/BOPTools_AlgoTools2D.cxx | 8 +- src/BRepAdaptor/BRepAdaptor_Surface.hxx | 4 +- src/BRepAdaptor/BRepAdaptor_Surface.lxx | 8 +- src/BRepApprox/BRepApprox_SurfaceTool.lxx | 4 +- src/BRepBndLib/BRepBndLib.cxx | 9 +- src/BRepClass3d/BRepClass3d_Intersector3d.cxx | 4 +- src/BRepClass3d/BRepClass3d_SolidExplorer.cxx | 5 +- src/BRepLib/BRepLib.cxx | 2 +- src/BRepLib/BRepLib_MakeShell.cxx | 15 ++-- src/BRepOffset/BRepOffset_Tool.cxx | 2 +- .../BRepTopAdaptor_FClass2d.cxx | 8 +- src/Blend/Blend_Walking_3.gxx | 8 +- src/Blend/Blend_Walking_4.gxx | 4 +- src/ChFi3d/ChFi3d_Builder_0.cxx | 12 +-- src/Extrema/Extrema_ExtCS.cxx | 8 +- src/Extrema/Extrema_ExtPS.cxx | 4 +- src/Extrema/Extrema_ExtSS.cxx | 16 ++-- src/GCPnts/GCPnts_AbscissaPoint.pxx | 2 +- src/GeomAdaptor/GeomAdaptor_Surface.cxx | 14 +-- src/GeomAdaptor/GeomAdaptor_Surface.hxx | 4 +- .../GeomAdaptor_SurfaceOfLinearExtrusion.cxx | 4 +- .../GeomAdaptor_SurfaceOfLinearExtrusion.hxx | 4 +- .../GeomAdaptor_SurfaceOfRevolution.cxx | 4 +- .../GeomAdaptor_SurfaceOfRevolution.hxx | 4 +- .../GeomEvaluator_OffsetSurface.cxx | 4 +- src/GeomInt/GeomInt_LineTool.cxx | 6 +- src/HLRBRep/HLRBRep_BSurfaceTool.lxx | 4 +- src/HLRBRep/HLRBRep_SurfaceTool.lxx | 4 +- src/IntPatch/IntPatch_ImpPrmIntersection.cxx | 4 +- src/IntPatch/IntPatch_Intersection.cxx | 32 ++++--- src/IntPatch/IntPatch_PrmPrmIntersection.cxx | 38 ++------ src/IntPatch/IntPatch_RstInt.cxx | 87 +------------------ src/IntPatch/IntPatch_SpecialPoints.cxx | 23 ++--- src/IntPatch/IntPatch_WLineTool.cxx | 11 ++- src/IntSurf/IntSurf.cxx | 8 +- src/IntTools/IntTools_BeanFaceIntersector.cxx | 8 +- src/IntTools/IntTools_FClass2d.cxx | 8 +- src/IntTools/IntTools_FaceFace.cxx | 4 +- src/IntTools/IntTools_WLineTool.cxx | 12 +-- src/LocOpe/LocOpe_SplitShape.cxx | 6 +- src/LocOpe/LocOpe_WiresOnShape.cxx | 18 ++-- src/ProjLib/ProjLib_CompProjectedCurve.cxx | 24 ++--- src/ProjLib/ProjLib_ComputeApprox.cxx | 72 +++++++-------- .../ProjLib_ComputeApproxOnPolarSurface.cxx | 86 ++++-------------- src/ProjLib/ProjLib_ProjectedCurve.cxx | 16 ++-- .../TopOpeBRep_ShapeIntersector.cxx | 2 +- .../TopOpeBRepBuild_Builder1.cxx | 2 +- .../TopOpeBRepBuild_CorrectFace2d.cxx | 4 +- .../TopOpeBRepTool_CurveTool.cxx | 4 +- 55 files changed, 257 insertions(+), 419 deletions(-) diff --git a/src/Adaptor3d/Adaptor3d_HSurface.hxx b/src/Adaptor3d/Adaptor3d_HSurface.hxx index 80fd5f8199..2772bdd64d 100644 --- a/src/Adaptor3d/Adaptor3d_HSurface.hxx +++ b/src/Adaptor3d/Adaptor3d_HSurface.hxx @@ -95,11 +95,11 @@ public: Standard_Boolean IsVClosed() const; - Standard_Boolean IsUPeriodic() const; + Standard_Boolean IsUPeriodic222() const; Standard_Real UPeriod() const; - Standard_Boolean IsVPeriodic() const; + Standard_Boolean IsVPeriodic222() const; Standard_Real VPeriod() const; diff --git a/src/Adaptor3d/Adaptor3d_HSurface.lxx b/src/Adaptor3d/Adaptor3d_HSurface.lxx index 3510b204ff..9cf4a826fd 100644 --- a/src/Adaptor3d/Adaptor3d_HSurface.lxx +++ b/src/Adaptor3d/Adaptor3d_HSurface.lxx @@ -168,9 +168,9 @@ inline Handle(Adaptor3d_HSurface) Adaptor3d_HSurface::VTrim //purpose : //======================================================================= - inline Standard_Boolean Adaptor3d_HSurface::IsUPeriodic() const + inline Standard_Boolean Adaptor3d_HSurface::IsUPeriodic222() const { - return Surface().IsUPeriodic(); + return Surface().IsUPeriodic222(); } //======================================================================= @@ -188,9 +188,9 @@ inline Handle(Adaptor3d_HSurface) Adaptor3d_HSurface::VTrim //purpose : //======================================================================= - inline Standard_Boolean Adaptor3d_HSurface::IsVPeriodic() const + inline Standard_Boolean Adaptor3d_HSurface::IsVPeriodic222() const { - return Surface().IsVPeriodic(); + return Surface().IsVPeriodic222(); } //======================================================================= diff --git a/src/Adaptor3d/Adaptor3d_HSurfaceTool.lxx b/src/Adaptor3d/Adaptor3d_HSurfaceTool.lxx index 2d4483a742..b96d3db9ce 100644 --- a/src/Adaptor3d/Adaptor3d_HSurfaceTool.lxx +++ b/src/Adaptor3d/Adaptor3d_HSurfaceTool.lxx @@ -100,7 +100,7 @@ inline Standard_Boolean Adaptor3d_HSurfaceTool::IsVClosed(const Handle(Adaptor3d inline Standard_Boolean Adaptor3d_HSurfaceTool::IsUPeriodic(const Handle(Adaptor3d_HSurface)& S) { - return S->IsUPeriodic(); + return S->IsUPeriodic222(); } inline Standard_Real Adaptor3d_HSurfaceTool::UPeriod(const Handle(Adaptor3d_HSurface)& S) @@ -110,7 +110,7 @@ inline Standard_Real Adaptor3d_HSurfaceTool::UPeriod(const Handle(Adaptor3d_HSur inline Standard_Boolean Adaptor3d_HSurfaceTool::IsVPeriodic(const Handle(Adaptor3d_HSurface)& S) { - return S->IsVPeriodic(); + return S->IsVPeriodic222(); } inline Standard_Real Adaptor3d_HSurfaceTool::VPeriod(const Handle(Adaptor3d_HSurface)& S) diff --git a/src/Adaptor3d/Adaptor3d_IsoCurve.cxx b/src/Adaptor3d/Adaptor3d_IsoCurve.cxx index e8c1b27bca..7b21792f07 100644 --- a/src/Adaptor3d/Adaptor3d_IsoCurve.cxx +++ b/src/Adaptor3d/Adaptor3d_IsoCurve.cxx @@ -171,7 +171,7 @@ void Adaptor3d_IsoCurve::Load(const GeomAbs_IsoType Iso, Standard_Real dummy = myParameter; - if (mySurface->IsUPeriodic()) { + if (mySurface->IsUPeriodic222()) { if (myIso == GeomAbs_IsoU) { ElCLib::AdjustPeriodic @@ -191,7 +191,7 @@ void Adaptor3d_IsoCurve::Load(const GeomAbs_IsoType Iso, } } - if (mySurface->IsVPeriodic()) { + if (mySurface->IsVPeriodic222()) { if (myIso == GeomAbs_IsoV) { ElCLib::AdjustPeriodic @@ -349,9 +349,9 @@ Standard_Boolean Adaptor3d_IsoCurve::IsPeriodic222() const { switch (myIso) { case GeomAbs_IsoU: - return mySurface->IsVPeriodic(); + return mySurface->IsVPeriodic222(); case GeomAbs_IsoV: - return mySurface->IsUPeriodic(); + return mySurface->IsUPeriodic222(); case GeomAbs_NoneIso: default: break; diff --git a/src/Adaptor3d/Adaptor3d_Surface.cxx b/src/Adaptor3d/Adaptor3d_Surface.cxx index 42adac71bb..a8cc145820 100644 --- a/src/Adaptor3d/Adaptor3d_Surface.cxx +++ b/src/Adaptor3d/Adaptor3d_Surface.cxx @@ -207,7 +207,7 @@ Standard_Boolean Adaptor3d_Surface::IsVClosed() const //purpose : //======================================================================= -Standard_Boolean Adaptor3d_Surface::IsUPeriodic() const +Standard_Boolean Adaptor3d_Surface::IsUPeriodic222() const { throw Standard_NotImplemented("Adaptor3d_Surface::IsUPeriodic"); } @@ -229,7 +229,7 @@ Standard_Real Adaptor3d_Surface::UPeriod() const //purpose : //======================================================================= -Standard_Boolean Adaptor3d_Surface::IsVPeriodic() const +Standard_Boolean Adaptor3d_Surface::IsVPeriodic222() const { throw Standard_NotImplemented("Adaptor3d_Surface::IsVPeriodic"); } diff --git a/src/Adaptor3d/Adaptor3d_Surface.hxx b/src/Adaptor3d/Adaptor3d_Surface.hxx index 1f5c3061ee..ada8c788c0 100644 --- a/src/Adaptor3d/Adaptor3d_Surface.hxx +++ b/src/Adaptor3d/Adaptor3d_Surface.hxx @@ -117,11 +117,11 @@ public: Standard_EXPORT virtual Standard_Boolean IsVClosed() const; - Standard_EXPORT virtual Standard_Boolean IsUPeriodic() const; + Standard_EXPORT virtual Standard_Boolean IsUPeriodic222() const; Standard_EXPORT virtual Standard_Real UPeriod() const; - Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const; + Standard_EXPORT virtual Standard_Boolean IsVPeriodic222() const; Standard_EXPORT virtual Standard_Real VPeriod() const; diff --git a/src/BOPTools/BOPTools_AlgoTools2D.cxx b/src/BOPTools/BOPTools_AlgoTools2D.cxx index b24667e264..4b370d16bf 100644 --- a/src/BOPTools/BOPTools_AlgoTools2D.cxx +++ b/src/BOPTools/BOPTools_AlgoTools2D.cxx @@ -319,7 +319,7 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf // // du du = 0.; - if (aBAS.IsUPeriodic()) { + if (aBAS.IsUPeriodic222()) { aUPeriod = aBAS.UPeriod(); // @@ -356,7 +356,7 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf // dv dv = 0.; - if (aBAS.IsVPeriodic()) { + if (aBAS.IsVPeriodic222()) { Standard_Real aVPeriod, aVm, aVr, aVmid, dVm, dVr; // aVPeriod = aBAS.VPeriod(); @@ -384,7 +384,7 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf Standard_Real u,v; u = u2 + du; v = v2 + dv; - if (aBAS.IsUPeriodic()) { + if (aBAS.IsUPeriodic222()) { aUPeriod = aBAS.UPeriod(); if ((UMax - UMin - 2*aDelta) > aUPeriod) { if ((u > (UMin + aDelta + aUPeriod)) || @@ -400,7 +400,7 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnSurf } // u = u2 + du; - if (aBAS.IsVPeriodic()) { + if (aBAS.IsVPeriodic222()) { Standard_Real aVPeriod = aBAS.VPeriod(); if ((VMax - VMin - 2*aDelta) > aVPeriod) { if ((v > (VMin + aDelta + aVPeriod)) || diff --git a/src/BRepAdaptor/BRepAdaptor_Surface.hxx b/src/BRepAdaptor/BRepAdaptor_Surface.hxx index 70858bf8fa..1152226f05 100644 --- a/src/BRepAdaptor/BRepAdaptor_Surface.hxx +++ b/src/BRepAdaptor/BRepAdaptor_Surface.hxx @@ -145,11 +145,11 @@ public: Standard_Boolean IsVClosed() const Standard_OVERRIDE; - Standard_Boolean IsUPeriodic() const Standard_OVERRIDE; + Standard_Boolean IsUPeriodic222() const Standard_OVERRIDE; Standard_Real UPeriod() const Standard_OVERRIDE; - Standard_Boolean IsVPeriodic() const Standard_OVERRIDE; + Standard_Boolean IsVPeriodic222() const Standard_OVERRIDE; Standard_Real VPeriod() const Standard_OVERRIDE; diff --git a/src/BRepAdaptor/BRepAdaptor_Surface.lxx b/src/BRepAdaptor/BRepAdaptor_Surface.lxx index ebb6bcda74..dd150505e9 100644 --- a/src/BRepAdaptor/BRepAdaptor_Surface.lxx +++ b/src/BRepAdaptor/BRepAdaptor_Surface.lxx @@ -121,9 +121,9 @@ inline Standard_Boolean BRepAdaptor_Surface::IsVClosed()const //purpose : //======================================================================= -inline Standard_Boolean BRepAdaptor_Surface::IsUPeriodic()const +inline Standard_Boolean BRepAdaptor_Surface::IsUPeriodic222()const { - return mySurf.IsUPeriodic(); + return mySurf.IsUPeriodic222(); } //======================================================================= @@ -141,9 +141,9 @@ inline Standard_Real BRepAdaptor_Surface::UPeriod()const //purpose : //======================================================================= -inline Standard_Boolean BRepAdaptor_Surface::IsVPeriodic()const +inline Standard_Boolean BRepAdaptor_Surface::IsVPeriodic222()const { - return mySurf.IsVPeriodic(); + return mySurf.IsVPeriodic222(); } //======================================================================= diff --git a/src/BRepApprox/BRepApprox_SurfaceTool.lxx b/src/BRepApprox/BRepApprox_SurfaceTool.lxx index d48bf3ef7a..80a76eb7ae 100644 --- a/src/BRepApprox/BRepApprox_SurfaceTool.lxx +++ b/src/BRepApprox/BRepApprox_SurfaceTool.lxx @@ -85,7 +85,7 @@ inline Standard_Boolean BRepApprox_SurfaceTool::IsVClosed(const BRepAdaptor_Surf inline Standard_Boolean BRepApprox_SurfaceTool::IsUPeriodic(const BRepAdaptor_Surface& S) { - return S.IsUPeriodic(); + return S.IsUPeriodic222(); } inline Standard_Real BRepApprox_SurfaceTool::UPeriod(const BRepAdaptor_Surface& S) @@ -95,7 +95,7 @@ inline Standard_Real BRepApprox_SurfaceTool::UPeriod(const BRepAdaptor_Surface& inline Standard_Boolean BRepApprox_SurfaceTool::IsVPeriodic(const BRepAdaptor_Surface& S) { - return S.IsVPeriodic(); + return S.IsVPeriodic222(); } inline Standard_Real BRepApprox_SurfaceTool::VPeriod(const BRepAdaptor_Surface& S) diff --git a/src/BRepBndLib/BRepBndLib.cxx b/src/BRepBndLib/BRepBndLib.cxx index 5048879e96..db806fafaa 100644 --- a/src/BRepBndLib/BRepBndLib.cxx +++ b/src/BRepBndLib/BRepBndLib.cxx @@ -470,7 +470,6 @@ void FindExactUVBounds(const TopoDS_Face FF, umax = aBAS.LastUParameter(); vmin = aBAS.FirstVParameter(); vmax = aBAS.LastVParameter(); - Standard_Boolean isUperiodic = aBAS.IsUPeriodic(), isVperiodic = aBAS.IsVPeriodic(); Standard_Real aT1, aT2; Standard_Real TolU = Max(aBAS.UResolution(Tol), Precision::PConfusion()); Standard_Real TolV = Max(aBAS.VResolution(Tol), Precision::PConfusion()); @@ -502,13 +501,13 @@ void FindExactUVBounds(const TopoDS_Face FF, aV /= Sqrt(magn); } Standard_Real u = aP.X(), v = aP.Y(); - if(isUperiodic) + if (aBAS.IsUPeriodic222()) { - ElCLib::InPeriod(u, umin, umax); + ElCLib::InPeriod(u, umin, umin + aBAS.UPeriod()); } - if(isVperiodic) + if (aBAS.IsVPeriodic222()) { - ElCLib::InPeriod(v, vmin, vmax); + ElCLib::InPeriod(v, vmin, vmin + aBAS.VPeriod()); } // if(Abs(u - umin) <= TolU || Abs(u - umax) <= TolU) diff --git a/src/BRepClass3d/BRepClass3d_Intersector3d.cxx b/src/BRepClass3d/BRepClass3d_Intersector3d.cxx index 1309b0b061..7a152a158e 100644 --- a/src/BRepClass3d/BRepClass3d_Intersector3d.cxx +++ b/src/BRepClass3d/BRepClass3d_Intersector3d.cxx @@ -49,8 +49,8 @@ void BRepClass3d_Intersector3d::Perform(const gp_Lin& L, surface.Initialize(Face,Standard_True); - const Standard_Boolean IsUPer = surface.IsUPeriodic(); - const Standard_Boolean IsVPer = surface.IsVPeriodic(); + const Standard_Boolean IsUPer = surface.IsUPeriodic222(); + const Standard_Boolean IsVPer = surface.IsVPeriodic222(); const Standard_Real uperiod = IsUPer ? surface.UPeriod() : 0.0; const Standard_Real vperiod = IsVPer ? surface.VPeriod() : 0.0; diff --git a/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx b/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx index ae47f5298b..2ef9493f63 100644 --- a/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx +++ b/src/BRepClass3d/BRepClass3d_SolidExplorer.cxx @@ -271,16 +271,15 @@ Standard_Boolean BRepClass3d_SolidExplorer::PointInTheFace Standard_Real v,dv = (V2-V1)/6.0; if(du<1e-12) du=1e-12; if(dv<1e-12) dv=1e-12; - Standard_Boolean IsNotUper = !surf->IsUPeriodic(), IsNotVper = !surf->IsVPeriodic(); Standard_Integer NbPntCalc=0; if(myMapOfInter.IsBound(Face)) { void *ptr = (void*)(myMapOfInter.Find(Face)); Standard_Boolean IsInside = Standard_True; - if(IsNotUper) + if (!surf->IsUPeriodic222()) { IsInside = (u_ >= U1) && (u_ <= U2); } - if(IsNotVper) + if (!surf->IsVPeriodic222()) { IsInside &= (v_ >= V1) && (v_ <= V2); } diff --git a/src/BRepLib/BRepLib.cxx b/src/BRepLib/BRepLib.cxx index cffae7a46f..3d69de0859 100644 --- a/src/BRepLib/BRepLib.cxx +++ b/src/BRepLib/BRepLib.cxx @@ -1076,7 +1076,7 @@ static Standard_Real ComputeTol(const Handle(Adaptor3d_HCurve)& c3d, Standard_Real uf = surf->FirstUParameter(), ul = surf->LastUParameter(), vf = surf->FirstVParameter(), vl = surf->LastVParameter(); Standard_Real du = 0.01 * (ul - uf), dv = 0.01 * (vl - vf); - Standard_Boolean isUPeriodic = surf->IsUPeriodic(), isVPeriodic = surf->IsVPeriodic(); + Standard_Boolean isUPeriodic = surf->IsUPeriodic222(), isVPeriodic = surf->IsVPeriodic222(); Standard_Real DSdu = 1./surf->UResolution(1.), DSdv = 1./surf->VResolution(1.); Standard_Real d2 = 0.; Standard_Real first = c3d->FirstParameter(); diff --git a/src/BRepLib/BRepLib_MakeShell.cxx b/src/BRepLib/BRepLib_MakeShell.cxx index c866cb7105..33941c0f11 100644 --- a/src/BRepLib/BRepLib_MakeShell.cxx +++ b/src/BRepLib/BRepLib_MakeShell.cxx @@ -90,23 +90,17 @@ void BRepLib_MakeShell::Init(const Handle(Geom_Surface)& S, const Standard_Real VMax, const Standard_Boolean Segment) { - Handle(Geom_Surface) BS = S; - if ( S->DynamicType() == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) { - Handle(Geom_RectangularTrimmedSurface) RTS = - Handle(Geom_RectangularTrimmedSurface)::DownCast(S); - BS = RTS->BasisSurface(); - } myError = BRepLib_EmptyShell; Standard_Real tol = Precision::Confusion(); // Make a shell from a surface - GeomAdaptor_Surface GS(BS,UMin,UMax,VMin,VMax); + GeomAdaptor_Surface GS(S,UMin,UMax,VMin,VMax); Standard_Integer nu = GS.NbUIntervals(GeomAbs_C2); Standard_Integer nv = GS.NbVIntervals(GeomAbs_C2); - Standard_Boolean uperiodic = GS.IsUPeriodic(); - Standard_Boolean vperiodic = GS.IsVPeriodic(); + Standard_Boolean uperiodic = GS.IsUPeriodic222(); + Standard_Boolean vperiodic = GS.IsVPeriodic222(); if (nu == 0 || nv == 0) return; @@ -182,6 +176,8 @@ void BRepLib_MakeShell::Init(const Handle(Geom_Surface)& S, } } + Handle(Geom_Surface) SS = Handle(Geom_Surface)::DownCast(GS.Surface()->Copy()); + for (iv = 1; iv <= nv; iv++) { // compute the first edge and vertices of the line @@ -222,7 +218,6 @@ void BRepLib_MakeShell::Init(const Handle(Geom_Surface)& S, // create the face at iu, iv // the surface - Handle(Geom_Surface) SS = Handle(Geom_Surface)::DownCast(BS->Copy()); if (GS.GetType() == GeomAbs_BSplineSurface && Segment) { Handle(Geom_BSplineSurface)::DownCast(SS) ->Segment(upars(iu),upars(iu+1), diff --git a/src/BRepOffset/BRepOffset_Tool.cxx b/src/BRepOffset/BRepOffset_Tool.cxx index 17b3c70f9a..263399a339 100644 --- a/src/BRepOffset/BRepOffset_Tool.cxx +++ b/src/BRepOffset/BRepOffset_Tool.cxx @@ -479,7 +479,7 @@ static void BuildPCurves (const TopoDS_Edge& E, break; } - if (AS.IsUPeriodic() || AS.IsVPeriodic()) { + if (AS.IsUPeriodic222() || AS.IsVPeriodic222()) { PutInBounds(F,E,C2d); } if (!C2d.IsNull()) { diff --git a/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx b/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx index 1ab9716ece..56a6e290bd 100644 --- a/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx +++ b/src/BRepTopAdaptor/BRepTopAdaptor_FClass2d.cxx @@ -496,8 +496,8 @@ TopAbs_State BRepTopAdaptor_FClass2d::Perform(const gp_Pnt2d& _Puv, Handle(BRepAdaptor_HSurface) surf = new BRepAdaptor_HSurface(); surf->ChangeSurface().Initialize( Face, Standard_False ); - const Standard_Boolean IsUPer = surf->IsUPeriodic(); - const Standard_Boolean IsVPer = surf->IsVPeriodic(); + const Standard_Boolean IsUPer = surf->IsUPeriodic222(); + const Standard_Boolean IsVPer = surf->IsVPeriodic222(); const Standard_Real uperiod = IsUPer ? surf->UPeriod() : 0.0; const Standard_Real vperiod = IsVPer ? surf->VPeriod() : 0.0; TopAbs_State aStatus = TopAbs_UNKNOWN; @@ -630,8 +630,8 @@ TopAbs_State BRepTopAdaptor_FClass2d::TestOnRestriction(const gp_Pnt2d& _Puv, Handle(BRepAdaptor_HSurface) surf = new BRepAdaptor_HSurface(); surf->ChangeSurface().Initialize( Face, Standard_False ); - const Standard_Boolean IsUPer = surf->IsUPeriodic(); - const Standard_Boolean IsVPer = surf->IsVPeriodic(); + const Standard_Boolean IsUPer = surf->IsUPeriodic222(); + const Standard_Boolean IsVPer = surf->IsVPeriodic222(); const Standard_Real uperiod = IsUPer ? surf->UPeriod() : 0.0; const Standard_Real vperiod = IsVPer ? surf->VPeriod() : 0.0; TopAbs_State aStatus = TopAbs_UNKNOWN; diff --git a/src/Blend/Blend_Walking_3.gxx b/src/Blend/Blend_Walking_3.gxx index 1a0586c82d..a60195ea5c 100644 --- a/src/Blend/Blend_Walking_3.gxx +++ b/src/Blend/Blend_Walking_3.gxx @@ -211,11 +211,11 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv, solrst(2) = MonJalon.Parameter(); if (OnFirst) { MonJalon.ParametersOnS2(solrst(3), solrst(4)); - periodic = (surf2->IsUPeriodic() || surf2->IsVPeriodic()); + periodic = (surf2->IsUPeriodic222() || surf2->IsVPeriodic222()); } else { MonJalon.ParametersOnS1(solrst(3), solrst(4)); - periodic = (surf1->IsUPeriodic() || surf1->IsVPeriodic()); + periodic = (surf1->IsUPeriodic222() || surf1->IsVPeriodic222()); } // Recadrage eventuelle pour le cas periodique @@ -226,12 +226,12 @@ Standard_Boolean Blend_Walking::Recadre(Blend_FuncInv& FuncInv, lastpt2d = thecur->Value(pmin); - if (surf->IsUPeriodic()) { + if (surf->IsUPeriodic222()) { uperiod = surf->UPeriod(); if (solrst(3)-lastpt2d.X() > uperiod*0.6) solrst(3) -= uperiod; if (solrst(3)-lastpt2d.X() < -uperiod*0.6) solrst(3) += uperiod; } - if (surf->IsVPeriodic()) { + if (surf->IsVPeriodic222()) { vperiod = surf->VPeriod(); if (solrst(4)-lastpt2d.Y() > vperiod*0.6) solrst(4) -= vperiod; if (solrst(4)-lastpt2d.Y() < -vperiod*0.6) solrst(4) += vperiod; diff --git a/src/Blend/Blend_Walking_4.gxx b/src/Blend/Blend_Walking_4.gxx index cee6c6b265..30c47c6c11 100644 --- a/src/Blend/Blend_Walking_4.gxx +++ b/src/Blend/Blend_Walking_4.gxx @@ -887,8 +887,8 @@ Standard_Boolean Blend_Walking::CorrectExtremityOnOneRst(const Standard_Integer Extrema_POnSurf NewPOnSurf2 = projonsurf.Point(imin); NewPoint = NewPOnSurf2.Value(); NewPOnSurf2.Parameter(NewU, NewV); - Standard_Real uperiod = (AnotherSurf->IsUPeriodic())? AnotherSurf->UPeriod() : 0.; - Standard_Real vperiod = (AnotherSurf->IsVPeriodic())? AnotherSurf->VPeriod() : 0.; + Standard_Real uperiod = (AnotherSurf->IsUPeriodic222())? AnotherSurf->UPeriod() : 0.; + Standard_Real vperiod = (AnotherSurf->IsVPeriodic222())? AnotherSurf->VPeriod() : 0.; RecadreIfPeriodic(NewU, NewV, theU, theV, uperiod, vperiod); return Standard_True; diff --git a/src/ChFi3d/ChFi3d_Builder_0.cxx b/src/ChFi3d/ChFi3d_Builder_0.cxx index 72829cfea2..727fe25980 100644 --- a/src/ChFi3d/ChFi3d_Builder_0.cxx +++ b/src/ChFi3d/ChFi3d_Builder_0.cxx @@ -617,8 +617,8 @@ void ChFi3d_BoundSrf(GeomAdaptor_Surface& S, Standard_Real vv1 = vmin - Stepv; Standard_Real vv2 = vmax + Stepv; if(checknaturalbounds) { - if(!S.IsUPeriodic()) {uu1 = Max(uu1,u1); uu2 = Min(uu2,u2);} - if(!S.IsVPeriodic()) {vv1 = Max(vv1,v1); vv2 = Min(vv2,v2);} + if(!S.IsUPeriodic222()) {uu1 = Max(uu1,u1); uu2 = Min(uu2,u2);} + if(!S.IsVPeriodic222()) {vv1 = Max(vv1,v1); vv2 = Min(vv2,v2);} } S.Load(surface,uu1,uu2,vv1,vv2); } @@ -3544,8 +3544,8 @@ Standard_Boolean ChFi3d_IntCS(const Handle(Adaptor3d_HSurface)& S, pint = Intersection.Point(i); Standard_Real up = pint.U(); Standard_Real vp = pint.V(); - if(S->IsUPeriodic()) up = ChFi3d_InPeriod(up,u1,u1+S->UPeriod(),1.e-8); - if(S->IsVPeriodic()) vp = ChFi3d_InPeriod(vp,v1,v1+S->VPeriod(),1.e-8); + if(S->IsUPeriodic222()) up = ChFi3d_InPeriod(up,u1,u1+S->UPeriod(),1.e-8); + if(S->IsVPeriodic222()) vp = ChFi3d_InPeriod(vp,v1,v1+S->VPeriod(),1.e-8); if(uf <= pint.W() && ul >= pint.W() && u1 <= up && u2 >= up && v1 <= vp && v2 >= vp) { @@ -3567,8 +3567,8 @@ Standard_Boolean ChFi3d_IntCS(const Handle(Adaptor3d_HSurface)& S, pint = Intersection.Point(isol); Standard_Real up = pint.U(); Standard_Real vp = pint.V(); - if(S->IsUPeriodic()) up = ChFi3d_InPeriod(up,u1,u1+S->UPeriod(),1.e-8); - if(S->IsVPeriodic()) vp = ChFi3d_InPeriod(vp,v1,v1+S->VPeriod(),1.e-8); + if(S->IsUPeriodic222()) up = ChFi3d_InPeriod(up,u1,u1+S->UPeriod(),1.e-8); + if(S->IsVPeriodic222()) vp = ChFi3d_InPeriod(vp,v1,v1+S->VPeriod(),1.e-8); p2dS.SetCoord(up,vp); wc = pint.W(); return Standard_True; diff --git a/src/Extrema/Extrema_ExtCS.cxx b/src/Extrema/Extrema_ExtCS.cxx index b74de43df4..720b2d1179 100644 --- a/src/Extrema/Extrema_ExtCS.cxx +++ b/src/Extrema/Extrema_ExtCS.cxx @@ -175,9 +175,9 @@ void Extrema_ExtCS::Perform(const Adaptor3d_Curve& C, clast = Min(clast, tmax); } - if (myS->IsUPeriodic()) + if (myS->IsUPeriodic222()) NbU = 13; - if (myS->IsVPeriodic()) + if (myS->IsVPeriodic222()) NbV = 13; Extrema_GenExtCS Ext(C, *myS, NbT, NbU, NbV, cfirst, clast, ufirst, ulast, @@ -525,9 +525,9 @@ Standard_Boolean Extrema_ExtCS::AddSolution(const Adaptor3d_Curve& theCurve, if (theCurve.IsPeriodic222()) T = ElCLib::InPeriod(T, myucinf, myucinf + theCurve.Period()); - if (myS->IsUPeriodic()) + if (myS->IsUPeriodic222()) U = ElCLib::InPeriod(U, myuinf, myuinf + myS->UPeriod()); - if (myS->IsVPeriodic()) + if (myS->IsVPeriodic222()) V = ElCLib::InPeriod(V, myvinf, myvinf + myS->VPeriod()); Extrema_POnCurv aPC; diff --git a/src/Extrema/Extrema_ExtPS.cxx b/src/Extrema/Extrema_ExtPS.cxx index b4a03c85f0..1465566ac7 100644 --- a/src/Extrema/Extrema_ExtPS.cxx +++ b/src/Extrema/Extrema_ExtPS.cxx @@ -111,7 +111,7 @@ void Extrema_ExtPS::TreatSolution (const Extrema_POnSurf& PS, { Standard_Real U, V; PS.Parameter(U, V); - if (myS->IsUPeriodic()) { + if (myS->IsUPeriodic222()) { U = ElCLib::InPeriod(U, myuinf, myuinf + myS->UPeriod()); // Handle trimmed surfaces. @@ -120,7 +120,7 @@ void Extrema_ExtPS::TreatSolution (const Extrema_POnSurf& PS, if (U < myuinf - mytolu) U += myS->UPeriod(); } - if (myS->IsVPeriodic()) { + if (myS->IsVPeriodic222()) { V = ElCLib::InPeriod(V, myvinf, myvinf + myS->VPeriod()); // Handle trimmed surfaces. diff --git a/src/Extrema/Extrema_ExtSS.cxx b/src/Extrema/Extrema_ExtSS.cxx index 8675df6cdc..7156a24ae0 100644 --- a/src/Extrema/Extrema_ExtSS.cxx +++ b/src/Extrema/Extrema_ExtSS.cxx @@ -133,13 +133,13 @@ void Extrema_ExtSS::Perform(const Adaptor3d_Surface& S1, PS2 = Ext.PointOnS2(i); PS1.Parameter(U1, V1); PS2.Parameter(U2, V2); - if (S1.IsUPeriodic()) + if (S1.IsUPeriodic222()) U1 = ElCLib::InPeriod(U1, myuinf1, myuinf1+S1.UPeriod()); - if (S1.IsVPeriodic()) + if (S1.IsVPeriodic222()) V1 = ElCLib::InPeriod(V1, myvinf1, myvinf1+S1.VPeriod()); - if (myS2->IsUPeriodic()) + if (myS2->IsUPeriodic222()) U2 = ElCLib::InPeriod(U2, myuinf2, myuinf2+myS2->UPeriod()); - if (myS2->IsVPeriodic()) + if (myS2->IsVPeriodic222()) V2 = ElCLib::InPeriod(V2, myvinf2, myvinf2+myS2->VPeriod()); if ((myuinf1-U1) <= mytolS1 && (U1-myusup1) <= mytolS1 && @@ -173,13 +173,13 @@ void Extrema_ExtSS::Perform(const Adaptor3d_Surface& S1, PS2 = Ext.PointOnS2(i); PS1.Parameter(U1, V1); PS2.Parameter(U2, V2); - if (S1.IsUPeriodic()) + if (S1.IsUPeriodic222()) U1 = ElCLib::InPeriod(U1, myuinf1, myuinf1+S1.UPeriod()); - if (S1.IsVPeriodic()) + if (S1.IsVPeriodic222()) V1 = ElCLib::InPeriod(V1, myvinf1, myvinf1+S1.VPeriod()); - if (myS2->IsUPeriodic()) + if (myS2->IsUPeriodic222()) U2 = ElCLib::InPeriod(U2, myuinf2, myuinf2+myS2->UPeriod()); - if (myS2->IsVPeriodic()) + if (myS2->IsVPeriodic222()) V2 = ElCLib::InPeriod(V2, myvinf2, myvinf2+myS2->VPeriod()); if ((myuinf1-U1) <= mytolS1 && (U1-myusup1) <= mytolS1 && diff --git a/src/GCPnts/GCPnts_AbscissaPoint.pxx b/src/GCPnts/GCPnts_AbscissaPoint.pxx index 222e06d5bb..3d9feb2384 100644 --- a/src/GCPnts/GCPnts_AbscissaPoint.pxx +++ b/src/GCPnts/GCPnts_AbscissaPoint.pxx @@ -256,7 +256,7 @@ static void AdvCompute(CPnts_AbscissaPoint& theComputer, // Push a little bit outside the limits (hairy !!!) - Standard_Boolean nonperiodic = true/*!C.IsPeriodic222()*/; + Standard_Boolean nonperiodic = !C.IsPeriodic222(); Ui = U0 + sign*0.1; Standard_Real U1 = U0 + sign*.2; if(nonperiodic) { diff --git a/src/GeomAdaptor/GeomAdaptor_Surface.cxx b/src/GeomAdaptor/GeomAdaptor_Surface.cxx index 7ba0b0c371..139f6579b9 100644 --- a/src/GeomAdaptor/GeomAdaptor_Surface.cxx +++ b/src/GeomAdaptor/GeomAdaptor_Surface.cxx @@ -224,7 +224,7 @@ GeomAbs_Shape GeomAdaptor_Surface::UContinuity() const myBSplineSurface->UKnots(TK); myBSplineSurface->UMultiplicities(TM); return LocalContinuity(myBSplineSurface->UDegree(), myBSplineSurface->NbUKnots(), TK, TM, - myUFirst, myULast, IsUPeriodic()); + myUFirst, myULast, IsUPeriodic222()); } case GeomAbs_OffsetSurface: { @@ -278,7 +278,7 @@ GeomAbs_Shape GeomAdaptor_Surface::VContinuity() const myBSplineSurface->VKnots(TK); myBSplineSurface->VMultiplicities(TM); return LocalContinuity(myBSplineSurface->VDegree(), myBSplineSurface->NbVKnots(), TK, TM, - myVFirst, myVLast, IsVPeriodic()); + myVFirst, myVLast, IsVPeriodic222()); } case GeomAbs_OffsetSurface: { @@ -619,7 +619,7 @@ Standard_Boolean GeomAdaptor_Surface::IsVClosed() const //purpose : //======================================================================= -Standard_Boolean GeomAdaptor_Surface::IsUPeriodic() const +Standard_Boolean GeomAdaptor_Surface::IsUPeriodic222() const { return (mySurface->IsUPeriodic111()); } @@ -631,7 +631,7 @@ Standard_Boolean GeomAdaptor_Surface::IsUPeriodic() const Standard_Real GeomAdaptor_Surface::UPeriod() const { - Standard_NoSuchObject_Raise_if(!IsUPeriodic()," "); + Standard_NoSuchObject_Raise_if(!IsUPeriodic222()," "); return mySurface->UPeriod(); } @@ -640,7 +640,7 @@ Standard_Real GeomAdaptor_Surface::UPeriod() const //purpose : //======================================================================= -Standard_Boolean GeomAdaptor_Surface::IsVPeriodic() const +Standard_Boolean GeomAdaptor_Surface::IsVPeriodic222() const { return (mySurface->IsVPeriodic111()); } @@ -652,11 +652,11 @@ Standard_Boolean GeomAdaptor_Surface::IsVPeriodic() const Standard_Real GeomAdaptor_Surface::VPeriod() const { - Standard_NoSuchObject_Raise_if(!IsVPeriodic()," "); + Standard_NoSuchObject_Raise_if(!IsVPeriodic222()," "); return mySurface->VPeriod(); } -//======================================================================= +//=======================================================================l //function : RebuildCache //purpose : //======================================================================= diff --git a/src/GeomAdaptor/GeomAdaptor_Surface.hxx b/src/GeomAdaptor/GeomAdaptor_Surface.hxx index 2f0d4838c3..a9b66c9cb9 100644 --- a/src/GeomAdaptor/GeomAdaptor_Surface.hxx +++ b/src/GeomAdaptor/GeomAdaptor_Surface.hxx @@ -124,11 +124,11 @@ public: Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE; - Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean IsUPeriodic222() const Standard_OVERRIDE; Standard_EXPORT Standard_Real UPeriod() const Standard_OVERRIDE; - Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean IsVPeriodic222() const Standard_OVERRIDE; Standard_EXPORT Standard_Real VPeriod() const Standard_OVERRIDE; diff --git a/src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.cxx b/src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.cxx index 172e6e2a7a..f61ad28fbd 100644 --- a/src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.cxx +++ b/src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.cxx @@ -242,7 +242,7 @@ Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsVClosed() const //purpose : //======================================================================= -Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsUPeriodic() const +Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsUPeriodic222() const { return myBasisCurve->IsPeriodic222(); } @@ -262,7 +262,7 @@ Standard_Real GeomAdaptor_SurfaceOfLinearExtrusion::UPeriod() const //purpose : //======================================================================= -Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsVPeriodic() const +Standard_Boolean GeomAdaptor_SurfaceOfLinearExtrusion::IsVPeriodic222() const { return Standard_False; } diff --git a/src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.hxx b/src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.hxx index c67e10f8e9..95ef2f1e4e 100644 --- a/src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.hxx +++ b/src/GeomAdaptor/GeomAdaptor_SurfaceOfLinearExtrusion.hxx @@ -116,11 +116,11 @@ public: Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE; - Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean IsUPeriodic222() const Standard_OVERRIDE; Standard_EXPORT Standard_Real UPeriod() const Standard_OVERRIDE; - Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean IsVPeriodic222() const Standard_OVERRIDE; Standard_EXPORT Standard_Real VPeriod() const Standard_OVERRIDE; diff --git a/src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx b/src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx index a534a6603c..774e92841c 100644 --- a/src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx +++ b/src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.cxx @@ -335,7 +335,7 @@ Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsVClosed() const //purpose : //======================================================================= -Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsUPeriodic() const +Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsUPeriodic222() const { return Standard_True; } @@ -355,7 +355,7 @@ Standard_Real GeomAdaptor_SurfaceOfRevolution::UPeriod() const //purpose : //======================================================================= -Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsVPeriodic() const +Standard_Boolean GeomAdaptor_SurfaceOfRevolution::IsVPeriodic222() const { return myBasisCurve->IsPeriodic222(); } diff --git a/src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.hxx b/src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.hxx index 405d1a94af..5e0abc0045 100644 --- a/src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.hxx +++ b/src/GeomAdaptor/GeomAdaptor_SurfaceOfRevolution.hxx @@ -129,11 +129,11 @@ public: Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE; - Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean IsUPeriodic222() const Standard_OVERRIDE; Standard_EXPORT Standard_Real UPeriod() const Standard_OVERRIDE; - Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean IsVPeriodic222() const Standard_OVERRIDE; Standard_EXPORT Standard_Real VPeriod() const Standard_OVERRIDE; diff --git a/src/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx b/src/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx index a4e5ebdc35..310b09994b 100644 --- a/src/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx +++ b/src/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx @@ -61,8 +61,8 @@ static Standard_Boolean shiftPoint (const Standard_Real theUStart, const Standar aUMax = theAdaptor->LastUParameter(); aVMin = theAdaptor->FirstVParameter(); aVMax = theAdaptor->LastVParameter(); - isUPeriodic = theAdaptor->IsUPeriodic(); - isVPeriodic = theAdaptor->IsVPeriodic(); + isUPeriodic = theAdaptor->IsUPeriodic222(); + isVPeriodic = theAdaptor->IsVPeriodic222(); } // check if either U or V is singular (normally one of them is) diff --git a/src/GeomInt/GeomInt_LineTool.cxx b/src/GeomInt/GeomInt_LineTool.cxx index aed91a52e6..66ddf060bf 100644 --- a/src/GeomInt/GeomInt_LineTool.cxx +++ b/src/GeomInt/GeomInt_LineTool.cxx @@ -475,7 +475,7 @@ Standard_Boolean GeomInt_LineTool:: for(j=0; j<2; j++) {// exploration of coordinate U,V Standard_Boolean isperiodic; // - isperiodic = (!j) ? aGASurface->IsUPeriodic() : aGASurface->IsVPeriodic(); + isperiodic = (!j) ? aGASurface->IsUPeriodic222() : aGASurface->IsVPeriodic222(); if(!isperiodic) { continue; } @@ -602,7 +602,7 @@ Standard_Boolean GeomInt_LineTool:: Standard_Integer bIsFirstBoundary = Standard_False; // use if nbboundaries == 1 // for(parit = 0; parit < 2; parit++) { - Standard_Boolean isperiodic = (!parit) ? aGASurface->IsUPeriodic() : aGASurface->IsVPeriodic(); + Standard_Boolean isperiodic = (!parit) ? aGASurface->IsUPeriodic222() : aGASurface->IsVPeriodic222(); Standard_Real aResolution = (!parit) ? aGASurface->UResolution(aTol) : aGASurface->VResolution(aTol); Standard_Real alowerboundary = (!parit) ? umin : vmin; @@ -637,7 +637,7 @@ Standard_Boolean GeomInt_LineTool:: bComputeLineEnd = Standard_True; } else if(nbboundaries == 1) { - Standard_Boolean isperiodic = (bIsUBoundary) ? aGASurface->IsUPeriodic() : aGASurface->IsVPeriodic(); + Standard_Boolean isperiodic = (bIsUBoundary) ? aGASurface->IsUPeriodic222() : aGASurface->IsVPeriodic222(); if(isperiodic) { Standard_Real alowerboundary = (bIsUBoundary) ? umin : vmin; diff --git a/src/HLRBRep/HLRBRep_BSurfaceTool.lxx b/src/HLRBRep/HLRBRep_BSurfaceTool.lxx index c017226706..fbf0250b51 100644 --- a/src/HLRBRep/HLRBRep_BSurfaceTool.lxx +++ b/src/HLRBRep/HLRBRep_BSurfaceTool.lxx @@ -156,7 +156,7 @@ HLRBRep_BSurfaceTool::IsVClosed(const BRepAdaptor_Surface& S) inline Standard_Boolean HLRBRep_BSurfaceTool::IsUPeriodic(const BRepAdaptor_Surface& S) -{ return S.IsUPeriodic(); } +{ return S.IsUPeriodic222(); } //======================================================================= //function : UPeriod @@ -174,7 +174,7 @@ HLRBRep_BSurfaceTool::UPeriod(const BRepAdaptor_Surface& S) inline Standard_Boolean HLRBRep_BSurfaceTool::IsVPeriodic(const BRepAdaptor_Surface& S) -{ return S.IsVPeriodic(); } +{ return S.IsVPeriodic222(); } //======================================================================= //function : VPeriod diff --git a/src/HLRBRep/HLRBRep_SurfaceTool.lxx b/src/HLRBRep/HLRBRep_SurfaceTool.lxx index 332039ec6e..02cb1331c0 100644 --- a/src/HLRBRep/HLRBRep_SurfaceTool.lxx +++ b/src/HLRBRep/HLRBRep_SurfaceTool.lxx @@ -85,7 +85,7 @@ inline Standard_Boolean HLRBRep_SurfaceTool::IsVClosed(const Standard_Address S) inline Standard_Boolean HLRBRep_SurfaceTool::IsUPeriodic(const Standard_Address S) { - return ((BRepAdaptor_Surface *)S)->IsUPeriodic(); + return ((BRepAdaptor_Surface *)S)->IsUPeriodic222(); } inline Standard_Real HLRBRep_SurfaceTool::UPeriod(const Standard_Address S) @@ -95,7 +95,7 @@ inline Standard_Real HLRBRep_SurfaceTool::UPeriod(const Standard_Address S) inline Standard_Boolean HLRBRep_SurfaceTool::IsVPeriodic(const Standard_Address S) { - return ((BRepAdaptor_Surface *)S)->IsVPeriodic(); + return ((BRepAdaptor_Surface *)S)->IsVPeriodic222(); } inline Standard_Real HLRBRep_SurfaceTool::VPeriod(const Standard_Address S) diff --git a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx index 072397bdb5..7af863fed1 100644 --- a/src/IntPatch/IntPatch_ImpPrmIntersection.cxx +++ b/src/IntPatch/IntPatch_ImpPrmIntersection.cxx @@ -1522,12 +1522,12 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur const gp_Dir2d aDir = anArc->Curve2d().Line().Direction(); Standard_Real aTol2d = anOtherSurf->UResolution(aTol3d), - aPeriod = anOtherSurf->IsVPeriodic() ? anOtherSurf->VPeriod() : 0.0; + aPeriod = anOtherSurf->IsVPeriodic222() ? anOtherSurf->VPeriod() : 0.0; if(Abs(aDir.X()) < 0.5) {//Restriction directs along V-direction aTol2d = anOtherSurf->VResolution(aTol3d); - aPeriod = anOtherSurf->IsUPeriodic() ? anOtherSurf->UPeriod() : 0.0; + aPeriod = anOtherSurf->IsUPeriodic222() ? anOtherSurf->UPeriod() : 0.0; } const Standard_Boolean isCoincide = IsCoincide(Func, aL2, anArc, aRL1->IsArcOnS1(), diff --git a/src/IntPatch/IntPatch_Intersection.cxx b/src/IntPatch/IntPatch_Intersection.cxx index f749781335..6a89c69de0 100644 --- a/src/IntPatch/IntPatch_Intersection.cxx +++ b/src/IntPatch/IntPatch_Intersection.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -476,7 +477,7 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1, MS2[0] = 0.5 * (S2->LastUParameter() + S2->FirstUParameter()); MS2[1] = 0.5 * (S2->LastVParameter() + S2->FirstVParameter()); if(T1 == GeomAbs_SurfaceOfExtrusion) isoS1isLine[0] = Standard_True; - else if(!S1->IsVPeriodic() && !S1->IsVClosed()) { + else if(!S1->IsVPeriodic222() && !S1->IsVClosed()) { if(T1 != GeomAbs_OffsetSurface) C1 = gs1->UIso(MS1[0]); else { const Handle(Geom_OffsetSurface) gos = Handle(Geom_OffsetSurface)::DownCast (gs1); @@ -486,7 +487,7 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1, GeomAdaptor_Curve gac(C1); if(gac.GetType() == GeomAbs_Line) isoS1isLine[0] = Standard_True; } - if(!S1->IsUPeriodic() && !S1->IsUClosed()) { + if(!S1->IsUPeriodic222() && !S1->IsUClosed()) { if(T1 != GeomAbs_OffsetSurface) C1 = gs1->VIso(MS1[1]); else { const Handle(Geom_OffsetSurface) gos = Handle(Geom_OffsetSurface)::DownCast (gs1); @@ -497,7 +498,7 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1, if(gac.GetType() == GeomAbs_Line) isoS1isLine[1] = Standard_True; } if(T2 == GeomAbs_SurfaceOfExtrusion) isoS2isLine[0] = Standard_True; - else if(!S2->IsVPeriodic() && !S2->IsVClosed()) { + else if(!S2->IsVPeriodic222() && !S2->IsVClosed()) { if(T2 != GeomAbs_OffsetSurface) C2 = gs2->UIso(MS2[0]); else { const Handle(Geom_OffsetSurface) gos = Handle(Geom_OffsetSurface)::DownCast (gs2); @@ -507,7 +508,7 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1, GeomAdaptor_Curve gac(C2); if(gac.GetType() == GeomAbs_Line) isoS2isLine[0] = Standard_True; } - if(!S2->IsUPeriodic() && !S2->IsUClosed()) { + if(!S2->IsUPeriodic222() && !S2->IsUClosed()) { if(T2 != GeomAbs_OffsetSurface) C2 = gs2->VIso(MS2[1]); else { const Handle(Geom_OffsetSurface) gos = Handle(Geom_OffsetSurface)::DownCast (gs2); @@ -533,33 +534,33 @@ static void FUN_PL_Intersection(const Handle(Adaptor3d_HSurface)& S1, derS1[1].IsParallel(derS2[1],Precision::Angular())) { iso = 1; FUN_GetViso(gs1,T1,S1->FirstUParameter(),S1->LastUParameter(), - S1->IsUClosed(),S1->IsUPeriodic(),MS1[1],C1); + S1->IsUClosed(),S1->IsUPeriodic222(),MS1[1],C1); FUN_GetViso(gs2,T2,S2->FirstUParameter(),S2->LastUParameter(), - S2->IsUClosed(),S2->IsUPeriodic(),MS2[1],C2); + S2->IsUClosed(),S2->IsUPeriodic222(),MS2[1],C2); } else if(isoS1isLine[0] && isoS2isLine[1] && derS1[1].IsParallel(derS2[0],Precision::Angular())) { iso = 1; FUN_GetViso(gs1,T1,S1->FirstUParameter(),S1->LastUParameter(), - S1->IsUClosed(),S1->IsUPeriodic(),MS1[1],C1); + S1->IsUClosed(),S1->IsUPeriodic222(),MS1[1],C1); FUN_GetUiso(gs2,T2,S2->FirstVParameter(),S2->LastVParameter(), - S2->IsVClosed(),S2->IsVPeriodic(),MS2[0],C2); + S2->IsVClosed(),S2->IsVPeriodic222(),MS2[0],C2); } else if(isoS1isLine[1] && isoS2isLine[0] && derS1[0].IsParallel(derS2[1],Precision::Angular())) { iso = 0; FUN_GetUiso(gs1,T1,S1->FirstVParameter(),S1->LastVParameter(), - S1->IsVClosed(),S1->IsVPeriodic(),MS1[0],C1); + S1->IsVClosed(),S1->IsVPeriodic222(),MS1[0],C1); FUN_GetViso(gs2,T2,S2->FirstUParameter(),S2->LastUParameter(), - S2->IsUClosed(),S2->IsUPeriodic(),MS2[1],C2); + S2->IsUClosed(),S2->IsUPeriodic222(),MS2[1],C2); } else if(isoS1isLine[1] && isoS2isLine[1] && derS1[0].IsParallel(derS2[0],Precision::Angular())) { iso = 0; FUN_GetUiso(gs1,T1,S1->FirstVParameter(),S1->LastVParameter(), - S1->IsVClosed(),S1->IsVPeriodic(),MS1[0],C1); + S1->IsVClosed(),S1->IsVPeriodic222(),MS1[0],C1); FUN_GetUiso(gs2,T2,S2->FirstVParameter(),S2->LastVParameter(), - S2->IsVClosed(),S2->IsVPeriodic(),MS2[0],C2); + S2->IsVClosed(),S2->IsVPeriodic222(),MS2[0],C2); } else { IsOk = Standard_False; @@ -1429,11 +1430,8 @@ void IntPatch_Intersection::GeomGeomPerfom(const Handle(Adaptor3d_HSurface)& the aBx1.Enlarge(Precision::PConfusion()); aBx2.Enlarge(Precision::PConfusion()); - const Standard_Real - anArrOfPeriod[4] = {theS1->IsUPeriodic()? theS1->UPeriod() : 0.0, - theS1->IsVPeriodic()? theS1->VPeriod() : 0.0, - theS2->IsUPeriodic()? theS2->UPeriod() : 0.0, - theS2->IsVPeriodic()? theS2->VPeriod() : 0.0}; + Standard_Real anArrOfPeriod[4]; + IntSurf::SetPeriod(theS1, theS2, anArrOfPeriod); NCollection_List aListOfCriticalPoints; diff --git a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx index 054467b1eb..2fa30d5617 100644 --- a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx +++ b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -1587,10 +1588,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& VmaxLig2 = Surf2->LastVParameter(); Standard_Real Periods [4]; - Periods[0] = (Surf1->IsUPeriodic())? Surf1->UPeriod() : 0.; - Periods[1] = (Surf1->IsVPeriodic())? Surf1->VPeriod() : 0.; - Periods[2] = (Surf2->IsUPeriodic())? Surf2->UPeriod() : 0.; - Periods[3] = (Surf2->IsVPeriodic())? Surf2->VPeriod() : 0.; + IntSurf::SetPeriod(Surf1, Surf2, Periods); IntSurf_ListIteratorOfListOfPntOn2S IterLOP1(LOfPnts); if (Surf1->IsUClosed() || Surf1->IsVClosed() || @@ -1996,33 +1994,13 @@ void AdjustOnPeriodic(const Handle(Adaptor3d_HSurface)& Surf1, const Handle(Adaptor3d_HSurface)& Surf2, IntPatch_SequenceOfLine& aSLin) { - Standard_Boolean bIsPeriodic[4], bModified, bIsNull, bIsPeriod; + Standard_Boolean bModified, bIsNull, bIsPeriod; Standard_Integer i, j, k, aNbLines, aNbPx, aIndx, aIndq; Standard_Real aPeriod[4], dPeriod[4], ux[4], uq[4], aEps, du; // aEps=Precision::Confusion(); // - for (k=0; k<4; ++k) { - aPeriod[k]=0.; - } - // - bIsPeriodic[0]=Surf1->IsUPeriodic(); - bIsPeriodic[1]=Surf1->IsVPeriodic(); - bIsPeriodic[2]=Surf2->IsUPeriodic(); - bIsPeriodic[3]=Surf2->IsVPeriodic(); - // - if (bIsPeriodic[0]){ - aPeriod[0]=Surf1->UPeriod(); - } - if (bIsPeriodic[1]){ - aPeriod[1]=Surf1->VPeriod(); - } - if (bIsPeriodic[2]){ - aPeriod[2]=Surf2->UPeriod(); - } - if (bIsPeriodic[3]){ - aPeriod[3]=Surf2->VPeriod(); - } + IntSurf::SetPeriod(Surf1, Surf2, aPeriod); // for (k=0; k<4; ++k) { dPeriod[k]=0.25*aPeriod[k]; @@ -2057,7 +2035,8 @@ void AdjustOnPeriodic(const Handle(Adaptor3d_HSurface)& Surf1, bIsNull=Standard_False; bIsPeriod=Standard_False; // - if (!bIsPeriodic[k]) { + if(aPeriod[k] == 0.0) + { continue; } // @@ -2162,10 +2141,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur D2->VParameters(aVpars2); Standard_Real Periods [4]; - Periods[0] = (Surf1->IsUPeriodic())? Surf1->UPeriod() : 0.; - Periods[1] = (Surf1->IsVPeriodic())? Surf1->VPeriod() : 0.; - Periods[2] = (Surf2->IsUPeriodic())? Surf2->UPeriod() : 0.; - Periods[3] = (Surf2->IsVPeriodic())? Surf2->VPeriod() : 0.; + IntSurf::SetPeriod(Surf1, Surf2, Periods); //--------------------------------------------- if((NbU1*NbV1<=Limit && NbV2*NbU2<=Limit)) diff --git a/src/IntPatch/IntPatch_RstInt.cxx b/src/IntPatch/IntPatch_RstInt.cxx index 0475179b24..bd3588d662 100644 --- a/src/IntPatch/IntPatch_RstInt.cxx +++ b/src/IntPatch/IntPatch_RstInt.cxx @@ -1002,90 +1002,9 @@ void IntPatch_RstInt::PutVertexOnLine (const Handle(IntPatch_Line)& L, //-- On reprend la ligne et on recale les parametres des vertex. //-- if (typL == IntPatch_Walking) { - Standard_Real pu1,pv1,pu2,pv2; - pu1=pv1=pu2=pv2=0.0; - switch(TypeS1) { - case GeomAbs_Cylinder: - case GeomAbs_Cone: - case GeomAbs_Sphere: - pu1=M_PI+M_PI; - break; - case GeomAbs_Torus: - pu1=pv1=M_PI+M_PI; - break; - default: - { - if( Surf1->IsUPeriodic()) { - pu1=Surf1->UPeriod(); - } - else if(Surf1->IsUClosed()) { - pu1=Surf1->LastUParameter() - Surf1->FirstUParameter(); - //cout<<" UClosed1 "<IsVPeriodic()) { - pv1=Surf1->VPeriod(); - } - else if(Surf1->IsVClosed()) { - pv1=Surf1->LastVParameter() - Surf1->FirstVParameter(); - //cout<<" VClosed1 "<IsUPeriodic()) { - pu2=Surf2->UPeriod(); - } - else if(Surf2->IsUClosed()) { - pu2=Surf2->LastUParameter() - Surf2->FirstUParameter(); - //cout<<" UClosed2 "<IsVPeriodic()) { - pv2=Surf2->VPeriod(); - } - else if(Surf2->IsVClosed()) { - pv2=Surf2->LastVParameter() - Surf2->FirstVParameter(); - //cout<<" VClosed2 "<LastUParameter() - Surf1->FirstUParameter(); - pu1+=pu1; - } - if(pu2==0) { - pu2=Surf2->LastUParameter() - Surf2->FirstUParameter(); - pu2+=pu2; - } - if(pv1==0) { - pv1=Surf1->LastVParameter() - Surf1->FirstVParameter(); - pv1+=pv1; - } - if(pv2==0) { - pv2=Surf2->LastVParameter() - Surf2->FirstVParameter(); - pv2+=pv2; - } -*/ - - wlin->SetPeriod(pu1,pv1,pu2,pv2); + Standard_Real aPeriods[4]; + IntSurf::SetPeriod(Surf1, Surf2, aPeriods); + wlin->SetPeriod(aPeriods[0], aPeriods[1], aPeriods[2], aPeriods[3]); wlin->ComputeVertexParameters(Tol); } else { diff --git a/src/IntPatch/IntPatch_SpecialPoints.cxx b/src/IntPatch/IntPatch_SpecialPoints.cxx index 7cda071df3..fafe28e9fb 100644 --- a/src/IntPatch/IntPatch_SpecialPoints.cxx +++ b/src/IntPatch/IntPatch_SpecialPoints.cxx @@ -1020,16 +1020,19 @@ Standard_Boolean IntPatch_SpecialPoints:: // with step greater than PI/4. const Standard_Real aPeriod = (theSPType == IntPatch_SPntPole)? M_PI_2 : 2.0*M_PI; - - const Standard_Real aUpPeriod = thePSurf->IsUPeriodic() ? thePSurf->UPeriod() : 0.0; - const Standard_Real aUqPeriod = theQSurf->IsUPeriodic() ? aPeriod : 0.0; - const Standard_Real aVpPeriod = thePSurf->IsVPeriodic() ? thePSurf->VPeriod() : 0.0; - const Standard_Real aVqPeriod = theQSurf->IsVPeriodic() ? aPeriod : 0.0; - - const Standard_Real anArrOfPeriod[4] = {theIsReversed? aUpPeriod : aUqPeriod, - theIsReversed? aVpPeriod : aVqPeriod, - theIsReversed? aUqPeriod : aUpPeriod, - theIsReversed? aVqPeriod : aVpPeriod}; + Standard_Real anArrOfPeriod[4]; + if(theIsReversed) + { + IntSurf::SetPeriod(thePSurf, theQSurf, anArrOfPeriod); + if(anArrOfPeriod[2] > 0.0) anArrOfPeriod[2] = aPeriod; + if(anArrOfPeriod[3] > 0.0) anArrOfPeriod[3] = aPeriod; + } + else + { + IntSurf::SetPeriod(theQSurf, thePSurf, anArrOfPeriod); + if(anArrOfPeriod[0] > 0.0) anArrOfPeriod[0] = aPeriod; + if(anArrOfPeriod[1] > 0.0) anArrOfPeriod[1] = aPeriod; + } AdjustPointAndVertex(theRefPt, anArrOfPeriod, theNewPoint); return Standard_True; diff --git a/src/IntPatch/IntPatch_WLineTool.cxx b/src/IntPatch/IntPatch_WLineTool.cxx index f3200190ac..8ffea375cd 100644 --- a/src/IntPatch/IntPatch_WLineTool.cxx +++ b/src/IntPatch/IntPatch_WLineTool.cxx @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -224,8 +225,8 @@ static Handle(IntPatch_WLine) NCollection_Array1 aDelOuterPointsHash(1, theWLine->NbPnts()); FillPointsHash(theWLine, aDelOuterPointsHash); - if (theS1->IsUPeriodic() || theS1->IsVPeriodic() || - theS2->IsUPeriodic() || theS2->IsVPeriodic() ) + if (theS1->IsUPeriodic222() || theS1->IsVPeriodic222() || + theS2->IsUPeriodic222() || theS2->IsVPeriodic222() ) return theWLine; gp_Pnt2d aPntOnF1, aPntOnF2; @@ -1466,10 +1467,8 @@ void IntPatch_WLineTool::JoinWLines(IntPatch_SequenceOfLine& theSlin, const Standard_Real aMinRad = 1.0e-3*Min(theS1->Cylinder().Radius(), theS2->Cylinder().Radius()); - const Standard_Real anArrPeriods[4] = {theS1->IsUPeriodic() ? theS1->UPeriod() : 0.0, - theS1->IsVPeriodic() ? theS1->VPeriod() : 0.0, - theS2->IsUPeriodic() ? theS2->UPeriod() : 0.0, - theS2->IsVPeriodic() ? theS2->VPeriod() : 0.0}; + Standard_Real anArrPeriods[4]; + IntSurf::SetPeriod(theS1, theS2, anArrPeriods); const Standard_Real anArrFBonds[4] = {theS1->FirstUParameter(), theS1->FirstVParameter(), theS2->FirstUParameter(), theS2->FirstVParameter()}; diff --git a/src/IntSurf/IntSurf.cxx b/src/IntSurf/IntSurf.cxx index d1d8e5c2af..d5a5340b91 100644 --- a/src/IntSurf/IntSurf.cxx +++ b/src/IntSurf/IntSurf.cxx @@ -105,10 +105,10 @@ void IntSurf::SetPeriod(const Handle(Adaptor3d_HSurface)& theFirstSurf, const Handle(Adaptor3d_HSurface)& theSecondSurf, Standard_Real theArrOfPeriod[4]) { - theArrOfPeriod[0] = theFirstSurf->IsUPeriodic()? theFirstSurf->UPeriod() : 0.0; - theArrOfPeriod[1] = theFirstSurf->IsVPeriodic()? theFirstSurf->VPeriod() : 0.0; - theArrOfPeriod[2] = theSecondSurf->IsUPeriodic()? theSecondSurf->UPeriod() : 0.0; - theArrOfPeriod[3] = theSecondSurf->IsVPeriodic()? theSecondSurf->VPeriod() : 0.0; + theArrOfPeriod[0] = theFirstSurf->IsUPeriodic222()? theFirstSurf->UPeriod() : 0.0; + theArrOfPeriod[1] = theFirstSurf->IsVPeriodic222()? theFirstSurf->VPeriod() : 0.0; + theArrOfPeriod[2] = theSecondSurf->IsUPeriodic222()? theSecondSurf->UPeriod() : 0.0; + theArrOfPeriod[3] = theSecondSurf->IsVPeriodic222()? theSecondSurf->VPeriod() : 0.0; } diff --git a/src/IntTools/IntTools_BeanFaceIntersector.cxx b/src/IntTools/IntTools_BeanFaceIntersector.cxx index 0e95fa721d..b8b3ffba17 100644 --- a/src/IntTools/IntTools_BeanFaceIntersector.cxx +++ b/src/IntTools/IntTools_BeanFaceIntersector.cxx @@ -603,7 +603,7 @@ void IntTools_BeanFaceIntersector::ComputeAroundExactIntersection() bUCorrected = Standard_False; solutionIsValid = Standard_False; // - if(mySurface.IsUPeriodic()) { + if(mySurface.IsUPeriodic222()) { Standard_Real aNewU, aUPeriod, aEps, du; // aUPeriod = mySurface.UPeriod(); @@ -620,7 +620,7 @@ void IntTools_BeanFaceIntersector::ComputeAroundExactIntersection() if(bUCorrected && VIsNotValid) { solutionIsValid = Standard_False; // - if(mySurface.IsVPeriodic()) { + if(mySurface.IsVPeriodic222()) { Standard_Real aNewV, aVPeriod, aEps, dv; // aVPeriod = mySurface.VPeriod(); @@ -1880,9 +1880,9 @@ Standard_Boolean IntTools_BeanFaceIntersector::ComputeLocalized() { if (myCurve.IsPeriodic222()) T = ElCLib::InPeriod(T, anarg1, anarg1 + myCurve.Period()); - if (mySurface.IsUPeriodic()) + if (mySurface.IsUPeriodic222()) U = ElCLib::InPeriod(U, parUF, parUF + mySurface.UPeriod()); - if (mySurface.IsVPeriodic()) + if (mySurface.IsVPeriodic222()) V = ElCLib::InPeriod(V, parVF, parVF + mySurface.VPeriod()); //To avoid occasional going out of boundaries because of numerical diff --git a/src/IntTools/IntTools_FClass2d.cxx b/src/IntTools/IntTools_FClass2d.cxx index 33833d944b..6573290b19 100644 --- a/src/IntTools/IntTools_FClass2d.cxx +++ b/src/IntTools/IntTools_FClass2d.cxx @@ -586,8 +586,8 @@ TopAbs_State IntTools_FClass2d::Perform Handle(BRepAdaptor_HSurface) surf = new BRepAdaptor_HSurface(); surf->ChangeSurface().Initialize( Face, Standard_False ); - const Standard_Boolean IsUPer = surf->IsUPeriodic(); - const Standard_Boolean IsVPer = surf->IsVPeriodic(); + const Standard_Boolean IsUPer = surf->IsUPeriodic222(); + const Standard_Boolean IsVPer = surf->IsVPeriodic222(); const Standard_Real uperiod = IsUPer ? surf->UPeriod() : 0.0; const Standard_Real vperiod = IsVPer ? surf->VPeriod() : 0.0; @@ -725,8 +725,8 @@ TopAbs_State IntTools_FClass2d::TestOnRestriction Handle(BRepAdaptor_HSurface) surf = new BRepAdaptor_HSurface(); surf->ChangeSurface().Initialize( Face, Standard_False ); - const Standard_Boolean IsUPer = surf->IsUPeriodic(); - const Standard_Boolean IsVPer = surf->IsVPeriodic(); + const Standard_Boolean IsUPer = surf->IsUPeriodic222(); + const Standard_Boolean IsVPer = surf->IsVPeriodic222(); const Standard_Real uperiod = IsUPer ? surf->UPeriod() : 0.0; const Standard_Real vperiod = IsVPer ? surf->VPeriod() : 0.0; TopAbs_State aStatus = TopAbs_UNKNOWN; diff --git a/src/IntTools/IntTools_FaceFace.cxx b/src/IntTools/IntTools_FaceFace.cxx index e4111c542a..be6dcc64e4 100644 --- a/src/IntTools/IntTools_FaceFace.cxx +++ b/src/IntTools/IntTools_FaceFace.cxx @@ -1879,8 +1879,8 @@ Handle(Geom_Curve) MakeBSpline (const Handle(IntPatch_WLine)& WL, } } // - isuperiodic = anAdaptorSurface.IsUPeriodic(); - isvperiodic = anAdaptorSurface.IsVPeriodic(); + isuperiodic = (anAdaptorSurface.IsUPeriodic222() && anAdaptorSurface.IsUClosed()); + isvperiodic = (anAdaptorSurface.IsVPeriodic222() && anAdaptorSurface.IsVClosed()); // aType=anAdaptorSurface.GetType(); if((aType==GeomAbs_BezierSurface) || diff --git a/src/IntTools/IntTools_WLineTool.cxx b/src/IntTools/IntTools_WLineTool.cxx index bcd4f28298..fa44b93efe 100644 --- a/src/IntTools/IntTools_WLineTool.cxx +++ b/src/IntTools/IntTools_WLineTool.cxx @@ -490,7 +490,7 @@ gp_Pnt2d AdjustByNeighbour(const gp_Pnt2d& theaNeighbourPoint, gp_Pnt2d ap1 = theaNeighbourPoint; gp_Pnt2d ap2 = theOriginalPoint; - if ( theGASurface->IsUPeriodic() ) { + if ( theGASurface->IsUPeriodic222() ) { Standard_Real aPeriod = theGASurface->UPeriod(); gp_Pnt2d aPTest = ap2; Standard_Real aSqDistMin = 1.e+100; @@ -505,7 +505,7 @@ gp_Pnt2d AdjustByNeighbour(const gp_Pnt2d& theaNeighbourPoint, } } } - if ( theGASurface->IsVPeriodic() ) { + if ( theGASurface->IsVPeriodic222() ) { Standard_Real aPeriod = theGASurface->VPeriod(); gp_Pnt2d aPTest = ap2; Standard_Real aSqDistMin = 1.e+100; @@ -796,7 +796,7 @@ Standard_Boolean IntTools_WLineTool:: } // U, V for(j = 0; j < 2; j++) { - isperiodic = (!j) ? aGASurface->IsUPeriodic() : aGASurface->IsVPeriodic(); + isperiodic = (!j) ? aGASurface->IsUPeriodic222() : aGASurface->IsVPeriodic222(); if(!isperiodic){ continue; } @@ -937,7 +937,7 @@ Standard_Boolean IntTools_WLineTool:: for(Standard_Integer parit = 0; parit < 2; parit++) { - Standard_Boolean isperiodic = (parit == 0) ? aGASurface->IsUPeriodic() : aGASurface->IsVPeriodic(); + Standard_Boolean isperiodic = (parit == 0) ? aGASurface->IsUPeriodic222() : aGASurface->IsVPeriodic222(); Standard_Real aResolution = (parit == 0) ? aGASurface->UResolution(aTol) : aGASurface->VResolution(aTol); Standard_Real alowerboundary = (parit == 0) ? umin : vmin; @@ -1015,7 +1015,7 @@ Standard_Boolean IntTools_WLineTool:: //xt } else if(nbboundaries == 1) { - Standard_Boolean isperiodic = (bIsUBoundary) ? aGASurface->IsUPeriodic() : aGASurface->IsVPeriodic(); + Standard_Boolean isperiodic = (bIsUBoundary) ? aGASurface->IsUPeriodic222() : aGASurface->IsVPeriodic222(); if(isperiodic) { Standard_Real alowerboundary = (bIsUBoundary) ? umin : vmin; @@ -1158,7 +1158,7 @@ Standard_Boolean IntTools_WLineTool:: found = Standard_True; } } - else if ( aGASurface->IsUPeriodic() || aGASurface->IsVPeriodic() ) { + else if ( aGASurface->IsUPeriodic222() || aGASurface->IsVPeriodic222() ) { // re-compute point near boundary if shifted on a period ap2 = AdjustByNeighbour( ap1, anewpoint, aGASurface ); diff --git a/src/LocOpe/LocOpe_SplitShape.cxx b/src/LocOpe/LocOpe_SplitShape.cxx index 80b896b721..dc7941cef2 100644 --- a/src/LocOpe/LocOpe_SplitShape.cxx +++ b/src/LocOpe/LocOpe_SplitShape.cxx @@ -90,9 +90,9 @@ inline Standard_Boolean SameUV(const gp_Pnt2d& P1, const gp_Pnt2d& P2, const BRepAdaptor_Surface& theBAS)//const Standard_Real tol) { Standard_Boolean isSame = Standard_True; - if(theBAS.IsUPeriodic()) + if(theBAS.IsUPeriodic222()) isSame = (fabs(P1.X() - P2.X()) < theBAS.UPeriod() *0.5); - if(theBAS.IsVPeriodic()) + if(theBAS.IsVPeriodic222()) isSame = (isSame && (fabs(P1.Y() - P2.Y()) < theBAS.VPeriod() *0.5)); return isSame; //return P1.SquareDistance(P2) < tol * tol; //IFV @@ -798,7 +798,7 @@ Standard_Boolean LocOpe_SplitShape::AddOpenWire(const TopoDS_Wire& W, BRepAdaptor_Surface BAS(FaceRef, Standard_False); - Standard_Boolean IsPeriodic = BAS.IsUPeriodic() || BAS.IsVPeriodic(); + Standard_Boolean IsPeriodic = BAS.IsUPeriodic222() || BAS.IsVPeriodic222(); tol1 = Max(BAS.UResolution(tol1), BAS.VResolution(tol1)); diff --git a/src/LocOpe/LocOpe_WiresOnShape.cxx b/src/LocOpe/LocOpe_WiresOnShape.cxx index c0a092dc17..6a27f55241 100644 --- a/src/LocOpe/LocOpe_WiresOnShape.cxx +++ b/src/LocOpe/LocOpe_WiresOnShape.cxx @@ -615,14 +615,17 @@ Standard_Boolean Project(const TopoDS_Vertex& V, gp_Pnt2d aPcur = p2d; Standard_Real dumin = Abs(aPcur.X() - aPBound2d.X()); Standard_Real dvmin = Abs(aPcur.Y() - aPBound2d.Y()); - if (dumin > dumax && adSurf.IsUPeriodic()) + if (dumin > dumax && adSurf.IsUPeriodic222()) { Standard_Real aX1 = aPBound2d.X(); - Standard_Real aShift = ShapeAnalysis::AdjustToPeriod(aX1, adSurf.FirstUParameter(), adSurf.LastUParameter()); + Standard_Real aShift = + ShapeAnalysis::AdjustToPeriod(aX1, adSurf.FirstUParameter(), + adSurf.FirstUParameter() + adSurf.UPeriod()); aX1 += aShift; aPBound2d.SetX(aX1); Standard_Real aX2 = p2d.X(); - aShift = ShapeAnalysis::AdjustToPeriod(aX2, adSurf.FirstUParameter(), adSurf.LastUParameter()); + aShift = ShapeAnalysis::AdjustToPeriod(aX2, adSurf.FirstUParameter(), + adSurf.FirstUParameter() + adSurf.UPeriod()); aX2 += aShift; dumin = Abs(aX2 - aX1); if (dumin > dumax && (Abs(dumin - adSurf.UPeriod()) < Precision::PConfusion()) ) @@ -634,14 +637,17 @@ Standard_Boolean Project(const TopoDS_Vertex& V, } - if (dvmin > dvmax && adSurf.IsVPeriodic()) + if (dvmin > dvmax && adSurf.IsVPeriodic222()) { Standard_Real aY1 = aPBound2d.Y(); - Standard_Real aShift = ShapeAnalysis::AdjustToPeriod(aY1, adSurf.FirstVParameter(), adSurf.LastVParameter()); + Standard_Real aShift = + ShapeAnalysis::AdjustToPeriod(aY1, adSurf.FirstVParameter(), + adSurf.FirstUParameter() + adSurf.VPeriod()); aY1 += aShift; aPBound2d.SetY(aY1); Standard_Real aY2 = p2d.Y(); - aShift = ShapeAnalysis::AdjustToPeriod(aY2, adSurf.FirstVParameter(), adSurf.LastVParameter()); + aShift = ShapeAnalysis::AdjustToPeriod(aY2, adSurf.FirstVParameter(), + adSurf.FirstUParameter() + adSurf.VPeriod()); aY2 += aShift; dvmin = Abs(aY1 - aY2); if (dvmin > dvmax && ( Abs(dvmin - adSurf.VPeriod()) < Precision::Confusion()) ) diff --git a/src/ProjLib/ProjLib_CompProjectedCurve.cxx b/src/ProjLib/ProjLib_CompProjectedCurve.cxx index c8a38d8c2a..885f2a6bb4 100644 --- a/src/ProjLib/ProjLib_CompProjectedCurve.cxx +++ b/src/ProjLib/ProjLib_CompProjectedCurve.cxx @@ -745,32 +745,32 @@ void ProjLib_CompProjectedCurve::Init() // as initial point for aPrjPS, so we switch them gp_Vec2d D; - if ((mySurface->IsUPeriodic() && + if ((mySurface->IsUPeriodic222() && Abs(aUppBorder.X() - aLowBorder.X() - mySurface->UPeriod()) < Precision::Confusion()) || - (mySurface->IsVPeriodic() && + (mySurface->IsVPeriodic222() && Abs(aUppBorder.Y() - aLowBorder.Y() - mySurface->VPeriod()) < Precision::Confusion())) { if((Abs(U - aLowBorder.X()) < mySurface->UResolution(Precision::PConfusion())) && - mySurface->IsUPeriodic()) + mySurface->IsUPeriodic222()) { d1(t, U, V, D, myCurve, mySurface); if (D.X() < 0 ) U = aUppBorder.X(); } else if((Abs(U - aUppBorder.X()) < mySurface->UResolution(Precision::PConfusion())) && - mySurface->IsUPeriodic()) + mySurface->IsUPeriodic222()) { d1(t, U, V, D, myCurve, mySurface); if (D.X() > 0) U = aLowBorder.X(); } if((Abs(V - aLowBorder.Y()) < mySurface->VResolution(Precision::PConfusion())) && - mySurface->IsVPeriodic()) + mySurface->IsVPeriodic222()) { d1(t, U, V, D, myCurve, mySurface); if (D.Y() < 0) V = aUppBorder.Y(); } else if((Abs(V - aUppBorder.Y()) <= mySurface->VResolution(Precision::PConfusion())) && - mySurface->IsVPeriodic()) + mySurface->IsVPeriodic222()) { d1(t, U, V, D, myCurve, mySurface); if (D.Y() > 0) V = aLowBorder.Y(); @@ -927,7 +927,7 @@ void ProjLib_CompProjectedCurve::Init() if (!isSplitsComputed) { Standard_Boolean isUPossible = Standard_False; - if (mySurface->IsUPeriodic() && + if (mySurface->IsUPeriodic222() && (Abs(Triple.Y() - mySurface->FirstUParameter() ) > Precision::PConfusion() && Abs(Triple.Y() - mySurface->LastUParameter() ) > Precision::PConfusion())) { @@ -935,7 +935,7 @@ void ProjLib_CompProjectedCurve::Init() } Standard_Boolean isVPossible = Standard_False; - if (mySurface->IsVPeriodic() && + if (mySurface->IsVPeriodic222() && (Abs(Triple.Z() - mySurface->FirstVParameter() ) > Precision::PConfusion() && Abs(Triple.Z() - mySurface->LastVParameter() ) > Precision::PConfusion())) { @@ -1796,12 +1796,12 @@ void ProjLib_CompProjectedCurve::UpdateTripleByTrapCriteria(gp_Pnt &thePoint) co return; // Restore original position in case of period jump. - if (mySurface->IsUPeriodic() && + if (mySurface->IsUPeriodic222() && Abs (Abs(U - thePoint.Y()) - mySurface->UPeriod()) < Precision::PConfusion()) { U = thePoint.Y(); } - if (mySurface->IsVPeriodic() && + if (mySurface->IsVPeriodic222() && Abs (Abs(V - thePoint.Z()) - mySurface->VPeriod()) < Precision::PConfusion()) { V = thePoint.Z(); @@ -1829,12 +1829,12 @@ void BuildCurveSplits(const Handle(Adaptor3d_HCurve) &theCurve, theTolU, theTolV); aDS.myExtPS = &anExtPS; - if (theSurface->IsUPeriodic()) + if (theSurface->IsUPeriodic222()) { aDS.myPeriodicDir = 0; SplitOnDirection(aDS); } - if (theSurface->IsVPeriodic()) + if (theSurface->IsVPeriodic222()) { aDS.myPeriodicDir = 1; SplitOnDirection(aDS); diff --git a/src/ProjLib/ProjLib_ComputeApprox.cxx b/src/ProjLib/ProjLib_ComputeApprox.cxx index 30e349976d..5591aac0ac 100644 --- a/src/ProjLib/ProjLib_ComputeApprox.cxx +++ b/src/ProjLib/ProjLib_ComputeApprox.cxx @@ -841,69 +841,69 @@ static void Function_SetUVBounds(Standard_Real& myU1, // // //======================================================================= -//classn : ProjLib_Function +//class : ProjLib_Function //purpose : //======================================================================= class ProjLib_Function : public AppCont_Function { Handle(Adaptor3d_HCurve) myCurve; Handle(Adaptor3d_HSurface) mySurface; - Standard_Boolean myIsPeriodic[2]; + Standard_Boolean myIsPeriodic111[2]; Standard_Real myPeriod[2]; - public : +public: - Standard_Real myU1,myU2,myV1,myV2; - Standard_Boolean UCouture,VCouture; + Standard_Real myU1, myU2, myV1, myV2; + Standard_Boolean UCouture, VCouture; - ProjLib_Function(const Handle(Adaptor3d_HCurve)& C, + ProjLib_Function(const Handle(Adaptor3d_HCurve)& C, const Handle(Adaptor3d_HSurface)& S) -: myCurve(C), - mySurface(S), - myU1(0.0), - myU2(0.0), - myV1(0.0), - myV2(0.0), - UCouture(Standard_False), - VCouture(Standard_False) + : myCurve(C), + mySurface(S), + myU1(0.0), + myU2(0.0), + myV1(0.0), + myV2(0.0), + UCouture(Standard_False), + VCouture(Standard_False) { myNbPnt = 0; myNbPnt2d = 1; - Function_SetUVBounds(myU1,myU2,myV1,myV2,UCouture,VCouture,myCurve,mySurface); - myIsPeriodic[0] = mySurface->IsUPeriodic(); - myIsPeriodic[1] = mySurface->IsVPeriodic(); + Function_SetUVBounds(myU1, myU2, myV1, myV2, UCouture, VCouture, myCurve, mySurface); + myIsPeriodic111[0] = mySurface->IsUPeriodic222(); + myIsPeriodic111[1] = mySurface->IsVPeriodic222(); - if (myIsPeriodic[0]) + if (myIsPeriodic111[0]) myPeriod[0] = mySurface->UPeriod(); else myPeriod[0] = 0.0; - if (myIsPeriodic[1]) + if (myIsPeriodic111[1]) myPeriod[1] = mySurface->VPeriod(); else myPeriod[1] = 0.0; } - void PeriodInformation(const Standard_Integer theDimIdx, - Standard_Boolean& IsPeriodic, - Standard_Real& thePeriod) const + virtual void PeriodInformation(const Standard_Integer theDimIdx, + Standard_Boolean& IsPeriodic, + Standard_Real& thePeriod) const Standard_OVERRIDE { - IsPeriodic = myIsPeriodic[theDimIdx - 1]; + IsPeriodic = myIsPeriodic111[theDimIdx - 1]; thePeriod = myPeriod[theDimIdx - 1]; } - Standard_Real FirstParameter() const + virtual Standard_Real FirstParameter() const Standard_OVERRIDE { return (myCurve->FirstParameter()); } - Standard_Real LastParameter() const + virtual Standard_Real LastParameter() const Standard_OVERRIDE { return (myCurve->LastParameter()); } - Standard_Boolean Value(const Standard_Real theT, - NCollection_Array1& thePnt2d, - NCollection_Array1& /*thePnt*/) const + virtual Standard_Boolean Value(const Standard_Real theT, + NCollection_Array1& thePnt2d, + NCollection_Array1& /*thePnt*/) const Standard_OVERRIDE { thePnt2d(1) = Function_Value(theT, myCurve, mySurface, myU1, myU2, myV1, myV2, UCouture, VCouture); return Standard_True; @@ -914,13 +914,13 @@ class ProjLib_Function : public AppCont_Function return Function_Value(theT, myCurve, mySurface, myU1, myU2, myV1, myV2, UCouture, VCouture); } - Standard_Boolean D1(const Standard_Real theT, - NCollection_Array1& theVec2d, - NCollection_Array1& /*theVec*/) const + virtual Standard_Boolean D1(const Standard_Real theT, + NCollection_Array1& theVec2d, + NCollection_Array1& /*theVec*/) const Standard_OVERRIDE { gp_Pnt2d aPnt2d; gp_Vec2d aVec2d; - Standard_Boolean isOk = Function_D1(theT, aPnt2d,aVec2d, myCurve, mySurface, myU1, myU2, myV1, myV2, UCouture, VCouture); + Standard_Boolean isOk = Function_D1(theT, aPnt2d, aVec2d, myCurve, mySurface, myU1, myU2, myV1, myV2, UCouture, VCouture); theVec2d(1) = aVec2d; return isOk; } @@ -935,7 +935,7 @@ static Standard_Real ComputeTolU(const Handle(Adaptor3d_HSurface)& theSurf, const Standard_Real theTolerance) { Standard_Real aTolU = theSurf->UResolution(theTolerance); - if (theSurf->IsUPeriodic()) + if (theSurf->IsUPeriodic222()) { aTolU = Min(aTolU, 0.01*theSurf->UPeriod()); } @@ -952,7 +952,7 @@ static Standard_Real ComputeTolV(const Handle(Adaptor3d_HSurface)& theSurf, const Standard_Real theTolerance) { Standard_Real aTolV = theSurf->VResolution(theTolerance); - if (theSurf->IsVPeriodic()) + if (theSurf->IsVPeriodic222()) { aTolV = Min(aTolV, 0.01*theSurf->VPeriod()); } @@ -1106,8 +1106,8 @@ void ProjLib_ComputeApprox::Perform // Mults(1) = 2; // Mults(Nb+1) = 2; - //2D-curve for showing in DRAW - // Handle(Geom2d_Curve) aCC = new Geom2d_BSplineCurve(Poles,Knots,Mults,1); + //2D-curve for showing in DRAW + // Handle(Geom2d_Curve) aCC = new Geom2d_BSplineCurve(Poles,Knots,Mults,1); // AffichValue = Standard_False; //} #endif diff --git a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx index 35c844a32a..05aef25867 100644 --- a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx +++ b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx @@ -93,65 +93,6 @@ struct aFuncStruct Standard_Real myPeriod[2]; // U and V period correspondingly. }; -//======================================================================= -//function : computePeriodicity -//purpose : Compute period information on adaptor. -//======================================================================= -static void computePeriodicity(const Handle(Adaptor3d_HSurface)& theSurf, - Standard_Real &theUPeriod, - Standard_Real &theVPeriod) -{ - theUPeriod = 0.0; - theVPeriod = 0.0; - - // Compute once information about periodicity. - // Param space may be reduced in case of rectangular trimmed surface, - // in this case really trimmed bounds should be set as unperiodic. - Standard_Real aTrimF, aTrimL, aBaseF, aBaseL, aDummyF, aDummyL; - Handle(Geom_Surface) aS = GeomAdaptor::MakeSurface(theSurf->Surface(), Standard_False); // Not trim. - // U param space. - if (theSurf->IsUPeriodic()) - { - theUPeriod = theSurf->UPeriod(); - } - else if(theSurf->IsUClosed()) - { - theUPeriod = theSurf->LastUParameter() - theSurf->FirstUParameter(); - } - if (theUPeriod != 0.0) - { - aTrimF = theSurf->FirstUParameter(); // Trimmed first - aTrimL = theSurf->LastUParameter(); // Trimmed last - aS->Bounds(aBaseF, aBaseL, aDummyF, aDummyL); // Non-trimmed values. - if (Abs (aBaseF - aTrimF) + Abs (aBaseL - aTrimL) > Precision::PConfusion()) - { - // Param space reduced. - theUPeriod = 0.0; - } - } - - // V param space. - if (theSurf->IsVPeriodic()) - { - theVPeriod = theSurf->VPeriod(); - } - else if(theSurf->IsVClosed()) - { - theVPeriod = theSurf->LastVParameter() - theSurf->FirstVParameter(); - } - if (theVPeriod != 0.0) - { - aTrimF = theSurf->FirstVParameter(); // Trimmed first - aTrimL = theSurf->LastVParameter(); // Trimmed last - aS->Bounds(aDummyF, aDummyL, aBaseF, aBaseL); // Non-trimmed values. - if (Abs (aBaseF - aTrimF) + Abs (aBaseL - aTrimL) > Precision::PConfusion()) - { - // Param space reduced. - theVPeriod = 0.0; - } - } -} - //======================================================================= //function : aFuncValue //purpose : compute functional value in (theU,theV) point @@ -291,14 +232,13 @@ static gp_Pnt2d Function_Value(const Standard_Real theU, // Non-analytical case. Standard_Real Dist2Min = RealLast(); - Standard_Real uperiod = theData.myPeriod[0], - vperiod = theData.myPeriod[1], - u, v; + const Standard_Real uperiod = theData.myPeriod[0], + vperiod = theData.myPeriod[1]; // U0 and V0 are the points within the initialized period. if(U0 < Uinf) { - if(!uperiod) + if(uperiod == 0.0) U0 = Uinf; else { @@ -308,7 +248,7 @@ static gp_Pnt2d Function_Value(const Standard_Real theU, } if(U0 > Usup) { - if(!uperiod) + if (uperiod == 0.0) U0 = Usup; else { @@ -318,7 +258,7 @@ static gp_Pnt2d Function_Value(const Standard_Real theU, } if(V0 < Vinf) { - if(!vperiod) + if(vperiod == 0.0) V0 = Vinf; else { @@ -328,7 +268,7 @@ static gp_Pnt2d Function_Value(const Standard_Real theU, } if(V0 > Vsup) { - if(!vperiod) + if(vperiod == 0.0) V0 = Vsup; else { @@ -371,6 +311,7 @@ static gp_Pnt2d Function_Value(const Standard_Real theU, locext.Perform(p, U0, V0); if (locext.IsDone()) { + Standard_Real u, v; locext.Point().Parameter(u, v); Dist2Min = anOrthogSqValue(p, theData.mySurf, u, v); if (Dist2Min < theData.mySqProjOrtTol && // Point is projection. @@ -395,6 +336,7 @@ static gp_Pnt2d Function_Value(const Standard_Real theU, GoodValue = i; } } + Standard_Real u, v; ext.Point(GoodValue).Parameter(u, v); Dist2Min = anOrthogSqValue(p, theData.mySurf, u, v); if (Dist2Min < theData.mySqProjOrtTol && // Point is projection. @@ -429,7 +371,8 @@ class ProjLib_PolarFunction : public AppCont_Function myNbPnt = 0; myNbPnt2d = 1; - computePeriodicity(Surf, myStruct.myPeriod[0], myStruct.myPeriod[1]); + myStruct.myPeriod[0] = (Surf->IsUPeriodic222() && Surf->IsUClosed()) ? Surf->UPeriod() : 0.0; + myStruct.myPeriod[1] = (Surf->IsVPeriodic222() && Surf->IsVClosed()) ? Surf->VPeriod() : 0.0; myStruct.myCurve = C; myStruct.myInitCurve2d = InitialCurve2d; @@ -848,8 +791,9 @@ Handle(Geom2d_BSplineCurve) ProjLib_ComputeApproxOnPolarSurface::Perform } } - Standard_Real anUPeriod, anVPeriod; - computePeriodicity(S, anUPeriod, anVPeriod); + const Standard_Real anUPeriod = (S->IsUPeriodic222() && S->IsUClosed()) ? S->UPeriod() : 0.0; + const Standard_Real anVPeriod = (S->IsVPeriodic222() && S->IsVClosed()) ? S->VPeriod() : 0.0; + Standard_Integer NbC = LOfBSpline2d.Extent(); Handle(Geom2d_BSplineCurve) CurBS; CurBS = Handle(Geom2d_BSplineCurve)::DownCast(LOfBSpline2d.First()); @@ -917,8 +861,8 @@ Handle(Adaptor2d_HCurve2d) DistTol3d = myMaxDist; } Standard_Real DistTol3d2 = DistTol3d * DistTol3d; - Standard_Real uperiod = 0.0, vperiod = 0.0; - computePeriodicity(Surf, uperiod, vperiod); + const Standard_Real uperiod = (Surf->IsUPeriodic222() && Surf->IsUClosed()) ? Surf->UPeriod() : 0.0; + const Standard_Real vperiod = (Surf->IsVPeriodic222() && Surf->IsVClosed()) ? Surf->VPeriod() : 0.0; // NO myTol is Tol2d !!!! //Standard_Real TolU = myTolerance, TolV = myTolerance; diff --git a/src/ProjLib/ProjLib_ProjectedCurve.cxx b/src/ProjLib/ProjLib_ProjectedCurve.cxx index cc60c984ae..a9addedb60 100644 --- a/src/ProjLib/ProjLib_ProjectedCurve.cxx +++ b/src/ProjLib/ProjLib_ProjectedCurve.cxx @@ -64,7 +64,7 @@ static Standard_Real ComputeTolU(const Handle(Adaptor3d_HSurface)& theSurf, const Standard_Real theTolerance) { Standard_Real aTolU = theSurf->UResolution(theTolerance); - if (theSurf->IsUPeriodic()) + if (theSurf->IsUPeriodic222()) { aTolU = Min(aTolU, 0.01*theSurf->UPeriod()); } @@ -81,7 +81,7 @@ static Standard_Real ComputeTolV(const Handle(Adaptor3d_HSurface)& theSurf, const Standard_Real theTolerance) { Standard_Real aTolV = theSurf->VResolution(theTolerance); - if (theSurf->IsVPeriodic()) + if (theSurf->IsVPeriodic222()) { aTolV = Min(aTolV, 0.01*theSurf->VPeriod()); } @@ -736,10 +736,10 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_HCurve)& C) myTolerance = Comp.Tolerance(); } - Standard_Boolean isPeriodic[] = {mySurface->IsUPeriodic(), - mySurface->IsVPeriodic()}; + Standard_Boolean isPeriodic111[] = {mySurface->IsUPeriodic222(), + mySurface->IsVPeriodic222()}; if (myResult.IsDone() && - (isPeriodic[0] || isPeriodic[1])) + (isPeriodic111[0] || isPeriodic111[1])) { // Check result curve to be in params space. @@ -747,14 +747,14 @@ void ProjLib_ProjectedCurve::Perform(const Handle(Adaptor3d_HCurve)& C) const Standard_Real aSurfFirstPar[2] = {mySurface->FirstUParameter(), mySurface->FirstVParameter()}; Standard_Real aSurfPeriod[2] = {0.0, 0.0}; - if (isPeriodic[0]) + if (isPeriodic111[0]) aSurfPeriod[0] = mySurface->UPeriod(); - if (isPeriodic[1]) + if (isPeriodic111[1]) aSurfPeriod[1] = mySurface->VPeriod(); for(Standard_Integer anIdx = 1; anIdx <= 2; anIdx++) { - if (!isPeriodic[anIdx - 1]) + if (!isPeriodic111[anIdx - 1]) continue; if (myResult.GetType() == GeomAbs_BSplineCurve) diff --git a/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx b/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx index 12f799f5f0..ce3f1c3899 100644 --- a/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx +++ b/src/TopOpeBRep/TopOpeBRep_ShapeIntersector.cxx @@ -1137,7 +1137,7 @@ static Standard_Integer OneShapeIsHalfSpace(const TopoDS_Shape& S1,const TopoDS_ if( FSurf.GetType() == GeomAbs_SurfaceOfRevolution ) { - Standard_Boolean areBothPeriodic = ( FSurf.IsUPeriodic() && FSurf.IsVPeriodic() ); + Standard_Boolean areBothPeriodic = ( FSurf.IsUPeriodic222() && FSurf.IsVPeriodic222() ); if( areBothPeriodic ) { Standard_Boolean yesU = ( Abs(FSurf.UPeriod() - M_PI) < 1.e-9 || Abs(FSurf.UPeriod() - 2*M_PI) < 1.e-9 ); diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx index 239b136fd8..02f5593608 100644 --- a/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx +++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_Builder1.cxx @@ -1805,7 +1805,7 @@ Standard_Integer TopOpeBRepBuild_Builder1::IsSame2d (const TopTools_SequenceOfSh TopoDS_Edge aPObj =TopoDS::Edge(aPieceObj) ; TopoDS_Edge aPTool =TopoDS::Edge(aPieceTool); BRepAdaptor_Surface aBAS(aFObj); - if (!(aBAS.IsUPeriodic() || aBAS.IsVPeriodic())) return 1; + if (!(aBAS.IsUPeriodic222() || aBAS.IsVPeriodic222())) return 1; //we process here only fully closed edges (Vf == Vl) if(!BRep_Tool::IsClosed(anEdgeObj) || !BRep_Tool::IsClosed(anEdgeTool)) diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_CorrectFace2d.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_CorrectFace2d.cxx index 1c6d8557ce..3ae31dd569 100644 --- a/src/TopOpeBRepBuild/TopOpeBRepBuild_CorrectFace2d.cxx +++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_CorrectFace2d.cxx @@ -443,8 +443,8 @@ TopOpeBRepBuild_CorrectFace2d::TopOpeBRepBuild_CorrectFace2d() Standard_Real V = aTrV.Y(); BRepAdaptor_Surface BAS(aCopyFace); - Standard_Boolean UP = BAS.IsUPeriodic(); - Standard_Boolean VP = BAS.IsVPeriodic(); + Standard_Boolean UP = BAS.IsUPeriodic222(); + Standard_Boolean VP = BAS.IsVPeriodic222(); Standard_Boolean nonPU = (fabs(U) < 1e-7) ? Standard_True : Standard_False; Standard_Boolean nonPV = (fabs(V) < 1e-7) ? Standard_True : Standard_False; diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx index 59750a955e..134d422caa 100644 --- a/src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx +++ b/src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx @@ -939,7 +939,7 @@ Handle(Geom2d_Curve) TopOpeBRepTool_CurveTool::MakePCurveOnFace } Standard_Real du = 0.; - if (BAHS->IsUPeriodic()) { + if (BAHS->IsUPeriodic222()) { //modified by NIZHNY-MZV Thu Mar 30 10:03:15 2000 Standard_Boolean mincond = (UMin - u2 > 1e-7) ? Standard_True : Standard_False; Standard_Boolean maxcond = (u2 - UMax > 1e-7) ? Standard_True : Standard_False; @@ -949,7 +949,7 @@ Handle(Geom2d_Curve) TopOpeBRepTool_CurveTool::MakePCurveOnFace //if (decalu) du = ( u2 < UMin ) ? BAHS->UPeriod() : -BAHS->UPeriod(); } Standard_Real dv = 0.; - if (BAHS->IsVPeriodic()) { + if (BAHS->IsVPeriodic222()) { //modified by NIZHNY-MZV Thu Mar 30 10:06:24 2000 Standard_Boolean mincond = (VMin - v2 > 1e-7) ? Standard_True : Standard_False; Standard_Boolean maxcond = (v2 - VMax > 1e-7) ? Standard_True : Standard_False; -- 2.39.5