]> OCCT Git - occt-copy.git/commitdiff
src/ShapeAnalysis/ShapeAnalysis_Curve.cxx
authornbv <nbv@opencascade.com>
Wed, 13 Dec 2017 11:23:17 +0000 (14:23 +0300)
committernbv <nbv@opencascade.com>
Mon, 10 Dec 2018 15:11:24 +0000 (18:11 +0300)
Conflicts:
src/ShapeAnalysis/ShapeAnalysis_Curve.cxx

src/ShapeAnalysis/ShapeAnalysis_Curve.cxx
src/ShapeAnalysis/ShapeAnalysis_Curve.hxx
src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx
src/ShapeFix/ShapeFix_Edge.cxx
src/ShapeFix/ShapeFix_EdgeProjAux.cxx
src/ShapeFix/ShapeFix_Wire_1.cxx
src/ShapeUpgrade/ShapeUpgrade_SplitCurve2d.cxx
src/ShapeUpgrade/ShapeUpgrade_SplitCurve3d.cxx

index 01fe96ba65cabf7782df1fa39a1587bac5a8f270..69004a07e5b47654f89cc01cfd8a1266e52cce05 100644 (file)
@@ -522,7 +522,8 @@ Standard_Boolean ShapeAnalysis_Curve::ValidateRange (const Handle(Geom_Curve)& t
   }
 
   // 15.11.2002 PTV OCC966
