From: nbv Date: Wed, 25 Oct 2017 15:36:21 +0000 (+0300) Subject: Geom_TrimmedCurve X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=73fbbcd771e3217023ecb4554d02e116d2013bca;p=occt-copy.git Geom_TrimmedCurve --- diff --git a/src/BOPTools/BOPTools_AlgoTools.cxx b/src/BOPTools/BOPTools_AlgoTools.cxx index b65d4aaf05..f6a0fa1ccb 100644 --- a/src/BOPTools/BOPTools_AlgoTools.cxx +++ b/src/BOPTools/BOPTools_AlgoTools.cxx @@ -1609,7 +1609,7 @@ void BOPTools_AlgoTools::MakePCurve(const TopoDS_Edge& aE, aOutTol, theContext); } // - if (aC3DE->IsPeriodic()) { + if (aC3DE->IsPeriodic111()) { BOPTools_AlgoTools2D::AdjustPCurveOnFace(aFFWD, aT1, aT2, aC2D, aC2DA, theContext); } diff --git a/src/BRepAlgo/BRepAlgo.cxx b/src/BRepAlgo/BRepAlgo.cxx index 40a6277af9..b8648203e6 100644 --- a/src/BRepAlgo/BRepAlgo.cxx +++ b/src/BRepAlgo/BRepAlgo.cxx @@ -229,13 +229,13 @@ TopoDS_Edge BRepAlgo::ConcatenateWireC0(const TopoDS_Wire& aWire) GeomAdaptor_Curve aGACurve(aCurve); GeomAbs_CurveType aType = aGACurve.GetType(); - Handle(Geom_Curve) aBasisCurve = aGACurve.Curve(); Standard_Boolean isFwd = (wexp.Orientation() != TopAbs_REVERSED); - if (aBasisCurve->IsPeriodic()) { - ElCLib::AdjustPeriodic - (aBasisCurve->FirstParameter(), aBasisCurve->LastParameter(), - Precision::PConfusion(), fpar, lpar); + if (aGACurve.IsPeriodic()) + { + const Handle(Geom_Curve) &aBasisCurve = aGACurve.Curve(); + ElCLib::AdjustPeriodic(aBasisCurve->FirstParameter(), aBasisCurve->LastParameter(), + Precision::PConfusion(), fpar, lpar); } if (CurveSeq.IsEmpty()) { @@ -353,9 +353,10 @@ TopoDS_Edge BRepAlgo::ConcatenateWireC0(const TopoDS_Wire& aWire) if (isSameCurve) { const Standard_Boolean isSameDir = (isFwd == IsFwdSeq.Last()); - if (aBasisCurve->IsPeriodic()) { + if (aGACurve.IsPeriodic()) + { // Treat periodic curves. - const Standard_Real aPeriod = aBasisCurve->Period(); + const Standard_Real aPeriod = aGACurve.Period(); if (isSameDir) { // Check if first parameter is greater then the last one. diff --git a/src/BRepFeat/BRepFeat_Form.cxx b/src/BRepFeat/BRepFeat_Form.cxx index bfea093c05..2ce5d30328 100644 --- a/src/BRepFeat/BRepFeat_Form.cxx +++ b/src/BRepFeat/BRepFeat_Form.cxx @@ -153,6 +153,7 @@ static void Descendants(const TopoDS_Shape&, TopTools_ListIteratorOfListOfShape it,it2; Standard_Integer sens = 0; + // Almost all curves in scur are trimmed curve (e.g. see LocOpe_DPrism::Curves(...)) TColGeom_SequenceOfCurve scur; Curves(scur); @@ -196,7 +197,7 @@ static void Descendants(const TopoDS_Shape&, } mu = ASI2.Point(jj,1).Parameter(); Mu = ASI2.Point(jj,ASI2.NbPoints(jj)).Parameter(); - if (!scur(jj)->IsPeriodic()) { + if (!scur(jj)->IsPeriodic111()) { Standard_Integer ku, kf; if (! (mu > Mf || mf > Mu)) { //overlapping intervals sens = 1; @@ -691,7 +692,7 @@ static void Descendants(const TopoDS_Shape&, prmin2, prmax2, prbmin2, prbmax2, flag1); // case of revolutions - if (C->IsPeriodic()) { + if (C->IsPeriodic111()) { Standard_Real period = C->Period(); prmax = prmax2; if (flag1) { @@ -906,7 +907,7 @@ static void Descendants(const TopoDS_Shape&, Standard_Real min, max, pmin, pmax; Standard_Boolean flag2; for (it.Initialize(lshape); it.More(); it.Next()) { - if (C->IsPeriodic()) { + if (C->IsPeriodic111()) { Standard_Real period = C->Period(); Standard_Real pr, prb; BRepFeat::ParametricMinMax(it.Value(),C, pr, prmax1, diff --git a/src/BRepFill/BRepFill_MultiLine.cxx b/src/BRepFill/BRepFill_MultiLine.cxx index da087a47c3..612eb30ad2 100644 --- a/src/BRepFill/BRepFill_MultiLine.cxx +++ b/src/BRepFill/BRepFill_MultiLine.cxx @@ -213,15 +213,16 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1, // try duplication GeomAdaptor_Surface GAS1(S); - GeomAbs_SurfaceType Type1 = GAS1.GetType(); - if ( UU1->IsPeriodic()) { + if (UU1->IsPeriodic111() && UU1->IsClosed()) + { ElCLib::AdjustPeriodic(UU1->FirstParameter(), UU1->LastParameter(), Precision::PConfusion(), Umin, Umax); } - if ( VV1->IsPeriodic()) { + if (VV1->IsPeriodic111() && VV1->IsClosed()) + { ElCLib::AdjustPeriodic(VV1->FirstParameter(), VV1->LastParameter(), Precision::PConfusion(), @@ -319,15 +320,16 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1, // try duplication GeomAdaptor_Surface GAS2(S); - GeomAbs_SurfaceType Type2 = GAS2.GetType(); - if ( UU2->IsPeriodic()) { + if (UU2->IsPeriodic111() && UU2->IsClosed()) + { ElCLib::AdjustPeriodic(UU2->FirstParameter(), UU2->LastParameter(), Precision::PConfusion(), Umin, Umax); } - if ( VV2->IsPeriodic()) { + if (VV2->IsPeriodic111() && VV2->IsClosed()) + { ElCLib::AdjustPeriodic(VV2->FirstParameter(), VV2->LastParameter(), Precision::PConfusion(), @@ -368,7 +370,8 @@ BRepFill_MultiLine::BRepFill_MultiLine(const TopoDS_Face& Face1, if ( myKPart == 1) myCont = GeomAbs_G1; - if ( (Type1 == GeomAbs_Plane) && (Type2 == GeomAbs_Plane)) { + if ((GAS1.GetType() == GeomAbs_Plane) && (GAS2.GetType() == GeomAbs_Plane)) + { myKPart = 2; } } diff --git a/src/BRepLib/BRepLib.cxx b/src/BRepLib/BRepLib.cxx index defe660fba..cffae7a46f 100644 --- a/src/BRepLib/BRepLib.cxx +++ b/src/BRepLib/BRepLib.cxx @@ -1283,28 +1283,15 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge, Geom2dAdaptor_Curve& GAC2d = HC2d->ChangeCurve2d(); GeomAdaptor_Surface& GAS = HS->ChangeSurface(); - // modified by NIZHNY-OCC486 Tue Aug 27 17:15:13 2002 : - Standard_Boolean m_TrimmedPeriodical = Standard_False; - Handle(Standard_Type) TheType = C3d->DynamicType(); - if( TheType == STANDARD_TYPE(Geom_TrimmedCurve)) + if (!C3d->IsPeriodic111()) { - Handle(Geom_Curve) gtC (Handle(Geom_TrimmedCurve)::DownCast (C3d)->BasisCurve()); - m_TrimmedPeriodical = gtC->IsPeriodic(); - } - // modified by NIZHNY-OCC486 Tue Aug 27 17:15:17 2002 . - - - if(!C3d->IsPeriodic()) { Standard_Real Udeb = C3d->FirstParameter(); Standard_Real Ufin = C3d->LastParameter(); // modified by NIZHNY-OCC486 Tue Aug 27 17:17:14 2002 : //if (Udeb > f3d) f3d = Udeb; //if (l3d > Ufin) l3d = Ufin; - if(!m_TrimmedPeriodical) - { - if (Udeb > f3d) f3d = Udeb; - if (l3d > Ufin) l3d = Ufin; - } + if (Udeb > f3d) f3d = Udeb; + if (l3d > Ufin) l3d = Ufin; // modified by NIZHNY-OCC486 Tue Aug 27 17:17:55 2002 . } if(!L3d.IsIdentity()){ diff --git a/src/BRepLib/BRepLib_MakeEdge.cxx b/src/BRepLib/BRepLib_MakeEdge.cxx index c733c24b31..5adce4ee2e 100644 --- a/src/BRepLib/BRepLib_MakeEdge.cxx +++ b/src/BRepLib/BRepLib_MakeEdge.cxx @@ -768,13 +768,9 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC, const Standard_Real pp1, const Standard_Real pp2) { - // kill trimmed curves - Handle(Geom_Curve) C = CC; - Handle(Geom_TrimmedCurve) CT = Handle(Geom_TrimmedCurve)::DownCast(C); - while (!CT.IsNull()) { - C = CT->BasisCurve(); - CT = Handle(Geom_TrimmedCurve)::DownCast(C); - } + // kill trimmed curves to obtain First/Last-parameters of basis curve + const Handle(Geom_Curve) C = (CC->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) ? + Handle(Geom_TrimmedCurve)::DownCast(CC)->BasisCurve() : CC; // check parameters Standard_Real p1 = pp1; @@ -782,18 +778,18 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC, Standard_Real cf = C->FirstParameter(); Standard_Real cl = C->LastParameter(); Standard_Real epsilon = Precision::PConfusion(); - Standard_Boolean periodic = C->IsPeriodic(); GeomAdaptor_Curve aCA(C); TopoDS_Vertex V1,V2; - if (periodic) { + if (C->IsPeriodic111()) + { // adjust in period ElCLib::AdjustPeriodic(cf,cl,epsilon,p1,p2); V1 = VV1; V2 = VV2; } else { - // reordonate + // reordinate if (p1 < p2) { V1 = VV1; V2 = VV2; @@ -801,9 +797,7 @@ void BRepLib_MakeEdge::Init(const Handle(Geom_Curve)& CC, else { V2 = VV1; V1 = VV2; - Standard_Real x = p1; - p1 = p2; - p2 = x; + std::swap(p1, p2); } // check range diff --git a/src/BRepOffset/BRepOffset_Inter2d.cxx b/src/BRepOffset/BRepOffset_Inter2d.cxx index 7f933e4533..413e940164 100644 --- a/src/BRepOffset/BRepOffset_Inter2d.cxx +++ b/src/BRepOffset/BRepOffset_Inter2d.cxx @@ -1114,7 +1114,7 @@ void BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const f = FirstParOnPC; l = LastParOnPC; } - else if (C3d->IsPeriodic()) + else if (C3d->IsPeriodic111()) { Standard_Real delta = (C3d->Period() - (l - f))*0.5; delta *= 0.95; @@ -1320,7 +1320,7 @@ void BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const LastPar = C3d->LastParameter(); BB.UpdateEdge(NE, C3d, Precision::Confusion()); } - else if (C3d->IsPeriodic()) + else if (C3d->IsPeriodic111()) { Standard_Real delta = (C3d->Period() - (anEl - anEf))*0.5; delta *= 0.95; diff --git a/src/BRepOffset/BRepOffset_MakeOffset.cxx b/src/BRepOffset/BRepOffset_MakeOffset.cxx index e9e565de83..f11ac75923 100644 --- a/src/BRepOffset/BRepOffset_MakeOffset.cxx +++ b/src/BRepOffset/BRepOffset_MakeOffset.cxx @@ -2547,7 +2547,7 @@ void BRepOffset_MakeOffset::MakeMissingWalls () Standard_Real aF, aL; const Handle(Geom_Curve) aC = BRep_Tool::Curve(anEdge, aF, aL); if (!aC.IsNull() && - (!aC->IsClosed() && !aC->IsPeriodic())) + (!aC->IsClosed() && !aC->IsPeriodic111())) { gp_Pnt aPntF = BRep_Tool::Pnt(V1); gp_Pnt aPntL = BRep_Tool::Pnt(V2); diff --git a/src/BRepOffset/BRepOffset_Tool.cxx b/src/BRepOffset/BRepOffset_Tool.cxx index e8965ecf71..3e7b99e96e 100644 --- a/src/BRepOffset/BRepOffset_Tool.cxx +++ b/src/BRepOffset/BRepOffset_Tool.cxx @@ -908,7 +908,7 @@ static Standard_Boolean AreConnex(const TopoDS_Wire& W1, if (V11.IsSame(V21) || V11.IsSame(V22) || V12.IsSame(V21) || V12.IsSame(V22)) - return Standard_True; + return Standard_True; return Standard_False; } @@ -1248,8 +1248,8 @@ static TopoDS_Edge Glue(const TopoDS_Edge& E1, //======================================================================= static void CheckIntersFF(const BOPDS_PDS& pDS, - const TopoDS_Edge& RefEdge, - TopTools_IndexedMapOfShape& TrueEdges) + const TopoDS_Edge& RefEdge, + TopTools_IndexedMapOfShape& TrueEdges) { BOPDS_VectorOfInterfFF& aFFs = pDS->InterfFF(); Standard_Integer aNb = aFFs.Length(); @@ -1260,33 +1260,33 @@ static void CheckIntersFF(const BOPDS_PDS& pDS, BB.MakeCompound(Edges); for (i = 0; i < aNb; ++i) - { - BOPDS_InterfFF& aFFi=aFFs(i); - const BOPDS_VectorOfCurve& aBCurves=aFFi.Curves(); - Standard_Integer aNbCurves = aBCurves.Length(); - - for (j = 0; j < aNbCurves; ++j) { - const BOPDS_Curve& aBC=aBCurves(j); - const BOPDS_ListOfPaveBlock& aSectEdges = aBC.PaveBlocks(); - - BOPDS_ListIteratorOfListOfPaveBlock aPBIt; - aPBIt.Initialize(aSectEdges); + BOPDS_InterfFF& aFFi=aFFs(i); + const BOPDS_VectorOfCurve& aBCurves=aFFi.Curves(); + Standard_Integer aNbCurves = aBCurves.Length(); - for (; aPBIt.More(); aPBIt.Next()) - { - const Handle(BOPDS_PaveBlock)& aPB = aPBIt.Value(); - Standard_Integer nSect = aPB->Edge(); - const TopoDS_Edge& anEdge = *(TopoDS_Edge*)&pDS->Shape(nSect); + for (j = 0; j < aNbCurves; ++j) + { + const BOPDS_Curve& aBC=aBCurves(j); + const BOPDS_ListOfPaveBlock& aSectEdges = aBC.PaveBlocks(); + + BOPDS_ListIteratorOfListOfPaveBlock aPBIt; + aPBIt.Initialize(aSectEdges); + + for (; aPBIt.More(); aPBIt.Next()) + { + const Handle(BOPDS_PaveBlock)& aPB = aPBIt.Value(); + Standard_Integer nSect = aPB->Edge(); + const TopoDS_Edge& anEdge = *(TopoDS_Edge*)&pDS->Shape(nSect); BB.Add(Edges, anEdge); - nbe++; - } + nbe++; + } + } } - } if (nbe == 0) return; - + TopTools_ListOfShape CompList; BOPTools_AlgoTools::MakeConnexityBlocks(Edges, TopAbs_VERTEX, TopAbs_EDGE, CompList); @@ -1294,115 +1294,115 @@ static void CheckIntersFF(const BOPDS_PDS& pDS, if (CompList.Extent() == 1) NearestCompound = CompList.First(); else - { + { BRepAdaptor_Curve BAcurve(RefEdge); gp_Pnt Pref = BAcurve.Value((BAcurve.FirstParameter()+BAcurve.LastParameter())/2); TopoDS_Vertex Vref = BRepLib_MakeVertex(Pref); Standard_Real MinDist = RealLast(); TopTools_ListIteratorOfListOfShape itl(CompList); for (; itl.More(); itl.Next()) - { + { const TopoDS_Shape& aCompound = itl.Value(); - + BRepExtrema_DistShapeShape Projector(Vref, aCompound); if (!Projector.IsDone() || Projector.NbSolution() == 0) continue; - + Standard_Real aDist = Projector.Value(); if (aDist < MinDist) - { + { MinDist = aDist; NearestCompound = aCompound; } } - } + } TopExp::MapShapes(NearestCompound, TopAbs_EDGE, TrueEdges); -} - + } + //======================================================================= //function : AssembleEdge //purpose : //======================================================================= static TopoDS_Edge AssembleEdge(const BOPDS_PDS& pDS, - const TopoDS_Face& F1, - const TopoDS_Face& F2, - const Standard_Boolean addPCurve1, - const Standard_Boolean addPCurve2, - const TopTools_SequenceOfShape& EdgesForConcat) + const TopoDS_Face& F1, + const TopoDS_Face& F2, + const Standard_Boolean addPCurve1, + const Standard_Boolean addPCurve2, + const TopTools_SequenceOfShape& EdgesForConcat) { TopoDS_Edge NullEdge; TopoDS_Edge CurEdge = TopoDS::Edge( EdgesForConcat(1) ); Standard_Real aGlueTol = Precision::Confusion(); for (Standard_Integer j = 2; j <= EdgesForConcat.Length(); j++) - { - TopoDS_Edge anEdge = TopoDS::Edge( EdgesForConcat(j) ); - Standard_Boolean After = Standard_False; - TopoDS_Vertex Vfirst, Vlast; + { + TopoDS_Edge anEdge = TopoDS::Edge( EdgesForConcat(j) ); + Standard_Boolean After = Standard_False; + TopoDS_Vertex Vfirst, Vlast; Standard_Boolean AreClosedWire = AreClosed( CurEdge, anEdge ); if (AreClosedWire) - { - TopoDS_Vertex V1, V2; - TopExp::Vertices( CurEdge, V1, V2 ); + { + TopoDS_Vertex V1, V2; + TopExp::Vertices( CurEdge, V1, V2 ); Standard_Boolean IsAutonomV1 = IsAutonomVertex( V1, pDS, F1, F2 ); Standard_Boolean IsAutonomV2 = IsAutonomVertex( V2, pDS, F1, F2 ); if (IsAutonomV1) - { - After = Standard_False; - Vfirst = Vlast = V2; - } + { + After = Standard_False; + Vfirst = Vlast = V2; + } else if (IsAutonomV2) - { - After = Standard_True; - Vfirst = Vlast = V1; - } + { + After = Standard_True; + Vfirst = Vlast = V1; + } else return NullEdge; - } - else - { - TopoDS_Vertex CV, V11, V12, V21, V22; - TopExp::CommonVertex( CurEdge, anEdge, CV ); + } + else + { + TopoDS_Vertex CV, V11, V12, V21, V22; + TopExp::CommonVertex( CurEdge, anEdge, CV ); Standard_Boolean IsAutonomCV = IsAutonomVertex( CV, pDS, F1, F2 ); if (IsAutonomCV) { - aGlueTol = BRep_Tool::Tolerance(CV); - TopExp::Vertices( CurEdge, V11, V12 ); - TopExp::Vertices( anEdge, V21, V22 ); - if (V11.IsSame(CV) && V21.IsSame(CV)) - { - Vfirst = V22; - Vlast = V12; - } - else if (V11.IsSame(CV) && V22.IsSame(CV)) - { - Vfirst = V21; - Vlast = V12; - } - else if (V12.IsSame(CV) && V21.IsSame(CV)) - { - Vfirst = V11; - Vlast = V22; - } - else - { - Vfirst = V11; - Vlast = V21; - } + aGlueTol = BRep_Tool::Tolerance(CV); + TopExp::Vertices( CurEdge, V11, V12 ); + TopExp::Vertices( anEdge, V21, V22 ); + if (V11.IsSame(CV) && V21.IsSame(CV)) + { + Vfirst = V22; + Vlast = V12; + } + else if (V11.IsSame(CV) && V22.IsSame(CV)) + { + Vfirst = V21; + Vlast = V12; + } + else if (V12.IsSame(CV) && V21.IsSame(CV)) + { + Vfirst = V11; + Vlast = V22; + } + else + { + Vfirst = V11; + Vlast = V21; + } } else return NullEdge; - } //end of else (open wire) - - TopoDS_Edge NewEdge = Glue(CurEdge, anEdge, Vfirst, Vlast, After, - F1, addPCurve1, F2, addPCurve2, aGlueTol); + } //end of else (open wire) + + TopoDS_Edge NewEdge = Glue(CurEdge, anEdge, Vfirst, Vlast, After, + F1, addPCurve1, F2, addPCurve2, aGlueTol); if (NewEdge.IsNull()) return NullEdge; else CurEdge = NewEdge; - } //end of for (Standard_Integer j = 2; j <= EdgesForConcat.Length(); j++) + } //end of for (Standard_Integer j = 2; j <= EdgesForConcat.Length(); j++) return CurEdge; } @@ -1512,7 +1512,7 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1, if(!aC3DETrim.IsNull()) { Handle(Geom2d_Curve) aC2dNew; - if(aC3DE->IsPeriodic()) { + if(aC3DE->IsPeriodic111()) { BOPTools_AlgoTools2D::AdjustPCurveOnFace(F1, f, l, aC2d, aC2dNew, aContext); } else { @@ -1528,7 +1528,7 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1, if(!aC3DETrim.IsNull()) { Handle(Geom2d_Curve) aC2dNew; - if(aC3DE->IsPeriodic()) { + if(aC3DE->IsPeriodic111()) { BOPTools_AlgoTools2D::AdjustPCurveOnFace(F2, f, l, aC2d, aC2dNew, aContext); } else { @@ -1582,11 +1582,11 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1, if (L1.Extent() > 1 && (!isEl1 || !isEl2)) { TopTools_SequenceOfShape eseq; TopTools_SequenceOfShape EdgesForConcat; - + if (!TrueEdges.IsEmpty()) - { - for (i = TrueEdges.Extent(); i >= 1; i--) - EdgesForConcat.Append( TrueEdges(i) ); + { + for (i = TrueEdges.Extent(); i >= 1; i--) + EdgesForConcat.Append( TrueEdges(i) ); TopoDS_Edge AssembledEdge = AssembleEdge( pDS, F1, F2, addPCurve1, addPCurve2, EdgesForConcat ); if (AssembledEdge.IsNull()) @@ -1594,145 +1594,145 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1, eseq.Append( TrueEdges(i) ); else eseq.Append(AssembledEdge); - } + } else - { - TopTools_SequenceOfShape wseq; - TopTools_SequenceOfShape edges; - TopTools_ListIteratorOfListOfShape itl(L1); - for (; itl.More(); itl.Next()) - edges.Append( itl.Value() ); - while (!edges.IsEmpty()) { - TopoDS_Edge anEdge = TopoDS::Edge( edges.First() ); + TopTools_SequenceOfShape wseq; + TopTools_SequenceOfShape edges; + TopTools_ListIteratorOfListOfShape itl(L1); + for (; itl.More(); itl.Next()) + edges.Append( itl.Value() ); + while (!edges.IsEmpty()) + { + TopoDS_Edge anEdge = TopoDS::Edge( edges.First() ); TopoDS_Wire aWire, resWire; BB.MakeWire(aWire); BB.Add( aWire, anEdge ); - TColStd_SequenceOfInteger Candidates; - for (k = 1; k <= wseq.Length(); k++) - { - resWire = TopoDS::Wire(wseq(k)); + TColStd_SequenceOfInteger Candidates; + for (k = 1; k <= wseq.Length(); k++) + { + resWire = TopoDS::Wire(wseq(k)); if (AreConnex( resWire, aWire )) - { - Candidates.Append( 1 ); - break; - } - } - if (Candidates.IsEmpty()) - { - wseq.Append( aWire ); - edges.Remove(1); - } - else - { - for (j = 2; j <= edges.Length(); j++) - { - anEdge = TopoDS::Edge( edges(j) ); + { + Candidates.Append( 1 ); + break; + } + } + if (Candidates.IsEmpty()) + { + wseq.Append( aWire ); + edges.Remove(1); + } + else + { + for (j = 2; j <= edges.Length(); j++) + { + anEdge = TopoDS::Edge( edges(j) ); aWire.Nullify(); BB.MakeWire(aWire); BB.Add( aWire, anEdge ); if (AreConnex( resWire, aWire )) - Candidates.Append( j ); - } - Standard_Integer minind = 1; - if (Candidates.Length() > 1) - { - Standard_Real MinAngle = RealLast(); - for (j = 1; j <= Candidates.Length(); j++) - { - anEdge = TopoDS::Edge( edges(Candidates(j)) ); - Standard_Real anAngle = AngleWireEdge( resWire, anEdge ); - if (anAngle < MinAngle) - { - MinAngle = anAngle; - minind = j; - } - } - } + Candidates.Append( j ); + } + Standard_Integer minind = 1; + if (Candidates.Length() > 1) + { + Standard_Real MinAngle = RealLast(); + for (j = 1; j <= Candidates.Length(); j++) + { + anEdge = TopoDS::Edge( edges(Candidates(j)) ); + Standard_Real anAngle = AngleWireEdge( resWire, anEdge ); + if (anAngle < MinAngle) + { + MinAngle = anAngle; + minind = j; + } + } + } BB.Add( resWire, TopoDS::Edge(edges(Candidates(minind))) ); wseq(k) = resWire; - edges.Remove(Candidates(minind)); - } - } //end of while (!edges.IsEmpty()) - - for (i = 1; i <= wseq.Length(); i++) - { - TopoDS_Wire aWire = TopoDS::Wire(wseq(i)); - TopTools_SequenceOfShape aLocalEdgesForConcat; - if (aWire.Closed()) - { - TopoDS_Vertex StartVertex; - TopoDS_Edge StartEdge; - Standard_Boolean StartFound = Standard_False; - TopTools_ListOfShape Elist; - - TopoDS_Iterator itw(aWire); - for (; itw.More(); itw.Next()) - { - TopoDS_Edge anEdge = TopoDS::Edge(itw.Value()); - if (StartFound) - Elist.Append(anEdge); - else - { - TopoDS_Vertex V1, V2; - TopExp::Vertices( anEdge, V1, V2 ); - if (!IsAutonomVertex( V1, pDS )) - { - StartVertex = V2; - StartEdge = anEdge; - StartFound = Standard_True; - } - else if (!IsAutonomVertex( V2, pDS )) - { - StartVertex = V1; - StartEdge = anEdge; - StartFound = Standard_True; - } - else - Elist.Append(anEdge); - } - } //end of for (; itw.More(); itw.Next()) - if (!StartFound) - { - itl.Initialize(Elist); - StartEdge = TopoDS::Edge(itl.Value()); - Elist.Remove(itl); - TopoDS_Vertex V1, V2; - TopExp::Vertices( StartEdge, V1, V2 ); - StartVertex = V1; - } - aLocalEdgesForConcat.Append( StartEdge ); - while (!Elist.IsEmpty()) - { - for (itl.Initialize(Elist); itl.More(); itl.Next()) - { - TopoDS_Edge anEdge = TopoDS::Edge(itl.Value()); - TopoDS_Vertex V1, V2; - TopExp::Vertices( anEdge, V1, V2 ); - if (V1.IsSame(StartVertex)) - { - StartVertex = V2; - aLocalEdgesForConcat.Append( anEdge ); - Elist.Remove(itl); - break; - } - else if (V2.IsSame(StartVertex)) - { - StartVertex = V1; - aLocalEdgesForConcat.Append( anEdge ); - Elist.Remove(itl); - break; - } - } - } //end of while (!Elist.IsEmpty()) - } //end of if (aWire.Closed()) - else - { - BRepTools_WireExplorer Wexp( aWire ); - for (; Wexp.More(); Wexp.Next()) - aLocalEdgesForConcat.Append( Wexp.Current() ); - } + edges.Remove(Candidates(minind)); + } + } //end of while (!edges.IsEmpty()) + for (i = 1; i <= wseq.Length(); i++) + { + TopoDS_Wire aWire = TopoDS::Wire(wseq(i)); + TopTools_SequenceOfShape aLocalEdgesForConcat; + if (aWire.Closed()) + { + TopoDS_Vertex StartVertex; + TopoDS_Edge StartEdge; + Standard_Boolean StartFound = Standard_False; + TopTools_ListOfShape Elist; + + TopoDS_Iterator itw(aWire); + for (; itw.More(); itw.Next()) + { + TopoDS_Edge anEdge = TopoDS::Edge(itw.Value()); + if (StartFound) + Elist.Append(anEdge); + else + { + TopoDS_Vertex V1, V2; + TopExp::Vertices( anEdge, V1, V2 ); + if (!IsAutonomVertex( V1, pDS )) + { + StartVertex = V2; + StartEdge = anEdge; + StartFound = Standard_True; + } + else if (!IsAutonomVertex( V2, pDS )) + { + StartVertex = V1; + StartEdge = anEdge; + StartFound = Standard_True; + } + else + Elist.Append(anEdge); + } + } //end of for (; itw.More(); itw.Next()) + if (!StartFound) + { + itl.Initialize(Elist); + StartEdge = TopoDS::Edge(itl.Value()); + Elist.Remove(itl); + TopoDS_Vertex V1, V2; + TopExp::Vertices( StartEdge, V1, V2 ); + StartVertex = V1; + } + aLocalEdgesForConcat.Append( StartEdge ); + while (!Elist.IsEmpty()) + { + for (itl.Initialize(Elist); itl.More(); itl.Next()) + { + TopoDS_Edge anEdge = TopoDS::Edge(itl.Value()); + TopoDS_Vertex V1, V2; + TopExp::Vertices( anEdge, V1, V2 ); + if (V1.IsSame(StartVertex)) + { + StartVertex = V2; + aLocalEdgesForConcat.Append( anEdge ); + Elist.Remove(itl); + break; + } + else if (V2.IsSame(StartVertex)) + { + StartVertex = V1; + aLocalEdgesForConcat.Append( anEdge ); + Elist.Remove(itl); + break; + } + } + } //end of while (!Elist.IsEmpty()) + } //end of if (aWire.Closed()) + else + { + BRepTools_WireExplorer Wexp( aWire ); + for (; Wexp.More(); Wexp.Next()) + aLocalEdgesForConcat.Append( Wexp.Current() ); + } + TopoDS_Edge AssembledEdge = AssembleEdge( pDS, F1, F2, addPCurve1, addPCurve2, aLocalEdgesForConcat ); if (AssembledEdge.IsNull()) @@ -1740,56 +1740,56 @@ void BRepOffset_Tool::Inter3D(const TopoDS_Face& F1, eseq.Append( aLocalEdgesForConcat(j) ); else eseq.Append( AssembledEdge ); - } - } //end of else (when TrueEdges is empty) + } + } //end of else (when TrueEdges is empty) if (eseq.Length() < L1.Extent()) - { - L1.Clear(); - L2.Clear(); - for (i = 1; i <= eseq.Length(); i++) { + L1.Clear(); + L2.Clear(); + for (i = 1; i <= eseq.Length(); i++) + { TopoDS_Shape aShape = eseq(i); - TopoDS_Edge anEdge = TopoDS::Edge(eseq(i)); - BRepLib::SameParameter(anEdge, aSameParTol, Standard_True); - Standard_Real EdgeTol = BRep_Tool::Tolerance(anEdge); + TopoDS_Edge anEdge = TopoDS::Edge(eseq(i)); + BRepLib::SameParameter(anEdge, aSameParTol, Standard_True); + Standard_Real EdgeTol = BRep_Tool::Tolerance(anEdge); #ifdef OCCT_DEBUG - cout<<"Tolerance of glued E = "<IsPeriodic(); + return basisCurve->IsPeriodic111(); } //======================================================================= diff --git a/src/Geom/Geom_OffsetCurve.hxx b/src/Geom/Geom_OffsetCurve.hxx index a195a85e92..b03d165ae5 100644 --- a/src/Geom/Geom_OffsetCurve.hxx +++ b/src/Geom/Geom_OffsetCurve.hxx @@ -245,7 +245,7 @@ public: //! Returns true if this offset curve is periodic, i.e. if the //! basis curve of this offset curve is periodic. - Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE; //! Returns the period of this offset curve, i.e. the period //! of the basis curve of this offset curve. diff --git a/src/Geom/Geom_Parabola.cxx b/src/Geom/Geom_Parabola.cxx index 4115c294b3..7aa14519d7 100644 --- a/src/Geom/Geom_Parabola.cxx +++ b/src/Geom/Geom_Parabola.cxx @@ -112,7 +112,7 @@ Standard_Boolean Geom_Parabola::IsClosed () const { return Standard_False; } //purpose : //======================================================================= -Standard_Boolean Geom_Parabola::IsPeriodic () const { return Standard_False; } +Standard_Boolean Geom_Parabola::IsPeriodic111 () const { return Standard_False; } //======================================================================= //function : Eccentricity diff --git a/src/Geom/Geom_Parabola.hxx b/src/Geom/Geom_Parabola.hxx index 8757c5594b..1bb569cc79 100644 --- a/src/Geom/Geom_Parabola.hxx +++ b/src/Geom/Geom_Parabola.hxx @@ -134,7 +134,7 @@ public: Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE; //! Returns False - Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE; //! Computes the directrix of this parabola. //! This is a line normal to the axis of symmetry, in the diff --git a/src/Geom/Geom_SurfaceOfLinearExtrusion.cxx b/src/Geom/Geom_SurfaceOfLinearExtrusion.cxx index 62d816d994..3babe76114 100644 --- a/src/Geom/Geom_SurfaceOfLinearExtrusion.cxx +++ b/src/Geom/Geom_SurfaceOfLinearExtrusion.cxx @@ -335,7 +335,7 @@ Standard_Boolean Geom_SurfaceOfLinearExtrusion::IsUClosed () const { Standard_Boolean Geom_SurfaceOfLinearExtrusion::IsUPeriodic () const { - return basisCurve->IsPeriodic (); + return basisCurve->IsPeriodic111 (); } //======================================================================= diff --git a/src/Geom/Geom_SurfaceOfRevolution.cxx b/src/Geom/Geom_SurfaceOfRevolution.cxx index d1b86e43e9..1fd41da8e8 100644 --- a/src/Geom/Geom_SurfaceOfRevolution.cxx +++ b/src/Geom/Geom_SurfaceOfRevolution.cxx @@ -216,7 +216,7 @@ Standard_Boolean Geom_SurfaceOfRevolution::IsVClosed () const Standard_Boolean Geom_SurfaceOfRevolution::IsVPeriodic () const { - return basisCurve->IsPeriodic(); + return basisCurve->IsPeriodic111(); } diff --git a/src/Geom/Geom_TrimmedCurve.cxx b/src/Geom/Geom_TrimmedCurve.cxx index 7fc934707b..e132504ea6 100644 --- a/src/Geom/Geom_TrimmedCurve.cxx +++ b/src/Geom/Geom_TrimmedCurve.cxx @@ -126,7 +126,7 @@ void Geom_TrimmedCurve::SetTrim (const Standard_Real U1, Standard_Real Udeb = basisCurve->FirstParameter(); Standard_Real Ufin = basisCurve->LastParameter(); - if (basisCurve->IsPeriodic()) { + if (IsPeriodic111()) { sameSense = Sense; // set uTrim1 in the range Udeb , Ufin @@ -170,7 +170,7 @@ void Geom_TrimmedCurve::SetTrim (const Standard_Real U1, Standard_Boolean Geom_TrimmedCurve::IsClosed () const { - return ( StartPoint().Distance(EndPoint()) <= gp::Resolution()); + return ( StartPoint().SquareDistance(EndPoint()) <= gp::Resolution()); } //======================================================================= @@ -178,10 +178,9 @@ Standard_Boolean Geom_TrimmedCurve::IsClosed () const //purpose : //======================================================================= -Standard_Boolean Geom_TrimmedCurve::IsPeriodic () const +Standard_Boolean Geom_TrimmedCurve::IsPeriodic111 () const { - //return basisCurve->IsPeriodic(); - return Standard_False; + return basisCurve->IsPeriodic111(); } diff --git a/src/Geom/Geom_TrimmedCurve.hxx b/src/Geom/Geom_TrimmedCurve.hxx index 7656908070..64e8f7c595 100644 --- a/src/Geom/Geom_TrimmedCurve.hxx +++ b/src/Geom/Geom_TrimmedCurve.hxx @@ -174,7 +174,7 @@ public: Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE; //! Always returns FALSE (independently of the type of basis curve). - Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE; + Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE; //! Returns the period of the basis curve of this trimmed curve. //! Exceptions diff --git a/src/GeomAdaptor/GeomAdaptor_Curve.cxx b/src/GeomAdaptor/GeomAdaptor_Curve.cxx index 390673cc31..46f7145d7d 100644 --- a/src/GeomAdaptor/GeomAdaptor_Curve.cxx +++ b/src/GeomAdaptor/GeomAdaptor_Curve.cxx @@ -83,9 +83,9 @@ GeomAbs_Shape GeomAdaptor_Curve::LocalContinuity(const Standard_Real U1, Standard_Real newFirst, newLast; const TColStd_Array1OfReal& TK = myBSplineCurve->Knots(); const TColStd_Array1OfInteger& TM = myBSplineCurve->Multiplicities(); - BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U1,myBSplineCurve->IsPeriodic(), + BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U1,myBSplineCurve->IsPeriodic111(), 1,Nb,Index1,newFirst); - BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U2,myBSplineCurve->IsPeriodic(), + BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U2,myBSplineCurve->IsPeriodic111(), 1,Nb,Index2,newLast); if ( Abs(newFirst-TK(Index1+1))IsPeriodic()) && (Index1 == Nb) ) + if ( (myBSplineCurve->IsPeriodic111()) && (Index1 == Nb) ) Index1 = 1; if ( Index2 - Index1 <= 0) { @@ -295,10 +295,10 @@ Standard_Integer GeomAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const const TColStd_Array1OfReal& TK = myBSplineCurve->Knots(); const TColStd_Array1OfInteger& TM = myBSplineCurve->Multiplicities(); BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,myFirst, - myBSplineCurve->IsPeriodic(), + myBSplineCurve->IsPeriodic111(), 1,Nb,Index1,newFirst); BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,myLast, - myBSplineCurve->IsPeriodic(), + myBSplineCurve->IsPeriodic111(), 1,Nb,Index2,newLast); // Protection against myFirst = UFirst - eps, which located as ULast - eps if (myBSplineCurve->IsPeriodic() && (newLast - newFirst) < Precision::PConfusion()) @@ -425,10 +425,10 @@ void GeomAdaptor_Curve::Intervals(TColStd_Array1OfReal& T, const TColStd_Array1OfReal& TK = myBSplineCurve->Knots(); const TColStd_Array1OfInteger& TM = myBSplineCurve->Multiplicities(); BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,myFirst, - myBSplineCurve->IsPeriodic(), + myBSplineCurve->IsPeriodic111(), 1,Nb,Index1,newFirst); BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,myLast, - myBSplineCurve->IsPeriodic(), + myBSplineCurve->IsPeriodic111(), 1,Nb,Index2,newLast); FirstParam = newFirst; LastParam = newLast; @@ -541,7 +541,7 @@ Standard_Boolean GeomAdaptor_Curve::IsClosed() const Standard_Boolean GeomAdaptor_Curve::IsPeriodic() const { - return myCurve->IsPeriodic(); + return myCurve->IsPeriodic111(); } //======================================================================= @@ -567,7 +567,7 @@ void GeomAdaptor_Curve::RebuildCache(const Standard_Real theParameter) const Standard_Integer aDeg = aBezier->Degree(); TColStd_Array1OfReal aFlatKnots(BSplCLib::FlatBezierKnots(aDeg), 1, 2 * (aDeg + 1)); if (myCurveCache.IsNull()) - myCurveCache = new BSplCLib_Cache(aDeg, aBezier->IsPeriodic(), aFlatKnots, + myCurveCache = new BSplCLib_Cache(aDeg, aBezier->IsPeriodic111(), aFlatKnots, aBezier->Poles(), aBezier->Weights()); myCurveCache->BuildCache (theParameter, aFlatKnots, aBezier->Poles(), aBezier->Weights()); } @@ -575,7 +575,7 @@ void GeomAdaptor_Curve::RebuildCache(const Standard_Real theParameter) const { // Create cache for B-spline if (myCurveCache.IsNull()) - myCurveCache = new BSplCLib_Cache(myBSplineCurve->Degree(), myBSplineCurve->IsPeriodic(), + myCurveCache = new BSplCLib_Cache(myBSplineCurve->Degree(), myBSplineCurve->IsPeriodic111(), myBSplineCurve->KnotSequence(), myBSplineCurve->Poles(), myBSplineCurve->Weights()); myCurveCache->BuildCache (theParameter, myBSplineCurve->KnotSequence(), myBSplineCurve->Poles(), myBSplineCurve->Weights()); diff --git a/src/GeomConvert/GeomConvert.cxx b/src/GeomConvert/GeomConvert.cxx index ff694b0386..174a2fe174 100644 --- a/src/GeomConvert/GeomConvert.cxx +++ b/src/GeomConvert/GeomConvert.cxx @@ -131,7 +131,7 @@ Handle(Geom_BSplineCurve) GeomConvert::SplitBSplineCurve C1->Segment( C->Knot(FirstK),C->Knot(LastK)); - if (C->IsPeriodic()) { + if (C->IsPeriodic111()) { if (!SameOrientation) C1->Reverse(); } else { @@ -161,7 +161,7 @@ Handle(Geom_BSplineCurve) GeomConvert::SplitBSplineCurve C1->Segment(FirstU, LastU); - if (C->IsPeriodic()) { + if (C->IsPeriodic111()) { if (!SameOrientation) C1->Reverse(); } else { @@ -194,7 +194,7 @@ Handle(Geom_BSplineCurve) GeomConvert::CurveToBSplineCurve // Si la courbe n'est pas vraiment restreinte, on ne risque pas // le Raise dans le BS->Segment. - if (!Curv->IsPeriodic()) { + if (!Curv->IsPeriodic111()) { if (U1 < Curv->FirstParameter()) U1 = Curv->FirstParameter(); if (U2 > Curv->LastParameter()) @@ -358,7 +358,7 @@ Handle(Geom_BSplineCurve) GeomConvert::CurveToBSplineCurve else if (Curv->IsKind (STANDARD_TYPE(Geom_BSplineCurve))) { TheCurve = Handle(Geom_BSplineCurve)::DownCast(Curv->Copy()); //// modified by jgv, 14.01.05 for OCC7355 //// - if (TheCurve->IsPeriodic()) + if (TheCurve->IsPeriodic111()) { Standard_Real Uf = TheCurve->FirstParameter(); Standard_Real Ul = TheCurve->LastParameter(); diff --git a/src/GeomConvert/GeomConvert_1.cxx b/src/GeomConvert/GeomConvert_1.cxx index b8ec250f24..7207022b37 100644 --- a/src/GeomConvert/GeomConvert_1.cxx +++ b/src/GeomConvert/GeomConvert_1.cxx @@ -570,7 +570,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface UKnots, VKnots, UMults, VMults, 2 , C->Degree(), - periodic, C->IsPeriodic()); + periodic, C->IsPeriodic111()); } @@ -613,7 +613,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface TheSurface = new Geom_BSplineSurface(Poles, Weights, UKnots, VKnots, UMults, VMults, C->Degree(), 1, - C->IsPeriodic(), Standard_False); + C->IsPeriodic111(), Standard_False); } @@ -790,7 +790,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface UKnots, VKnots, UMults, VMults, 2 , C->Degree(), - periodic, C->IsPeriodic()); + periodic, C->IsPeriodic111()); } diff --git a/src/GeomFill/GeomFill_BSplineCurves.cxx b/src/GeomFill/GeomFill_BSplineCurves.cxx index 57c9a01fe9..e24783f8e9 100644 --- a/src/GeomFill/GeomFill_BSplineCurves.cxx +++ b/src/GeomFill/GeomFill_BSplineCurves.cxx @@ -506,7 +506,7 @@ void GeomFill_BSplineCurves::Init UKnots , VKnots, UMults , VMults, CC1->Degree(), 1, - CC1->IsPeriodic(), + CC1->IsPeriodic111(), Standard_False); } else { diff --git a/src/GeomFill/GeomFill_EvolvedSection.cxx b/src/GeomFill/GeomFill_EvolvedSection.cxx index dfbde82501..c35af9bf07 100644 --- a/src/GeomFill/GeomFill_EvolvedSection.cxx +++ b/src/GeomFill/GeomFill_EvolvedSection.cxx @@ -55,7 +55,7 @@ GeomFill_EvolvedSection::GeomFill_EvolvedSection(const Handle(Geom_Curve)& C, myCurve = Handle(Geom_BSplineCurve)::DownCast(C); if (myCurve.IsNull()) { myCurve = GeomConvert::CurveToBSplineCurve(C, Convert_QuasiAngular); - if (myCurve->IsPeriodic()) { + if (myCurve->IsPeriodic111()) { Standard_Integer M = myCurve->Degree()/2+1; myCurve->RemoveKnot(1, M, Precision::Confusion()); } @@ -216,7 +216,7 @@ GeomFill_EvolvedSection::GeomFill_EvolvedSection(const Handle(Geom_Curve)& C, //======================================================= Standard_Boolean GeomFill_EvolvedSection::IsUPeriodic() const { - return myCurve->IsPeriodic(); + return myCurve->IsPeriodic111(); } //======================================================= diff --git a/src/GeomFill/GeomFill_Profiler.cxx b/src/GeomFill/GeomFill_Profiler.cxx index 6313745205..98a71a2495 100644 --- a/src/GeomFill/GeomFill_Profiler.cxx +++ b/src/GeomFill/GeomFill_Profiler.cxx @@ -166,7 +166,7 @@ void GeomFill_Profiler::AddCurve(const Handle(Geom_Curve)& Curve) mySequence.Append( C); - if ( myIsPeriodic && !C->IsPeriodic()) + if ( myIsPeriodic && !C->IsPeriodic111()) myIsPeriodic = Standard_False; } @@ -195,7 +195,7 @@ void GeomFill_Profiler::Perform(const Standard_Real PTol) U2 = C->Knot(C->LastUKnotIndex()); U1 = C->Knot(C->FirstUKnotIndex()); - if ( !myIsPeriodic && C->IsPeriodic()) { + if ( !myIsPeriodic && C->IsPeriodic111()) { C->SetNotPeriodic(); C->Segment( U1, U2); } diff --git a/src/GeomFill/GeomFill_SweepSectionGenerator.cxx b/src/GeomFill/GeomFill_SweepSectionGenerator.cxx index 76e1782c36..d005f38657 100644 --- a/src/GeomFill/GeomFill_SweepSectionGenerator.cxx +++ b/src/GeomFill/GeomFill_SweepSectionGenerator.cxx @@ -171,7 +171,7 @@ void GeomFill_SweepSectionGenerator::Init myFirstSect = GeomConvert::CurveToBSplineCurve(FirstSect, Convert_QuasiAngular); } - if ( myFirstSect->IsPeriodic()) myFirstSect->SetNotPeriodic(); + if ( myFirstSect->IsPeriodic111()) myFirstSect->SetNotPeriodic(); } @@ -219,8 +219,8 @@ void GeomFill_SweepSectionGenerator::Init Convert_QuasiAngular); } - if ( myFirstSect->IsPeriodic()) myFirstSect->SetNotPeriodic(); - if ( myLastSect->IsPeriodic()) myLastSect->SetNotPeriodic(); + if ( myFirstSect->IsPeriodic111()) myFirstSect->SetNotPeriodic(); + if ( myLastSect->IsPeriodic111()) myLastSect->SetNotPeriodic(); // JAG diff --git a/src/GeomFill/GeomFill_UniformSection.cxx b/src/GeomFill/GeomFill_UniformSection.cxx index 6a50c1ee9b..b73bef12d5 100644 --- a/src/GeomFill/GeomFill_UniformSection.cxx +++ b/src/GeomFill/GeomFill_UniformSection.cxx @@ -54,7 +54,7 @@ GeomFill_UniformSection::GeomFill_UniformSection(const Handle(Geom_Curve)& C, myCurve = Handle(Geom_BSplineCurve)::DownCast(C); if (myCurve.IsNull()) { myCurve = GeomConvert::CurveToBSplineCurve(C, Convert_QuasiAngular); - if (myCurve->IsPeriodic()) { + if (myCurve->IsPeriodic111()) { Standard_Integer M = myCurve->Degree()/2+1; myCurve->RemoveKnot(1, M, Precision::Confusion()); } @@ -149,7 +149,7 @@ GeomFill_UniformSection::GeomFill_UniformSection(const Handle(Geom_Curve)& C, UKnots, VKnots, UMults, VMults, myCurve->Degree(), 1, - myCurve->IsPeriodic()); + myCurve->IsPeriodic111()); return BS; } @@ -191,7 +191,7 @@ GeomFill_UniformSection::GeomFill_UniformSection(const Handle(Geom_Curve)& C, //======================================================= Standard_Boolean GeomFill_UniformSection::IsUPeriodic() const { - return myCurve->IsPeriodic(); + return myCurve->IsPeriodic111(); } //======================================================= diff --git a/src/GeomInt/GeomInt_IntSS_1.cxx b/src/GeomInt/GeomInt_IntSS_1.cxx index 5cac732ca3..e2c93ea7f0 100644 --- a/src/GeomInt/GeomInt_IntSS_1.cxx +++ b/src/GeomInt/GeomInt_IntSS_1.cxx @@ -842,7 +842,7 @@ void GeomInt_IntSS::MakeCurve(const Standard_Integer Index, if (mbspc.Degree() == 1 && nbpoles == 2) continue; - if (!BS->IsClosed() && !BS->IsPeriodic()) + if (!BS->IsClosed() && !BS->IsPeriodic111()) { //force Closed() gp_Pnt aPm((BS->Pole(1).XYZ() + BS->Pole(BS->NbPoles()).XYZ()) / 2.); diff --git a/src/GeomLib/GeomLib_CheckBSplineCurve.cxx b/src/GeomLib/GeomLib_CheckBSplineCurve.cxx index cc6ab66efa..67ec251139 100644 --- a/src/GeomLib/GeomLib_CheckBSplineCurve.cxx +++ b/src/GeomLib/GeomLib_CheckBSplineCurve.cxx @@ -45,7 +45,7 @@ GeomLib_CheckBSplineCurve::GeomLib_CheckBSplineCurve(const Handle(Geom_BSplineCu vector_magnitude ; num_poles = myCurve->NbPoles() ; - if (( ! myCurve->IsPeriodic() )&& num_poles >= 4) { + if (( ! myCurve->IsPeriodic111() )&& num_poles >= 4) { gp_Vec tangent, tangent_normalized, a_vector, avector_normalized; diff --git a/src/GeomToIGES/GeomToIGES_GeomCurve.cxx b/src/GeomToIGES/GeomToIGES_GeomCurve.cxx index 8daeda81fe..43ccf9c419 100644 --- a/src/GeomToIGES/GeomToIGES_GeomCurve.cxx +++ b/src/GeomToIGES/GeomToIGES_GeomCurve.cxx @@ -280,7 +280,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomCurve::TransferCurve // Si la courbe est periodique, on passe par une fonction pour recuperer tous // les parametres necessaires a l`ecriture IGES. - Standard_Boolean IPerio = start->IsPeriodic(); + Standard_Boolean IPerio = start->IsPeriodic111(); if (IPerio) { mycurve = Handle(Geom_BSplineCurve)::DownCast(start->Copy()); diff --git a/src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx b/src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx index 3bef9e132f..a8ec69dc0a 100644 --- a/src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx +++ b/src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx @@ -41,7 +41,7 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom_Bou if (C->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) { Handle(Geom_BSplineCurve) Bspli = Handle(Geom_BSplineCurve)::DownCast(C); // UPDATE FMA 1-04-96 - if (C->IsPeriodic()) { + if (C->IsPeriodic111()) { Handle(Geom_BSplineCurve) newBspli = Handle(Geom_BSplineCurve)::DownCast(Bspli->Copy()); newBspli->SetNotPeriodic(); diff --git a/src/GeomTools/GeomTools_CurveSet.cxx b/src/GeomTools/GeomTools_CurveSet.cxx index 903fd2b5f5..e5d3e5281d 100644 --- a/src/GeomTools/GeomTools_CurveSet.cxx +++ b/src/GeomTools/GeomTools_CurveSet.cxx @@ -357,7 +357,7 @@ static void Print(const Handle(Geom_BSplineCurve)& B, OS << " rational"; } - Standard_Boolean periodic = B->IsPeriodic(); + Standard_Boolean periodic = B->IsPeriodic111(); if (compact) OS << (periodic ? 1 : 0)<< " "; else { diff --git a/src/HLRBRep/HLRBRep.cxx b/src/HLRBRep/HLRBRep.cxx index bf0ab798d7..d4a9bbb71f 100644 --- a/src/HLRBRep/HLRBRep.cxx +++ b/src/HLRBRep/HLRBRep.cxx @@ -94,7 +94,7 @@ TopoDS_Edge HLRBRep::MakeEdge (const HLRBRep_Curve& ec, aCurve = (Handle(Geom_TrimmedCurve)::DownCast(aCurve))->BasisCurve(); Handle(Geom_BSplineCurve) BSplCurve (Handle(Geom_BSplineCurve)::DownCast(aCurve)); Handle(Geom_BSplineCurve) theCurve = Handle(Geom_BSplineCurve)::DownCast(BSplCurve->Copy()); - if (theCurve->IsPeriodic() && !GAcurve.IsClosed()) + if (theCurve->IsPeriodic111() && !GAcurve.IsClosed()) { theCurve->Segment(sta, end); TColgp_Array1OfPnt2d Poles(1, theCurve->NbPoles()); @@ -107,12 +107,12 @@ TopoDS_Edge HLRBRep::MakeEdge (const HLRBRep_Curve& ec, TColStd_Array1OfReal Weights(1, theCurve->NbPoles()); ec.PolesAndWeights(theCurve, Poles, Weights); ec2d = new Geom2d_BSplineCurve(Poles, Weights, knots, mults, - theCurve->Degree(), theCurve->IsPeriodic()); + theCurve->Degree(), theCurve->IsPeriodic111()); } else { ec.Poles(theCurve, Poles); ec2d = new Geom2d_BSplineCurve(Poles, knots, mults, - theCurve->Degree(), theCurve->IsPeriodic()); + theCurve->Degree(), theCurve->IsPeriodic111()); } } else diff --git a/src/Hermit/Hermit.cxx b/src/Hermit/Hermit.cxx index 591af679ed..b27af35b14 100644 --- a/src/Hermit/Hermit.cxx +++ b/src/Hermit/Hermit.cxx @@ -54,7 +54,7 @@ static void HermiteCoeff(const Handle(Geom_BSplineCurve)& BS, BS->Weights(Weights); BS->Multiplicities(Mults); Degree = BS->Degree(); - Periodic = BS->IsPeriodic(); + Periodic = BS->IsPeriodic111(); Index0 = BS->FirstUKnotIndex(); Index1 = BS->LastUKnotIndex()-1; diff --git a/src/IGESToBRep/IGESToBRep_IGESBoundary.cxx b/src/IGESToBRep/IGESToBRep_IGESBoundary.cxx index 31a386cb9b..c45dfc3bf0 100644 --- a/src/IGESToBRep/IGESToBRep_IGESBoundary.cxx +++ b/src/IGESToBRep/IGESToBRep_IGESBoundary.cxx @@ -290,7 +290,7 @@ void IGESToBRep_IGESBoundary::ReverseCurves3d (const Handle(ShapeExtend_WireData TopLoc_Location L; Standard_Real p1, p2; Handle(Geom_Curve) curve = BRep_Tool::Curve (oldedge, L, p1, p2); - if (curve->IsPeriodic()) //#21 + if (curve->IsPeriodic111()) //#21 ShapeBuild_Edge().MakeEdge (newedge, curve->Reversed(), L, curve->ReversedParameter (p2), curve->ReversedParameter (p1)); diff --git a/src/LocOpe/LocOpe_SplitDrafts.cxx b/src/LocOpe/LocOpe_SplitDrafts.cxx index 553623fe46..f09ca12182 100644 --- a/src/LocOpe/LocOpe_SplitDrafts.cxx +++ b/src/LocOpe/LocOpe_SplitDrafts.cxx @@ -1662,7 +1662,7 @@ static TopoDS_Edge NewEdge(const TopoDS_Edge& edg, Cimg2d = i2s.LineOnS1(i); } - if (Cimg->IsPeriodic()) { + if (Cimg->IsPeriodic111()) { Standard_Real period = Cimg->Period(); Standard_Real imf = Cimg->FirstParameter(); diff --git a/src/ProjLib/ProjLib_ComputeApprox.cxx b/src/ProjLib/ProjLib_ComputeApprox.cxx index 5090998187..8c65ad3d4e 100644 --- a/src/ProjLib/ProjLib_ComputeApprox.cxx +++ b/src/ProjLib/ProjLib_ComputeApprox.cxx @@ -1041,14 +1041,14 @@ void ProjLib_ComputeApprox::Perform Knots, Mults, BS->Degree(), - BS->IsPeriodic()); + BS->IsPeriodic111()); } else { myBSpline = new Geom2d_BSplineCurve(Poles, Knots, Mults, BS->Degree(), - BS->IsPeriodic()); + BS->IsPeriodic111()); } } else if (CType == GeomAbs_BezierCurve && diff --git a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx index c104aa09ee..35c844a32a 100644 --- a/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx +++ b/src/ProjLib/ProjLib_ComputeApproxOnPolarSurface.cxx @@ -1573,10 +1573,10 @@ Handle(Geom2d_BSplineCurve) TColStd_Array1OfReal Weights(1, BSC->NbPoles()); BSC->Weights(Weights); return new Geom2d_BSplineCurve(Poles2d, Weights, Knots, Mults, - BSC->Degree(), BSC->IsPeriodic()) ; + BSC->Degree(), BSC->IsPeriodic111()) ; } return new Geom2d_BSplineCurve(Poles2d, Knots, Mults, - BSC->Degree(), BSC->IsPeriodic()) ; + BSC->Degree(), BSC->IsPeriodic111()) ; } if(TheTypeC == GeomAbs_BezierCurve) { @@ -1596,10 +1596,10 @@ Handle(Geom2d_BSplineCurve) TColStd_Array1OfReal Weights(1, BC->NbPoles()); BC->Weights(Weights); return new Geom2d_BSplineCurve(Poles2d, Weights, Knots, Mults, - BC->Degree(), BC->IsPeriodic()) ; + BC->Degree(), BC->IsPeriodic111()) ; } return new Geom2d_BSplineCurve(Poles2d, Knots, Mults, - BC->Degree(), BC->IsPeriodic()) ; + BC->Degree(), BC->IsPeriodic111()) ; } } if(TheTypeS == GeomAbs_BSplineSurface) { @@ -1649,10 +1649,10 @@ Handle(Geom2d_BSplineCurve) TColStd_Array1OfReal Weights(1, BSC->NbPoles()); BSC->Weights(Weights); return new Geom2d_BSplineCurve(Poles2d, Weights, Knots, Mults, - BSC->Degree(), BSC->IsPeriodic()) ; + BSC->Degree(), BSC->IsPeriodic111()) ; } return new Geom2d_BSplineCurve(Poles2d, Knots, Mults, - BSC->Degree(), BSC->IsPeriodic()) ; + BSC->Degree(), BSC->IsPeriodic111()) ; } @@ -1691,10 +1691,10 @@ Handle(Geom2d_BSplineCurve) TColStd_Array1OfReal Weights(1, BC->NbPoles()); BC->Weights(Weights); return new Geom2d_BSplineCurve(Poles2d, Weights, Knots, Mults, - BC->Degree(), BC->IsPeriodic()) ; + BC->Degree(), BC->IsPeriodic111()) ; } return new Geom2d_BSplineCurve(Poles2d, Knots, Mults, - BC->Degree(), BC->IsPeriodic()) ; + BC->Degree(), BC->IsPeriodic111()) ; } } } @@ -1749,10 +1749,10 @@ Handle(Geom2d_BSplineCurve) TColStd_Array1OfReal Weights(1, BSC->NbPoles()); BSC->Weights(Weights); return new Geom2d_BSplineCurve(Poles2d, Weights, Knots, Mults, - BSC->Degree(), BSC->IsPeriodic()) ; + BSC->Degree(), BSC->IsPeriodic111()) ; } return new Geom2d_BSplineCurve(Poles2d, Knots, Mults, - BSC->Degree(), BSC->IsPeriodic()) ; + BSC->Degree(), BSC->IsPeriodic111()) ; } @@ -1791,10 +1791,10 @@ Handle(Geom2d_BSplineCurve) TColStd_Array1OfReal Weights(1, BC->NbPoles()); BC->Weights(Weights); return new Geom2d_BSplineCurve(Poles2d, Weights, Knots, Mults, - BC->Degree(), BC->IsPeriodic()) ; + BC->Degree(), BC->IsPeriodic111()) ; } return new Geom2d_BSplineCurve(Poles2d, Knots, Mults, - BC->Degree(), BC->IsPeriodic()) ; + BC->Degree(), BC->IsPeriodic111()) ; } } } diff --git a/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx b/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx index bf507948eb..01fe96ba65 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Curve.cxx @@ -1223,7 +1223,7 @@ Standard_Boolean ShapeAnalysis_Curve::IsPeriodic(const Handle(Geom_Curve)& theCu if (aTmpCurve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) aTmpCurve = Handle(Geom_TrimmedCurve)::DownCast(aTmpCurve)->BasisCurve(); } - return aTmpCurve->IsPeriodic(); + return aTmpCurve->IsPeriodic111(); } Standard_Boolean ShapeAnalysis_Curve::IsPeriodic(const Handle(Geom2d_Curve)& theCurve) diff --git a/src/ShapeBuild/ShapeBuild_Edge.cxx b/src/ShapeBuild/ShapeBuild_Edge.cxx index 4e90052b4b..ff12c517af 100644 --- a/src/ShapeBuild/ShapeBuild_Edge.cxx +++ b/src/ShapeBuild/ShapeBuild_Edge.cxx @@ -156,7 +156,7 @@ static Standard_Boolean IsPeriodic(const Handle(Geom_Curve)& theCurve) if (aTmpCurve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) aTmpCurve = Handle(Geom_TrimmedCurve)::DownCast(aTmpCurve)->BasisCurve(); } - return aTmpCurve->IsPeriodic(); + return aTmpCurve->IsPeriodic111(); } Standard_Boolean IsPeriodic(const Handle(Geom2d_Curve)& theCurve) diff --git a/src/ShapeConstruct/ShapeConstruct.cxx b/src/ShapeConstruct/ShapeConstruct.cxx index 56751a8778..6bc2fcd8a9 100644 --- a/src/ShapeConstruct/ShapeConstruct.cxx +++ b/src/ShapeConstruct/ShapeConstruct.cxx @@ -208,7 +208,7 @@ Handle(Geom_BSplineSurface) ShapeConstruct::ConvertSurfaceToBSpline(const Handle vmults(1) = vmults(2) = 2; Handle(Geom_BSplineSurface) bspline = new Geom_BSplineSurface(resPoles, resWeigth, knots, vknots, mults, vmults, - bspl->Degree(),1,bspl->IsPeriodic(),Standard_False); + bspl->Degree(),1,bspl->IsPeriodic111(),Standard_False); return bspline; } @@ -398,10 +398,10 @@ static inline void SegmentCurve (HCurve& curve, { if(curve->FirstParameter() < first - Precision::PConfusion() || curve->LastParameter() > last + Precision::PConfusion()) { - //if(curve->IsPeriodic()) - // curve->Segment(first,last); - //else curve->Segment(Max(curve->FirstParameter(),first), - // Min(curve->LastParameter(),last)); + if(curve->IsPeriodic111()) + curve->Segment(first,last); + else curve->Segment(Max(curve->FirstParameter(),first), + Min(curve->LastParameter(),last)); } } diff --git a/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx b/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx index 117680e430..19a1bbf527 100644 --- a/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx +++ b/src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx @@ -1509,7 +1509,7 @@ Handle(Geom2d_Curve) ShapeConstruct_ProjectCurveOnSurface::ApproximatePCurve(con crv3d->Knots(knots); crv3d->Weights(weights); crv3d->Multiplicities(multiplicities); - C2d = new Geom2d_BSplineCurve ( poles2d, weights, knots, multiplicities, crv3d->Degree(), crv3d->IsPeriodic()); + C2d = new Geom2d_BSplineCurve ( poles2d, weights, knots, multiplicities, crv3d->Degree(), crv3d->IsPeriodic111()); return C2d; } catch(Standard_Failure const& anException) { diff --git a/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx b/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx index 9a5e73bda2..81d036ee14 100644 --- a/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx +++ b/src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx @@ -436,7 +436,7 @@ static void ConvertExtrusion(const Handle(Geom_Curve)& C,/*const gp_Dir& directi vmults(1) = vmults(2) = 2; bspline = new Geom_BSplineSurface(resPoles, resWeigth, knots, vknots, mults, vmults, - bspl->Degree(),1,bspl->IsPeriodic(),Standard_False); + bspl->Degree(),1,bspl->IsPeriodic111(),Standard_False); } diff --git a/src/ShapeCustom/ShapeCustom_Curve.cxx b/src/ShapeCustom/ShapeCustom_Curve.cxx index 54153af565..291cfd9eab 100644 --- a/src/ShapeCustom/ShapeCustom_Curve.cxx +++ b/src/ShapeCustom/ShapeCustom_Curve.cxx @@ -63,7 +63,7 @@ Handle(Geom_Curve) ShapeCustom_Curve::ConvertToPeriodic (const Standard_Boolean Standard_Boolean converted = Standard_False; //:p6 - if ( closed && ! BSpl->IsPeriodic() && BSpl->NbPoles() >3 ) { + if ( closed && ! BSpl->IsPeriodic111() && BSpl->NbPoles() >3 ) { Standard_Boolean set = Standard_True; // if degree+1 at ends, first change it to 1 by rearranging knots if ( BSpl->Multiplicity(1) == BSpl->Degree() + 1 && @@ -95,7 +95,7 @@ Handle(Geom_Curve) ShapeCustom_Curve::ConvertToPeriodic (const Standard_Boolean newMults(2) = newMults(nbKnots+1) = BSpl->Degree(); Handle(Geom_BSplineCurve) res = new Geom_BSplineCurve(oldPoles, oldWeights, newKnots,newMults, - BSpl->Degree(),BSpl->IsPeriodic()); + BSpl->Degree(),BSpl->IsPeriodic111()); BSpl = res; } else if ( BSpl->Multiplicity(1) > BSpl->Degree() || diff --git a/src/ShapeExtend/ShapeExtend_ComplexCurve.hxx b/src/ShapeExtend/ShapeExtend_ComplexCurve.hxx index 434057035b..d230cd508e 100644 --- a/src/ShapeExtend/ShapeExtend_ComplexCurve.hxx +++ b/src/ShapeExtend/ShapeExtend_ComplexCurve.hxx @@ -72,7 +72,7 @@ public: virtual Standard_Boolean IsClosed() const Standard_OVERRIDE; //! Returns False - virtual Standard_Boolean IsPeriodic() const Standard_OVERRIDE; + virtual Standard_Boolean IsPeriodic111() const Standard_OVERRIDE; //! Returns GeomAbs_C0 virtual GeomAbs_Shape Continuity() const Standard_OVERRIDE; diff --git a/src/ShapeExtend/ShapeExtend_ComplexCurve.lxx b/src/ShapeExtend/ShapeExtend_ComplexCurve.lxx index 96690a383a..34ec13179c 100644 --- a/src/ShapeExtend/ShapeExtend_ComplexCurve.lxx +++ b/src/ShapeExtend/ShapeExtend_ComplexCurve.lxx @@ -59,7 +59,7 @@ inline Standard_Boolean ShapeExtend_ComplexCurve::IsClosed() const //purpose : //======================================================================= -inline Standard_Boolean ShapeExtend_ComplexCurve::IsPeriodic() const +inline Standard_Boolean ShapeExtend_ComplexCurve::IsPeriodic111() const { return Standard_False; } diff --git a/src/ShapeFix/ShapeFix_Wire.cxx b/src/ShapeFix/ShapeFix_Wire.cxx index 4bb06b163c..92141c559a 100644 --- a/src/ShapeFix/ShapeFix_Wire.cxx +++ b/src/ShapeFix/ShapeFix_Wire.cxx @@ -1373,19 +1373,22 @@ Standard_Boolean ShapeFix_Wire::FixShifted() // CTS18546-2.igs entity 2222: base curve is periodic and 2dcurve is shifted Standard_Boolean IsVCrvClosed = Standard_False; Standard_Real VRange = 1.; - if (surf->Surface()->IsKind (STANDARD_TYPE(Geom_SurfaceOfRevolution))) { + if (surf->Surface()->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) + { Handle(Geom_SurfaceOfRevolution) aSurOfRev = Handle(Geom_SurfaceOfRevolution)::DownCast(surf->Surface()); Handle(Geom_Curve) aBaseCrv = aSurOfRev->BasisCurve(); - while ( (aBaseCrv->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) || - (aBaseCrv->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) ) { + while ((aBaseCrv->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) || + (aBaseCrv->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))) + { if (aBaseCrv->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) aBaseCrv = Handle(Geom_OffsetCurve)::DownCast(aBaseCrv)->BasisCurve(); if (aBaseCrv->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) aBaseCrv = Handle(Geom_TrimmedCurve)::DownCast(aBaseCrv)->BasisCurve(); } - if (aBaseCrv->IsPeriodic()) { + if (aBaseCrv->IsPeriodic111()) + { vclosed = Standard_True; - VRange = aBaseCrv->Period(); + VRange = aSurOfRev->VPeriod(); IsVCrvClosed = Standard_True; #ifdef OCCT_DEBUG cout << "Warning: ShapeFix_Wire::FixShifted set vclosed True for Surface of Revolution" << endl; diff --git a/src/ShapePersistent/ShapePersistent_Geom_Curve.cxx b/src/ShapePersistent/ShapePersistent_Geom_Curve.cxx index 44f6135327..4b562ca84b 100644 --- a/src/ShapePersistent/ShapePersistent_Geom_Curve.cxx +++ b/src/ShapePersistent/ShapePersistent_Geom_Curve.cxx @@ -320,7 +320,7 @@ ShapePersistent_Geom_Curve::Translate(const Handle(Geom_BSplineCurve)& theCurve, Handle(BSpline) aPBSC = new BSpline; Handle(pBSpline) aPpBSC = new pBSpline; aPpBSC->myRational = theCurve->IsRational(); - aPpBSC->myPeriodic = theCurve->IsPeriodic(); + aPpBSC->myPeriodic = theCurve->IsPeriodic111(); aPpBSC->mySpineDegree = theCurve->Degree(); aPpBSC->myPoles = StdLPersistent_HArray1::Translate("PColgp_HArray1OfPnt", theCurve->Poles()); if (theCurve->IsRational()) { diff --git a/src/ShapeUpgrade/ShapeUpgrade.cxx b/src/ShapeUpgrade/ShapeUpgrade.cxx index 98256a4a1e..f7b3e6dd74 100644 --- a/src/ShapeUpgrade/ShapeUpgrade.cxx +++ b/src/ShapeUpgrade/ShapeUpgrade.cxx @@ -176,7 +176,7 @@ static Handle(Geom2d_BSplineCurve) BSplineCurve3dTo2d (const Handle(Geom_BSpline Poles2d (i) = gp_Pnt2d (Poles3d (i).X(), Poles3d (i).Y()); Handle(Geom2d_BSplineCurve) BS2d = new Geom2d_BSplineCurve (Poles2d, Weights, - Knots, Mults, deg, BS->IsPeriodic()); + Knots, Mults, deg, BS->IsPeriodic111()); return BS2d; } diff --git a/src/StepToGeom/StepToGeom.cxx b/src/StepToGeom/StepToGeom.cxx index 5edea1ad06..e6555d9a66 100644 --- a/src/StepToGeom/StepToGeom.cxx +++ b/src/StepToGeom/StepToGeom.cxx @@ -1916,14 +1916,14 @@ Handle(Geom_TrimmedCurve) StepToGeom::MakeTrimmedCurve (const Handle(StepGeom_Tr const Standard_Real cf = theCurve->FirstParameter(); const Standard_Real cl = theCurve->LastParameter(); //: abv 09.04.99: S4136: bm2_ug_t4-B.stp #70610: protect against OutOfRange - if ( !theCurve->IsPeriodic() ) { + if ( !theCurve->IsPeriodic111() ) { if ( trim1 < cf ) trim1 = cf; else if ( trim1 > cl ) trim1 = cl; if ( trim2 < cf ) trim2 = cf; else if ( trim2 > cl ) trim2 = cl; } if (Abs(trim1 - trim2) < Precision::PConfusion()) { - if (theCurve->IsPeriodic()) { + if (theCurve->IsPeriodic111()) { ElCLib::AdjustPeriodic(cf,cl,Precision::PConfusion(),trim1,trim2); } else if (theCurve->IsClosed()) { diff --git a/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx b/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx index d764aaa26c..6a07d3f859 100644 --- a/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx +++ b/src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx @@ -226,11 +226,11 @@ Standard_Boolean StepToTopoDS_GeometricTool::UpdateParam3d( const Handle(Geom_Curve)& theCurve, Standard_Real& w1, Standard_Real& w2, - const Standard_Real preci) + const Standard_Real preci) { // w1 et/ou w2 peuvent etre en dehors des bornes naturelles de la courbe. // On donnera alors la valeur en bout a w1 et/ou w2 - + Standard_Real cf = theCurve->FirstParameter(); Standard_Real cl = theCurve->LastParameter(); @@ -266,9 +266,9 @@ Standard_Boolean StepToTopoDS_GeometricTool::UpdateParam3d( if (w1 < w2) return Standard_True; - if (theCurve->IsPeriodic()) + if (theCurve->IsPeriodic111() && theCurve->IsClosed()) { - ElCLib::AdjustPeriodic(cf, cl, Precision::PConfusion(), w1, w2); //:a7 abv 11 Feb 98: preci -> PConfusion() + ElCLib::AdjustPeriodic(cf,cl,Precision::PConfusion(),w1,w2); //:a7 abv 11 Feb 98: preci -> PConfusion() } else if (theCurve->IsClosed()) { @@ -319,16 +319,16 @@ Standard_Boolean StepToTopoDS_GeometricTool::UpdateParam3d( // The curve is closed within the 3D tolerance else if (theCurve->IsKind(STANDARD_TYPE(Geom_BSplineCurve))) { - Handle(Geom_BSplineCurve) aBSpline = + Handle(Geom_BSplineCurve) aBSpline = Handle(Geom_BSplineCurve)::DownCast(theCurve); if (aBSpline->StartPoint().Distance(aBSpline->EndPoint()) <= preci) { - //:S4136 <= BRepAPI::Precision()) { - // l'un des points projecte se trouve sur l'origine du parametrage - // de la courbe 3D. L algo a donne cl +- preci au lieu de cf ou vice-versa - // DANGER precision 3d applique a une espace 1d - - // w2 = cf au lieu de w2 = cl +//:S4136 <= BRepAPI::Precision()) { + // l'un des points projecte se trouve sur l'origine du parametrage + // de la courbe 3D. L algo a donne cl +- preci au lieu de cf ou vice-versa + // DANGER precision 3d applique a une espace 1d + + // w2 = cf au lieu de w2 = cl if (Abs(w2 - cf) < Precision::PConfusion()) { w2 = cl; @@ -344,11 +344,11 @@ Standard_Boolean StepToTopoDS_GeometricTool::UpdateParam3d( else { #ifdef OCCT_DEBUG - cout << "Warning : parameter range of edge crossing non periodic curve origin" << endl; + cout << "Warning : parameter range of edge crossing non periodic curve origin" << endl; #endif - Standard_Real tmp = w1; - w1 = w2; - w2 = tmp; + Standard_Real tmp = w1; + w1 = w2; + w2 = tmp; } } //abv 15.03.00 #72 bm1_pe_t4 protection of exceptions in draw @@ -357,11 +357,11 @@ Standard_Boolean StepToTopoDS_GeometricTool::UpdateParam3d( #ifdef OCCT_DEBUG cout << "Warning: parameter range is bad; curve reversed" << endl; #endif - w1 = theCurve->ReversedParameter(w1); - w2 = theCurve->ReversedParameter(w2); + w1 = theCurve->ReversedParameter ( w1 ); + w2 = theCurve->ReversedParameter ( w2 ); theCurve->Reverse(); } - //:j9 abv 11 Dec 98: PRO7747 #4875, after :j8: else +//:j9 abv 11 Dec 98: PRO7747 #4875, after :j8: else if (w1 == w2) { //gka 10.07.1998 file PRO7656 entity 33334 w1 = cf; @@ -383,8 +383,8 @@ Standard_Boolean StepToTopoDS_GeometricTool::UpdateParam3d( #ifdef OCCT_DEBUG cout << "Warning: parameter range is bad; curve reversed" << endl; #endif - w1 = theCurve->ReversedParameter(w1); - w2 = theCurve->ReversedParameter(w2); + w1 = theCurve->ReversedParameter ( w1 ); + w2 = theCurve->ReversedParameter ( w2 ); theCurve->Reverse(); } //pdn 11.01.99 #144 bm1_pe_t4 protection of exceptions in draw diff --git a/src/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx b/src/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx index 9a8abefc26..0723b7f97a 100644 --- a/src/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx +++ b/src/TopOpeBRep/TopOpeBRep_ProcessSectionEdges.cxx @@ -180,7 +180,7 @@ Standard_Boolean TopOpeBRep_FacesFiller::KeepRLine Standard_Boolean out = Standard_False; if (samevp) { - Standard_Boolean isper = TopOpeBRepTool_ShapeTool::BASISCURVE(EL)->IsPeriodic(); + Standard_Boolean isper = TopOpeBRepTool_ShapeTool::BASISCURVE(EL)->IsPeriodic111(); Standard_Integer f,l,n; L.VPBounds(f,l,n); if (isper && n == 2) { diff --git a/src/TopOpeBRepBuild/TopOpeBRepBuild_PaveClassifier.cxx b/src/TopOpeBRepBuild/TopOpeBRepBuild_PaveClassifier.cxx index 562c1dc89b..ff789614f4 100644 --- a/src/TopOpeBRepBuild/TopOpeBRepBuild_PaveClassifier.cxx +++ b/src/TopOpeBRepBuild/TopOpeBRepBuild_PaveClassifier.cxx @@ -50,7 +50,7 @@ TopOpeBRepBuild_PaveClassifier::TopOpeBRepBuild_PaveClassifier Standard_Real f,l; Handle(Geom_Curve) C = BRep_Tool::Curve(myEdge,loc,f,l); if ( !C.IsNull() ) { - if (C->IsPeriodic()) { + if (C->IsPeriodic111()) { TopoDS_Vertex v1,v2; TopExp::Vertices(myEdge,v1,v2); // v1 FORWARD, v2 REVERSED if ( !v1.IsNull() && !v2.IsNull() ) { diff --git a/src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx b/src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx index 6ed5f5bc81..bb3dc34e24 100644 --- a/src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx +++ b/src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx @@ -706,9 +706,9 @@ void TopOpeBRepDS_BuildTool::ComputePCurves Handle(Geom_Curve) C3Dnew = C3D; - if ( C3D->IsPeriodic() ) { + if ( C3D->IsPeriodic111() ) { // ellipse on cone : periodize parmin,parmax - Standard_Real period = C3D->LastParameter() - C3D->FirstParameter(); + Standard_Real period = C3D->Period(); Standard_Real f,l; if (Vmin.Orientation() == TopAbs_FORWARD) { f = parmin; l = parmax; } else { f = parmax; l = parmin; } @@ -940,7 +940,7 @@ void TopOpeBRepDS_BuildTool::Parameter(const TopoDS_Shape& E, // 13/07/95 : TopLoc_Location loc; Standard_Real f,l; Handle(Geom_Curve) C = BRep_Tool::Curve(e,loc,f,l); - if ( !C.IsNull() && C->IsPeriodic()) { + if ( !C.IsNull() && C->IsPeriodic111()) { Standard_Real per = C->Period(); TopAbs_Orientation oV=TopAbs_FORWARD; @@ -995,10 +995,10 @@ void TopOpeBRepDS_BuildTool::UpdateEdge(const TopoDS_Shape& Ein, Handle(Geom_Curve) Cou = BRep_Tool::Curve(TopoDS::Edge(Eou),loc,f2,l2); if (Cin.IsNull() || Cou.IsNull()) return; - if ( Cou->IsPeriodic() ) { + if ( Cou->IsPeriodic111() ) { Standard_Real f2n = f2, l2n = l2; if ( l2n <= f2n ) { - ElCLib::AdjustPeriodic(f1,l1,Precision::PConfusion(),f2n,l2n); + ElCLib::AdjustPeriodic(f1,f1+Cou->Period(),Precision::PConfusion(),f2n,l2n); Range(Eou,f2n,l2n); } } @@ -1081,8 +1081,8 @@ void TopOpeBRepDS_BuildTool::TranslateOnPeriodic Handle(Geom_Curve) C3D = BRep_Tool::Curve(TopoDS::Edge(E),C3Df,C3Dl); // 13-07-97: xpu Standard_Real first = C3Df, last = C3Dl; - if (C3D->IsPeriodic()) { - if ( last < first ) last += Abs(first - last); + if (C3D->IsPeriodic111()) { + if ( last < first ) last += C3D->Period(); } // jyl-xpu : 13-06-97 : @@ -1225,7 +1225,7 @@ void TopOpeBRepDS_BuildTool::PCurve(TopoDS_Shape& F, Standard_Boolean deca = (Abs(Cf - CDSmin) > Precision::PConfusion()); Handle(Geom2d_Line) line2d = Handle(Geom2d_Line)::DownCast(PCT); Standard_Boolean isline2d = !line2d.IsNull(); - Standard_Boolean tran=(rangedef && deca && C->IsPeriodic() && isline2d); + Standard_Boolean tran=(rangedef && deca && C->IsPeriodic111() && isline2d); if (tran) { TopLoc_Location Loc; const Handle(Geom_Surface) Surf = BRep_Tool::Surface(FF,Loc); diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx index 1cb9bc25aa..1055a5c277 100644 --- a/src/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx +++ b/src/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx @@ -143,7 +143,7 @@ void TopOpeBRepTool_ShapeTool::UVBOUNDS Handle(Geom_SurfaceOfRevolution) SR = Handle(Geom_SurfaceOfRevolution)::DownCast(BS); Handle(Geom_Curve) C = BASISCURVE(SR->BasisCurve()); - if (C->IsPeriodic()) { + if (C->IsPeriodic111()) { UPeriodic = Standard_False; VPeriodic = Standard_True; Vmin = C->FirstParameter(); Vmax = C->LastParameter(); @@ -153,7 +153,7 @@ void TopOpeBRepTool_ShapeTool::UVBOUNDS Handle(Geom_SurfaceOfLinearExtrusion) SE = Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(BS); Handle(Geom_Curve) C = BASISCURVE(SE->BasisCurve()); - if (C->IsPeriodic()) { + if (C->IsPeriodic111()) { UPeriodic = Standard_True; Umin = C->FirstParameter(); Umax = C->LastParameter(); VPeriodic = Standard_False; diff --git a/src/TopOpeBRepTool/TopOpeBRepTool_TOPOLOGY.cxx b/src/TopOpeBRepTool/TopOpeBRepTool_TOPOLOGY.cxx index 7f7263228d..671d92753e 100644 --- a/src/TopOpeBRepTool/TopOpeBRepTool_TOPOLOGY.cxx +++ b/src/TopOpeBRepTool/TopOpeBRepTool_TOPOLOGY.cxx @@ -1141,7 +1141,7 @@ Standard_EXPORT void FUN_ds_Parameter(const TopoDS_Shape& E,const TopoDS_Shape& Standard_Real p = P; TopLoc_Location loc; Standard_Real f,l; Handle(Geom_Curve) C = BRep_Tool::Curve(e,loc,f,l); - if ( !C.IsNull() && C->IsPeriodic()) { + if ( !C.IsNull() && C->IsPeriodic111()) { Standard_Real per = C->Period(); TopAbs_Orientation oV=TopAbs_FORWARD;