-  if (ShapeAnalysis_Curve::IsPeriodic(theCurve)) {
+  if(theCurve->IsPeriodic111())
+  {
     ElCLib::AdjustPeriodic(cf,cl,Precision::PConfusion(),First,Last); //:a7 abv 11 Feb 98: preci -> PConfusion()
   }
   else if (First < Last) {
@@ -1205,39 +1206,3 @@ Standard_Boolean ShapeAnalysis_Curve::IsClosed(const Handle(Geom_Curve)& theCurv
 
   return (aClosedVal <= preci2);
 }
-//=======================================================================
-//function : IsPeriodic
-//purpose  : OCC996
-//=======================================================================
-
-Standard_Boolean ShapeAnalysis_Curve::IsPeriodic(const Handle(Geom_Curve)& theCurve)
-{
-  // 15.11.2002 PTV OCC966
-  // remove regressions in DE tests (diva, divb, divc, toe3) in KAS:dev
-  // ask IsPeriodic on BasisCurve
-  Handle(Geom_Curve) aTmpCurve = theCurve;
-  while ( (aTmpCurve->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) ||
-          (aTmpCurve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) ) {
-    if (aTmpCurve->IsKind(STANDARD_TYPE(Geom_OffsetCurve)))
-      aTmpCurve = Handle(Geom_OffsetCurve)::DownCast(aTmpCurve)->BasisCurve();
-    if (aTmpCurve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
-      aTmpCurve = Handle(Geom_TrimmedCurve)::DownCast(aTmpCurve)->BasisCurve();
-  }
-  return aTmpCurve->IsPeriodic111();
-}
-
-Standard_Boolean ShapeAnalysis_Curve::IsPeriodic(const Handle(Geom2d_Curve)& theCurve)
-{
-  // 15.11.2002 PTV OCC966
-  // remove regressions in DE tests (diva, divb, divc, toe3) in KAS:dev
-  // ask IsPeriodic on BasisCurve
-  Handle(Geom2d_Curve) aTmpCurve = theCurve;
-  while ( (aTmpCurve->IsKind(STANDARD_TYPE(Geom2d_OffsetCurve))) ||
-          (aTmpCurve->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) ) {
-    if (aTmpCurve->IsKind(STANDARD_TYPE(Geom2d_OffsetCurve)))
-      aTmpCurve = Handle(Geom2d_OffsetCurve)::DownCast(aTmpCurve)->BasisCurve();
-    if (aTmpCurve->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
-      aTmpCurve = Handle(Geom2d_TrimmedCurve)::DownCast(aTmpCurve)->BasisCurve();
-  }
-  return aTmpCurve->IsPeriodic111();
-}
index cacecdac289c0f1b197899097848c36b7c17381e..c19f1e27e844df64e98758836cc1efed0db002ec 100644 (file)
@@ -131,18 +131,6 @@ public:
   //! If <preci> < 0 then Precision::Confusion is used.
   Standard_EXPORT static Standard_Boolean IsClosed (const Handle(Geom_Curve)& curve, const Standard_Real preci = -1);
   
-  //! This method was implemented as fix for changes in trimmed curve
-  //! behaviour. For the moment trimmed curve returns false anyway.
-  //! So it is necessary to adapt all Data exchange tools for this behaviour.
-  //! Current implementation takes into account that curve may be offset.
-  Standard_EXPORT static Standard_Boolean IsPeriodic (const Handle(Geom_Curve)& curve);
-  
-  //! The same as for Curve3d.
-  Standard_EXPORT static Standard_Boolean IsPeriodic (const Handle(Geom2d_Curve)& curve);
-
-
-
-
 protected:
 
 
index e88e2836676a35d867cb1716fe90335a9d9d4f16..82bea749c403b615098467470d7f9f1daeb4af9d 100644 (file)
@@ -999,7 +999,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve(const Handle(Geom_
       Handle(Geom_Curve) aCurve1;
       Standard_Real pf =aCurve->FirstParameter(), pl =  aCurve->LastParameter();
       // 15.11.2002 PTV OCC966
-      if(ShapeAnalysis_Curve::IsPeriodic(aCurve) && (First != Last))  aCurve1 = new Geom_TrimmedCurve(aCurve,First,Last);
+      if(aCurve->IsPeriodic111() && (First != Last))  aCurve1 = new Geom_TrimmedCurve(aCurve, First, Last);
       else if(pf < (First - Precision::PConfusion()) || 
         pl > (Last + Precision::PConfusion())) {
           Standard_Real F = Max(First,pf),
@@ -1308,7 +1308,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertCurve2d(const Handle(Geo
       Handle(Geom2d_Curve) aCurve1;
       Standard_Real pf =aCurve->FirstParameter(), pl =  aCurve->LastParameter();
       // 15.11.2002 PTV OCC966
-      if(ShapeAnalysis_Curve::IsPeriodic(aCurve) && (First != Last)) aCurve1 = new Geom2d_TrimmedCurve(aCurve,First,Last);
+      if(aCurve->IsPeriodic111() && (First != Last)) aCurve1 = new Geom2d_TrimmedCurve(aCurve,First,Last);
       else if(aCurve->FirstParameter() < (First - Precision::PConfusion())  || 
         aCurve->LastParameter() > (Last + Precision::PConfusion())) {
           Standard_Real F = Max(First,pf),
index 46fbfbd943b800059afd926d452ca4df537f8fbc..e72a0525018e1731217cbd1fa62e2c312ac953c1 100644 (file)
@@ -385,7 +385,8 @@ static Handle(Geom2d_Curve) TranslatePCurve (const Handle(Geom_Surface)& aSurf,
             oldFirst = geometric_representation_ptr->First();
            oldLast = geometric_representation_ptr->Last();
             // 15.11.2002 PTV OCC966
-           if(ShapeAnalysis_Curve::IsPeriodic(Curve2dPtr)) {
+      if(Curve2dPtr->IsPeriodic111())
+      {
              Handle(Geom2d_TrimmedCurve) tc = new Geom2d_TrimmedCurve(Curve2dPtr,oldFirst,oldLast);
              Standard_Real shift = tc->FirstParameter()-oldFirst;
              oldFirst += shift;
index 2cf582108629d0fba51e52967e725f5d81159974..c224233bb46a4c4f8e3d04a1a54d541aadf31a87 100644 (file)
@@ -578,7 +578,8 @@ void ShapeFix_EdgeProjAux::UpdateParam2d (const Handle(Geom2d_Curve)& theCurve2d
   Standard_Real preci2d = Precision::PConfusion(); //:S4136: Parametric(preci, 0.01);
 
   // 15.11.2002 PTV OCC966
-  if (ShapeAnalysis_Curve::IsPeriodic(theCurve2d)) {
+  if(theCurve2d->IsPeriodic111())
+  {
     ElCLib::AdjustPeriodic(cf,cl,preci2d,myFirstParam,myLastParam);
   }
   else if (theCurve2d->IsClosed()) {
index 5c00a23f4976e0754ff8a4743a7eb64dcad26167..dde0a6fc7f0a3ecac026c064d3fe5c9aa18cebee 100644 (file)
@@ -165,7 +165,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c,
                                         const Standard_Real param)
 {
   // 15.11.2002 PTV OCC966
-  if (ShapeAnalysis_Curve::IsPeriodic(c)) 
+  if (c->IsPeriodic111()) 
   {
     Standard_Real T = c->Period();
     Standard_Real shift = -IntegerPart(first/T)*T; if (first<0.) shift += T;
@@ -360,7 +360,7 @@ static Standard_Real AdjustOnPeriodic3d (const Handle(Geom_Curve)& c,
         {
           OCC_CATCH_SIGNALS
           // 15.11.2002 PTV OCC966
-         if(!ShapeAnalysis_Curve::IsPeriodic(c))
+         if(!c->IsPeriodic111())
            tc = new Geom_TrimmedCurve(c,Max(first,c->FirstParameter()),Min(last,c->LastParameter()));
          else tc = new Geom_TrimmedCurve(c,first,last);
          bsp = GeomConvert::CurveToBSplineCurve(tc);
@@ -755,7 +755,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc,
                                         const Standard_Real param)
 {
   // 15.11.2002 PTV OCC966
-  if (ShapeAnalysis_Curve::IsPeriodic(pc)) 
+  if (pc->IsPeriodic111()) 
   {
     Standard_Real T = pc->Period();
     Standard_Real shift = -IntegerPart(first/T)*T; if (first<0.) shift += T;
@@ -942,7 +942,7 @@ static Standard_Real AdjustOnPeriodic2d (const Handle(Geom2d_Curve)& pc,
           OCC_CATCH_SIGNALS
          Handle(Geom2d_Curve) c;
           // 15.11.2002 PTV OCC966
-         if(!ShapeAnalysis_Curve::IsPeriodic(pc))
+         if(!pc->IsPeriodic111())
            c = new Geom2d_TrimmedCurve(pc,Max(first,pc->FirstParameter()),Min(last,pc->LastParameter()));
          else 
            c = new Geom2d_TrimmedCurve(pc,first,last);
index c533c518a703780c73444de3bc35eaebcbdeab1d..6152f0c30ac822c10f3e86dba08ee4fd49c410a5 100644 (file)
@@ -72,7 +72,7 @@ ShapeUpgrade_SplitCurve2d::ShapeUpgrade_SplitCurve2d()
   if(aCurve->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve))) 
     aCurve=Handle(Geom2d_TrimmedCurve)::DownCast(aCurve)->BasisCurve();
   // 15.11.2002 PTV OCC966
-  if(!ShapeAnalysis_Curve::IsPeriodic(C)) {
+  if(!C->IsPeriodic111()) {
     Standard_Real fP = aCurve->FirstParameter();
     Standard_Real lP  = aCurve->LastParameter();
     if(Abs(firstPar-fP) < precision)
index f3cf45209f42ef42c62544161bff01a5cbd6ffdd..d0ecc0d1e35ac607099df009a92ca683b58a433e 100644 (file)
@@ -71,7 +71,7 @@ ShapeUpgrade_SplitCurve3d::ShapeUpgrade_SplitCurve3d()
   if(aCurve->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) 
     aCurve=Handle(Geom_TrimmedCurve)::DownCast(aCurve)->BasisCurve();
   // 15.11.2002 PTV OCC966
-  if(!ShapeAnalysis_Curve::IsPeriodic(C)) {
+  if(!C->IsPeriodic111()) {
     Standard_Real fP = aCurve->FirstParameter();
     Standard_Real lP  = aCurve->LastParameter();
     if(Abs(firstPar-fP) < precision)
@@ -156,7 +156,7 @@ ShapeUpgrade_SplitCurve3d::ShapeUpgrade_SplitCurve3d()
   
   //pdn fix on BuildCurve 3d
   // 15.11.2002 PTV OCC966
-  if(!ShapeAnalysis_Curve::IsPeriodic(myCurve)) {
+  if(!myCurve->IsPeriodic111()) {
     //pdn exceptons only on non periodic curves
     Standard_Real precision = Precision::PConfusion();
     Standard_Real firstPar = myCurve->FirstParameter();