]> OCCT Git - occt-copy.git/commitdiff
Geom_RectangularTrimmedSurface
authornbv <nbv@opencascade.com>
Thu, 26 Oct 2017 14:32:37 +0000 (17:32 +0300)
committernbv <nbv@opencascade.com>
Mon, 10 Dec 2018 15:11:20 +0000 (18:11 +0300)
82 files changed:
src/AIS/AIS.cxx
src/BOPTools/BOPTools_AlgoTools3D.cxx
src/BRepBndLib/BRepBndLib.cxx
src/BRepFeat/BRepFeat.cxx
src/BRepLib/BRepLib_MakeFace.cxx
src/BRepOffset/BRepOffset_Tool.cxx
src/BRepToIGES/BRepToIGES_BRWire.cxx
src/BRepTools/BRepTools.cxx
src/BRepTools/BRepTools_NurbsConvertModification.cxx
src/BinTools/BinTools_SurfaceSet.cxx
src/BndLib/BndLib_AddSurface.cxx
src/ChFi3d/ChFi3d_Builder_0.cxx
src/ChFi3d/ChFi3d_Builder_C1.cxx
src/DBRep/DBRep_DrawableShape.cxx
src/DrawTrSurf/DrawTrSurf_BSplineSurface.cxx
src/Geom/Geom_BSplineSurface.hxx
src/Geom/Geom_BSplineSurface_1.cxx
src/Geom/Geom_BezierSurface.cxx
src/Geom/Geom_BezierSurface.hxx
src/Geom/Geom_ConicalSurface.cxx
src/Geom/Geom_ConicalSurface.hxx
src/Geom/Geom_CylindricalSurface.cxx
src/Geom/Geom_CylindricalSurface.hxx
src/Geom/Geom_OffsetSurface.cxx
src/Geom/Geom_OffsetSurface.hxx
src/Geom/Geom_OsculatingSurface.cxx
src/Geom/Geom_Plane.cxx
src/Geom/Geom_Plane.hxx
src/Geom/Geom_RectangularTrimmedSurface.cxx
src/Geom/Geom_RectangularTrimmedSurface.hxx
src/Geom/Geom_SphericalSurface.cxx
src/Geom/Geom_SphericalSurface.hxx
src/Geom/Geom_Surface.cxx
src/Geom/Geom_Surface.hxx
src/Geom/Geom_SurfaceOfLinearExtrusion.cxx
src/Geom/Geom_SurfaceOfLinearExtrusion.hxx
src/Geom/Geom_SurfaceOfRevolution.cxx
src/Geom/Geom_SurfaceOfRevolution.hxx
src/Geom/Geom_ToroidalSurface.cxx
src/Geom/Geom_ToroidalSurface.hxx
src/GeomAdaptor/GeomAdaptor_Surface.cxx
src/GeomConvert/GeomConvert_1.cxx
src/GeomEvaluator/GeomEvaluator_OffsetSurface.cxx
src/GeomFill/GeomFill_NSections.cxx
src/GeomFill/GeomFill_Sweep.cxx
src/GeomInt/GeomInt_IntSS_1.cxx
src/GeomLib/GeomLib.cxx
src/GeomLib/GeomLib_DenominatorMultiplier.cxx
src/GeomPlate/GeomPlate_Surface.cxx
src/GeomPlate/GeomPlate_Surface.hxx
src/GeomToIGES/GeomToIGES_GeomSurface.cxx
src/GeomToStep/GeomToStep_MakeBoundedSurface.cxx
src/GeomTools/GeomTools_SurfaceSet.cxx
src/IntTools/IntTools_FaceFace.cxx
src/LocOpe/LocOpe_Generator.cxx
src/LocOpe/LocOpe_SplitDrafts.cxx
src/LocOpe/LocOpe_WiresOnShape.cxx
src/QABugs/QABugs_10.cxx
src/SWDRAW/SWDRAW_ShapeUpgrade.cxx
src/ShapeAnalysis/ShapeAnalysis_Surface.cxx
src/ShapeConstruct/ShapeConstruct_ProjectCurveOnSurface.cxx
src/ShapeCustom/ShapeCustom_BSplineRestriction.cxx
src/ShapeCustom/ShapeCustom_Surface.cxx
src/ShapeExtend/ShapeExtend_CompositeSurface.cxx
src/ShapeExtend/ShapeExtend_CompositeSurface.hxx
src/ShapeFix/ShapeFix_ComposeShell.cxx
src/ShapeFix/ShapeFix_EdgeProjAux.cxx
src/ShapeFix/ShapeFix_Face.cxx
src/ShapeFix/ShapeFix_Wire.cxx
src/ShapePersistent/ShapePersistent_Geom_Surface.cxx
src/ShapeUpgrade/ShapeUpgrade_FaceDivide.cxx
src/ShapeUpgrade/ShapeUpgrade_SplitSurface.cxx
src/StepToTopoDS/StepToTopoDS_TranslateEdgeLoop.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_CorrectFace2d.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_GridSS.cxx
src/TopOpeBRepBuild/TopOpeBRepBuild_Section.cxx
src/TopOpeBRepDS/TopOpeBRepDS_BuildTool.cxx
src/TopOpeBRepTool/TopOpeBRepTool_2d.cxx
src/TopOpeBRepTool/TopOpeBRepTool_CurveTool.cxx
src/TopOpeBRepTool/TopOpeBRepTool_GEOMETRY.cxx
src/TopOpeBRepTool/TopOpeBRepTool_ShapeTool.cxx
src/TopOpeBRepTool/TopOpeBRepTool_TOOL.cxx

index 60b6067de3c015025205a8e0f8c733c52ec466a7..0ea55e63a2aae8c08ef31bbf4c96432f26144f19 100644 (file)
@@ -1222,7 +1222,7 @@ void AIS::InitLengthBetweenCurvilinearFaces (const TopoDS_Face&    theFirstFace,
     BRepTopAdaptor_FClass2d aClassifier (theSecondFace, Precision::Confusion());
 
     TopAbs_State aState = 
-      aClassifier.Perform (gp_Pnt2d (aPU, aPV), theSecondSurf->IsUPeriodic() || theSecondSurf->IsVPeriodic());
+      aClassifier.Perform (gp_Pnt2d (aPU, aPV), theSecondSurf->IsUPeriodic111() || theSecondSurf->IsVPeriodic111());
 
     if (aState == TopAbs_OUT || aState == TopAbs_UNKNOWN)
     {
index 06653d1605f84f005ac66d7b9bc6c3da44fc5c03..34621348e86af50b4f6e3d9d9089f97e79418bfc 100644 (file)
@@ -75,8 +75,8 @@ static
 void BOPTools_AlgoTools3D::DoSplitSEAMOnFace (const TopoDS_Edge& aSplit,
                                               const TopoDS_Face& aF)
 {
-  Standard_Boolean bIsUPeriodic, bIsVPeriodic, bIsLeft;
-  Standard_Real aTol, a, b, anUPeriod, anVPeriod, aT, anU, dU, anU1;
+  Standard_Boolean bIsLeft;
+  Standard_Real aTol, a, b, aT, anU, dU, anU1;
   Standard_Real aScPr, anV, dV, anV1;
   Standard_Real aUmin, aUmax, aVmin, aVmax;
   gp_Pnt2d aP2D;
@@ -97,58 +97,19 @@ void BOPTools_AlgoTools3D::DoSplitSEAMOnFace (const TopoDS_Edge& aSplit,
   //
   aS->Bounds(aUmin, aUmax, aVmin, aVmax);
   //
-  bIsUPeriodic=aS->IsUPeriodic();
-  bIsVPeriodic=aS->IsVPeriodic();
-  //
-  anUPeriod = bIsUPeriodic ? aS->UPeriod() : 0.;
-  anVPeriod = bIsVPeriodic ? aS->VPeriod() : 0.;
+  const Standard_Boolean bIsUPeriodic = aS->IsUPeriodic111(),
+                         bIsVPeriodic = aS->IsVPeriodic111();
+
+  const Standard_Real anUPeriod = bIsUPeriodic ? aS->UPeriod() : 0.,
+                      anVPeriod = bIsVPeriodic ? aS->VPeriod() : 0.;
+
+  const Standard_Boolean bIsUClosed = aS->IsUClosed(),
+                         bIsVClosed = aS->IsVClosed();
   //
-  if (!bIsUPeriodic && !bIsVPeriodic) {
-    Standard_Boolean bIsUClosed, bIsVClosed;
-    Handle(Geom_BSplineSurface) aBS;
-    Handle(Geom_BezierSurface) aBZ;
-    Handle(Geom_RectangularTrimmedSurface) aRTS;
-    //
-    bIsUClosed=Standard_False;
-    bIsVClosed=Standard_False;
-    aBS=Handle(Geom_BSplineSurface)::DownCast(aS);
-    aBZ=Handle(Geom_BezierSurface) ::DownCast(aS);
-    aRTS=Handle(Geom_RectangularTrimmedSurface)::DownCast(aS);
-    //
-    if (!aBS.IsNull()) {
-      bIsUClosed=aBS->IsUClosed();
-      bIsVClosed=aBS->IsVClosed();
-    }
-    else if (!aBZ.IsNull()) {
-      bIsUClosed=aBZ->IsUClosed();
-      bIsVClosed=aBZ->IsVClosed();
-    }
-    else if (!aRTS.IsNull()) {
-      Handle(Geom_Surface) aSB;
-      //
-      aSB=aRTS->BasisSurface();
-      bIsUPeriodic=aSB->IsUPeriodic();
-      bIsVPeriodic=aSB->IsVPeriodic();
-      //
-      if (!(bIsUPeriodic || bIsVPeriodic)) {
-        return;
-      }
-      anUPeriod = bIsUPeriodic ? aSB->UPeriod() : 0.;
-      anVPeriod = bIsVPeriodic ? aSB->VPeriod() : 0.;
-    }
-    //
-    if (aRTS.IsNull()) {
-      if (!bIsUClosed && !bIsVClosed) {
-        return;
-      }
-      //
-      if (bIsUClosed) {
-        anUPeriod=aUmax-aUmin;
-      }
-      if (bIsVClosed) {
-        anVPeriod=aVmax-aVmin;
-      }
-    }
+  if ((!bIsUPeriodic || !bIsUClosed) &&
+      (!bIsVPeriodic || !bIsVClosed))
+  {
+    return;
   }
   //
   //---------------------------------------------------
index 6aa8c2dd49845827fd3030ee4f6178010b14e307..5048879e96d7044d6ec6034d9bed63580dbc65eb 100644 (file)
@@ -588,7 +588,7 @@ void FindExactUVBounds(const TopoDS_Face FF,
   Handle(Geom_Surface) aS = BRep_Tool::Surface(FF, aLoc);
   Standard_Real aUmin, aUmax, aVmin, aVmax;
   aS->Bounds(aUmin, aUmax, aVmin, aVmax);
-  if(!aS->IsUPeriodic())
+  if(!aS->IsUPeriodic111())
   {
     umin = Max(aUmin, umin);
     umax = Min(aUmax, umax);
@@ -603,7 +603,7 @@ void FindExactUVBounds(const TopoDS_Face FF,
     }
   }
   //
-  if(!aS->IsVPeriodic())
+  if(!aS->IsVPeriodic111())
   {
     vmin = Max(aVmin, vmin);
     vmax = Min(aVmax, vmax);
index 09e7ec88580a72c6ae9002f97ff82e9893212b1a..fed3f27a79e37e64bdde7a6a02faf0ca7276e349 100644 (file)
@@ -442,12 +442,12 @@ Standard_Boolean BRepFeat::IsInside(const TopoDS_Face& F1,
 //  Standard_Real periodu, periodv; 
   BRepTools::UVBounds(F2,umin,umax,vmin,vmax);
 
-  if (S->IsUPeriodic()) {
+  if (S->IsUPeriodic111()) {
     flagu = 1;
     uperiod = S->UPeriod();
   }
 
-  if (S->IsVPeriodic()) {
+  if (S->IsVPeriodic111()) {
     flagv = 1;
     vperiod = S->VPeriod();
   }
index 8046062ce58455a0fbd3887a7769a03bbc96ed03..921f3de060e6184fa02175310fb6f9062aaac199 100644 (file)
@@ -537,7 +537,7 @@ void  BRepLib_MakeFace::Init(const Handle(Geom_Surface)& SS,
     }
   }
 
-  if (S->IsUPeriodic()) {
+  if (S->IsUPeriodic111()) {
     ElCLib::AdjustPeriodic(umin,umax,epsilon,UMin,UMax);
   }
   else if (UMin > UMax) {
@@ -550,7 +550,7 @@ void  BRepLib_MakeFace::Init(const Handle(Geom_Surface)& SS,
     }
   }
 
-  if (S->IsVPeriodic()) {
+  if (S->IsVPeriodic111()) {
     ElCLib::AdjustPeriodic(vmin,vmax,epsilon,VMin,VMax);
   }
   else if (VMin > VMax) {
index 3e7b99e96e98a0d500c382cc149799a93b92d91e..17b3c70f9aa4a7dc6aa6e58ba7561750a19e5686 100644 (file)
@@ -252,19 +252,16 @@ static void PutInBounds (const TopoDS_Face&          F,
   BRep_Tool::Range(E,f,l);  
 
   TopLoc_Location L; // Recup S avec la location pour eviter la copie.
-  Handle (Geom_Surface) S   = BRep_Tool::Surface(F,L);
+  const Handle (Geom_Surface) &S = BRep_Tool::Surface(F,L);
 
-  if (S->IsInstance(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
-    S = Handle(Geom_RectangularTrimmedSurface)::DownCast (S)->BasisSurface();
-  }
   //---------------
   // Recadre en U.
   //---------------
-  if (!S->IsUPeriodic() && !S->IsVPeriodic()) return;
+  if (!S->IsUPeriodic111() && !S->IsVPeriodic111()) return;
 
   FindPeriod (F,umin,umax,vmin,vmax);
 
-  if (S->IsUPeriodic()) {
+  if (S->IsUPeriodic111()) {
     Standard_Real period  = S->UPeriod();
     Standard_Real eps     = period*1.e-6;
     gp_Pnt2d      Pf      = C2d->Value(f);
@@ -298,7 +295,7 @@ static void PutInBounds (const TopoDS_Face&          F,
   //------------------
   // Recadre en V.
   //------------------
-  if (S->IsVPeriodic()) {
+  if (S->IsVPeriodic111()) {
     Standard_Real period  = S->VPeriod();
     Standard_Real eps     = period*1.e-6;
     gp_Pnt2d      Pf      = C2d->Value(f);
@@ -433,7 +430,7 @@ static void BuildPCurves (const TopoDS_Edge&  E,
          C2d = BRep_Tool::CurveOnSurface( theEdge, theFace, f, l );
          C2d = new Geom2d_TrimmedCurve( C2d, U1, U2 );
 
-         if (theSurf->IsUPeriodic() || theSurf->IsVPeriodic())
+         if (theSurf->IsUPeriodic111() || theSurf->IsVPeriodic111())
            PutInBounds( F, E, C2d );
 
          BRep_Builder B;
@@ -3079,7 +3076,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
   Standard_Real         UF1,VF1,UF2,VF2;
   Standard_Boolean      SurfaceChange = Standard_False;
 
-  if (S->IsUPeriodic() || S->IsVPeriodic()) {
+  if (S->IsUPeriodic111() || S->IsVPeriodic111()) {
     // Calcul serre pour que les bornes ne couvre pas plus d une periode
     CompactUVBounds(F,UF1,UF2,VF1,VF2);                                               
   }
@@ -3115,7 +3112,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
     VV1 = Max(VS1,VV1); VV2 = Min(VS2,VV2);
   }
 
-  if (S->IsUPeriodic()) {
+  if (S->IsUPeriodic111()) {
     Standard_Real    Period = S->UPeriod(); 
     Standard_Real    Delta  = Period - (UF2 - UF1);
     Standard_Real    alpha  = 0.1;
@@ -3124,7 +3121,7 @@ Standard_Boolean BRepOffset_Tool::EnLargeFace
       UU2 = UU1 + Period;
     }
   }
-  if (S->IsVPeriodic()) {
+  if (S->IsVPeriodic111()) {
     Standard_Real    Period = S->VPeriod(); 
     Standard_Real    Delta  = Period - (VF2 - VF1);
     Standard_Real    alpha  = 0.1;
index 595a3619d744f575cb9e7ab41d44ae323060bb01..8600ec3e1260b17451a0cb7545dfaa3a80f62e3c 100644 (file)
@@ -387,10 +387,10 @@ Handle(IGESData_IGESEntity) BRepToIGES_BRWire ::TransferEdge (const TopoDS_Edge&
       Standard_Real uShift = 0., vShift = 0.;
       Standard_Real U0, U1, V0, V1;
       Surf->Bounds(U0, U1, V0, V1);
-      if (aBSpline->IsUPeriodic() && Abs(Ufirst - U0) > Precision::PConfusion()) {
+      if (aBSpline->IsUPeriodic111() && Abs(Ufirst - U0) > Precision::PConfusion()) {
         uShift = ShapeAnalysis::AdjustToPeriod(Ufirst, U0, U1);
       }
-      if (aBSpline->IsVPeriodic() && Abs(Vfirst - V0) > Precision::PConfusion()) {
+      if (aBSpline->IsVPeriodic111() && Abs(Vfirst - V0) > Precision::PConfusion()) {
         vShift = ShapeAnalysis::AdjustToPeriod(Vfirst, V0, V1);
       }
       if (Abs(uShift) > Precision::PConfusion() || Abs(vShift) > Precision::PConfusion()) {
index 1a9f43b55b29e633f17dfa6b5221e940ea78e883..2443649aff7f22999b20860d51b46736e7ae11f8 100644 (file)
@@ -238,7 +238,7 @@ void BRepTools::AddUVBounds(const TopoDS_Face& aF,
   }
 
   //
-  if(!aS->IsUPeriodic())
+  if(!aS->IsUPeriodic111())
   {
     Standard_Boolean isUPeriodic = Standard_False;
 
@@ -319,7 +319,7 @@ void BRepTools::AddUVBounds(const TopoDS_Face& aF,
     }
   }
 
-  if(!aS->IsVPeriodic())
+  if(!aS->IsVPeriodic111())
   {
     Standard_Boolean isVPeriodic = Standard_False;
 
index 10103f567853f9744a2808ba8b94b8ceceb9aa3d..50e8c82ef16fbd4ea69a1ee9a3d03f6381028afa 100644 (file)
@@ -131,7 +131,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface
   BRepTools::UVBounds(F,curvU1,curvU2,curvV1,curvV2);
   Tol = BRep_Tool::Tolerance(F);
   Standard_Real TolPar = 0.1*Tol;
-  Standard_Boolean IsUp = S->IsUPeriodic(), IsVp = S->IsVPeriodic();
+  Standard_Boolean IsUp = S->IsUPeriodic111(), IsVp = S->IsVPeriodic111();
   //OCC466(apo)->
   U1 = curvU1;  U2 = curvU2;  
   V1 = curvV1;  V2 = curvV2;
@@ -223,10 +223,10 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewSurface
   // on recadre les bornes de S  sinon les anciennes PCurves sont aux fraises
   //
 
-  if (Abs(curvU1-surfU1) > UTol && !BS->IsUPeriodic()) {
+  if (Abs(curvU1-surfU1) > UTol && !BS->IsUPeriodic111()) {
     GeomLib_ChangeUBounds(BS, U1,U2) ;
   }
-  if (Abs(curvV1-surfV1) > VTol && !BS->IsVPeriodic()) {
+  if (Abs(curvV1-surfV1) > VTol && !BS->IsVPeriodic111()) {
     GeomLib_ChangeVBounds(BS, V1, V2) ;
   }
 
@@ -435,7 +435,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
       //Uinf -= 1e-9; Usup += 1e-9; Vinf -= 1e-9; Vsup += 1e-9;
       u = (Usup - Uinf)*0.1;
       v = (Vsup - Vinf)*0.1;
-      if(S->IsUPeriodic()) {
+      if(S->IsUPeriodic111()) {
         Standard_Real uperiod = S->UPeriod();
         if(uperiod < (Usup+2*u-Uinf)) {
           if(uperiod <= (Usup-Uinf))  {
@@ -446,7 +446,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
           }
         }
       }
-      if(S->IsVPeriodic()) {
+      if(S->IsVPeriodic111()) {
         Standard_Real vperiod = S->VPeriod();
         if(vperiod < (Vsup+2*v-Vinf)) {
           if(vperiod <= (Vsup-Vinf)) {
@@ -589,7 +589,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
       //Uinf -= 1e-9; Usup += 1e-9; Vinf -= 1e-9; Vsup += 1e-9;
       u = (Usup - Uinf)*0.1;
       v = (Vsup - Vinf)*0.1;
-      if(S->IsUPeriodic()) {
+      if(S->IsUPeriodic111()) {
         Standard_Real uperiod = S->UPeriod();
         if(uperiod < (Usup+2*u-Uinf)) {
           if(uperiod <= (Usup-Uinf))
@@ -598,7 +598,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
             u = (uperiod-(Usup-Uinf))*0.5;
         }
       }
-      if(S->IsVPeriodic()) {
+      if(S->IsVPeriodic111()) {
         Standard_Real vperiod = S->VPeriod();
         if(vperiod < (Vsup+2*v-Vinf)) {
           if(vperiod <= (Vsup-Vinf))
index c43fe79f791789d5f06538d9f482d851bd6e0cb1..a44091a71c9f0c92d73fa671d549fee8a838e6ee 100644 (file)
@@ -300,8 +300,8 @@ static Standard_OStream& operator <<(Standard_OStream& OS, const Handle(Geom_BSp
   OS << (Standard_Byte)BSPLINE;
   Standard_Boolean urational = S->IsURational() ? 1:0;
   Standard_Boolean vrational = S->IsVRational() ? 1:0;
-  Standard_Boolean uperiodic = S->IsUPeriodic() ? 1:0;
-  Standard_Boolean vperiodic = S->IsVPeriodic() ? 1:0;
+  Standard_Boolean uperiodic = S->IsUPeriodic111() ? 1:0;
+  Standard_Boolean vperiodic = S->IsVPeriodic111() ? 1:0;
   BinTools::PutBool(OS, urational); 
   BinTools::PutBool(OS, vrational); 
   BinTools::PutBool(OS, uperiodic); 
index d55bddd3d6320085c250581c87007c0ac2841385..09d1bb16abfdb84ad3f11bd983a6291072074df8 100644 (file)
@@ -399,7 +399,7 @@ void BndLib_AddSurface::Add(const Adaptor3d_Surface& S,
               Standard_Integer anUFlatKnotsCount = S.BSpline()->NbUPoles() + S.BSpline()->UDegree() + 1;
               Standard_Integer aShift = 1;
 
-              if (S.BSpline()->IsUPeriodic())
+              if (S.BSpline()->IsUPeriodic111())
               {
                 TColStd_Array1OfInteger aMults(1, S.BSpline()->NbUKnots());
                 S.BSpline()->UMultiplicities(aMults);
@@ -425,7 +425,7 @@ void BndLib_AddSurface::Add(const Adaptor3d_Surface& S,
               Standard_Integer anVFlatKnotsCount = S.BSpline()->NbVPoles() + S.BSpline()->VDegree() + 1;
               Standard_Integer aShift = 1;
 
-              if (S.BSpline()->IsVPeriodic())
+              if (S.BSpline()->IsVPeriodic111())
               {
                 TColStd_Array1OfInteger aMults(1, S.BSpline()->NbVKnots());
                 S.BSpline()->VMultiplicities(aMults);
index 3fc897e2132ea3cd6a00278d1edd2b1c8604c565..1119041637b44e7b19f387f245d97fa6e67cd2f8 100644 (file)
@@ -585,17 +585,14 @@ void ChFi3d_BoundSrf(GeomAdaptor_Surface& S,
   const Standard_Boolean checknaturalbounds)
 {
   Standard_Real umin = uumin, umax = uumax, vmin = vvmin, vmax = vvmax; 
-  Handle(Geom_Surface) surface = S.Surface();
-  Handle(Geom_RectangularTrimmedSurface) 
-    trs = Handle(Geom_RectangularTrimmedSurface)::DownCast(surface);
-  if(!trs.IsNull()) surface = trs->BasisSurface();
+  const Handle(Geom_Surface) &surface = S.Surface();
   Standard_Real u1,u2,v1,v2;
   surface->Bounds(u1,u2,v1,v2);
   Standard_Real peru=0, perv=0;
-  if(surface->IsUPeriodic()) {
+  if(surface->IsUPeriodic111()) {
     peru = surface->UPeriod();
   }
-  if(surface->IsVPeriodic()) {
+  if(surface->IsVPeriodic111()) {
     perv = surface->VPeriod();
   }
   Standard_Real Stepu = umax - umin;
@@ -2983,9 +2980,6 @@ Handle(Geom_Surface) trsfsurf(const Handle(Adaptor3d_HSurface)& HS,
   else if(!hgs.IsNull()) {
     res = hgs->ChangeSurface().Surface();
   }
-  Handle(Geom_RectangularTrimmedSurface) 
-    tr = Handle(Geom_RectangularTrimmedSurface)::DownCast(res);
-  if(!tr.IsNull()) res = tr->BasisSurface();
 
   Standard_Real U1 = HS->FirstUParameter(), U2 = HS->LastUParameter();
   Standard_Real V1 = HS->FirstVParameter(), V2 = HS->LastVParameter();
@@ -2993,11 +2987,11 @@ Handle(Geom_Surface) trsfsurf(const Handle(Adaptor3d_HSurface)& HS,
     // Protection against Construction Errors
     Standard_Real u1, u2, v1, v2;
     res->Bounds( u1, u2, v1, v2);
-    if (!res->IsUPeriodic()) {
+    if (!res->IsUPeriodic111()) {
       if (U1 < u1) U1 = u1;
       if (U2 > u2) U2 = u2;
     }
-    if (!res->IsVPeriodic()) {
+    if (!res->IsVPeriodic111()) {
       if (V1 < v1) V1 = v1;
       if (V2 > v2) V2 = v2;
     }
index db524a4269b8a46365396883d4740704ae78c734..a51a6d61482e6b7eab87a7dc33cc110bd8fb65f9 100644 (file)
@@ -484,11 +484,8 @@ static void ChFi3d_Recale(BRepAdaptor_Surface&   Bs,
                          gp_Pnt2d&              p2,
                          const Standard_Boolean refon1)
 {
-  Handle(Geom_Surface) surf = Bs.ChangeSurface().Surface();
-  Handle(Geom_RectangularTrimmedSurface)
-    ts = Handle(Geom_RectangularTrimmedSurface)::DownCast(surf);
-  if (!ts.IsNull()) surf = ts->BasisSurface();
-  if (surf->IsUPeriodic()) {
+  const Handle(Geom_Surface) &surf = Bs.ChangeSurface().Surface();
+  if (surf->IsUPeriodic111()) {
     Standard_Real u1 = p1.X(), u2 = p2.X();
     Standard_Real uper = surf->UPeriod();
     if (fabs(u2-u1) > 0.5*uper) {
@@ -499,7 +496,7 @@ static void ChFi3d_Recale(BRepAdaptor_Surface&   Bs,
     }
     p1.SetX(u1); p2.SetX(u2);
   }
-  if (surf->IsVPeriodic()) {
+  if (surf->IsVPeriodic111()) {
     Standard_Real v1 = p1.Y(), v2 = p2.Y();
     Standard_Real vper = surf->VPeriod();
     if (fabs(v2-v1) > 0.5*vper) {
index 24b28a75850faa233bc60a3a9c400233b9035f87..9603debb2fc4834b64b6b65dc9bec6b0f164cb66 100644 (file)
@@ -35,6 +35,7 @@
 #include <Draw_Drawable3D.hxx>
 #include <Geom_BSplineCurve.hxx>
 #include <Geom_BSplineSurface.hxx>
+#include <Geom_RectangularTrimmedSurface.hxx>
 #include <GeomAdaptor_HSurface.hxx>
 #include <GeomAdaptor_Surface.hxx>
 #include <gp_Lin2d.hxx>
@@ -390,18 +391,23 @@ void  DBRep_DrawableShape::DrawOn(Draw_Display& dis) const
     if (!aSurf.IsNull()) {
 
       Standard_Boolean restriction = Standard_False;
-      if(aSurf->IsUPeriodic() || aSurf->IsVPeriodic()) {
+      if(aSurf->IsUPeriodic111() || aSurf->IsVPeriodic111()) {
+        Handle(Geom_Surface) aBS = aSurf;
+        if (aSurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
+        {
+          aBS = Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf)->BasisSurface();
+        }
         Standard_Real SU1 = 0., SU2 = 0., SV1 = 0., SV2 = 0.;
         Standard_Real FU1 = 0., FU2 = 0., FV1 = 0., FV2 = 0.;
-        aSurf->Bounds(SU1,SU2,SV1,SV2);
+        aBS->Bounds(SU1, SU2, SV1, SV2);
         BRepTools::UVBounds (F->Face(),FU1,FU2,FV1,FV2);
-        if(aSurf->IsUPeriodic()) {
+        if(aSurf->IsUPeriodic111()) {
           if(FU1 < SU1 || FU1 > SU2)
             restriction = Standard_True;
           if(!restriction && (FU2 < SU1 || FU2 > SU2))
             restriction = Standard_True;
         }
-        if(!restriction && aSurf->IsVPeriodic()) {
+        if(!restriction && aSurf->IsVPeriodic111()) {
           if(FV1 < SV1 || FV1 > SV2)
             restriction = Standard_True;
           if(!restriction && (FV2 < SV1 || FV2 > SV2))
index d265ff020b513e82a728029d2514d1d207c1b647..c9ebfa1ff5c42f9083c6ed85463b8f06ba3f18a8 100644 (file)
@@ -108,7 +108,7 @@ void DrawTrSurf_BSplineSurface::DrawOn (Draw_Display& dis) const {
       for (i = 2; i <= NbUPoles; i++) {
        dis.DrawTo(SPoles(i, j));
       }
-      if (S->IsUPeriodic())
+      if (S->IsUPeriodic111() && S->IsUClosed())
        dis.DrawTo(SPoles(1,j));
     }
     for (i = 1; i <= NbUPoles; i++) {
@@ -116,7 +116,7 @@ void DrawTrSurf_BSplineSurface::DrawOn (Draw_Display& dis) const {
       for (j = 2; j <= NbVPoles; j++) {
        dis.DrawTo(SPoles(i, j));
       }
-      if (S->IsVPeriodic())
+      if (S->IsVPeriodic111() && S->IsVClosed())
        dis.DrawTo(SPoles(i,1));
     }
   }
index 9a54bf071dbdd0a4e219cd3e2cf590120054208c..8af6702afc8c1ce83eb26ddae1b8010f7cafe12d 100644 (file)
@@ -801,7 +801,7 @@ public:
   //! Returns True if the surface is closed in the U direction
   //! and if the B-spline has been turned into a periodic surface
   //! using the function SetUPeriodic.
-  Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
 
   //! Returns False if for each row of weights all the weights
@@ -817,7 +817,7 @@ public:
   //! Returns True if the surface is closed in the V direction
   //! and if the B-spline has been turned into a periodic
   //! surface using the function SetVPeriodic.
-  Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
 
   //! Returns False if for each column of weights all the weights
index db99bfcdd85eadb7ec41b1dc6ae30ac0f0dcc340..51d4056099be7d972c2b2427b1bb5200c50651d1 100644 (file)
@@ -1261,7 +1261,7 @@ Standard_Boolean Geom_BSplineSurface::IsVClosed () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_BSplineSurface::IsUPeriodic () const 
+Standard_Boolean Geom_BSplineSurface::IsUPeriodic111 () const 
 {
   return uperiodic; 
 }
@@ -1271,7 +1271,7 @@ Standard_Boolean Geom_BSplineSurface::IsUPeriodic () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_BSplineSurface::IsVPeriodic () const 
+Standard_Boolean Geom_BSplineSurface::IsVPeriodic111 () const 
 { 
   return vperiodic; 
 }
index c6ede954d4f4b6389a7c7b738b32c53df2cf9662..5b6d17aa80d19c708b0a60310c26663a0e9e5622 100644 (file)
@@ -1839,7 +1839,7 @@ Standard_Boolean Geom_BezierSurface::IsVClosed () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_BezierSurface::IsUPeriodic () const
+Standard_Boolean Geom_BezierSurface::IsUPeriodic111 () const
 {
   return Standard_False; 
 }
@@ -1849,7 +1849,7 @@ Standard_Boolean Geom_BezierSurface::IsUPeriodic () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_BezierSurface::IsVPeriodic () const
+Standard_Boolean Geom_BezierSurface::IsVPeriodic111 () const
 {
   return Standard_False; 
 }
index 0519edf9bcfbfde188d4775ec02d4aebef9b122c..1e2c3b6cf4fa015a45f05a25713873fbba51a99b 100644 (file)
@@ -537,10 +537,10 @@ public:
   Standard_EXPORT Standard_Boolean IsCNv (const Standard_Integer N) const Standard_OVERRIDE;
   
   //! Returns False.
-  Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
   //! Returns False.
-  Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
 
   //! Returns False if the weights are identical in the U direction,
index 5dd0e7029b393ebd8c683ec526cb9baa66367735..13f533a870f88b9d2420e134c7f2e00b8ba31ac8 100644 (file)
@@ -164,7 +164,7 @@ Standard_Boolean Geom_ConicalSurface::IsVClosed () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_ConicalSurface::IsUPeriodic () const          
+Standard_Boolean Geom_ConicalSurface::IsUPeriodic111 () const          
 { return Standard_True; }
 
 //=======================================================================
@@ -172,7 +172,7 @@ Standard_Boolean Geom_ConicalSurface::IsUPeriodic () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_ConicalSurface::IsVPeriodic () const          
+Standard_Boolean Geom_ConicalSurface::IsVPeriodic111 () const          
 { return Standard_False; }
 
 //=======================================================================
index 5db22203b8138d2ae7c0c00f8b04046cc11c1a13..a93d192cc7ee4416ed59d988b7f7c0031e19e305 100644 (file)
@@ -220,10 +220,10 @@ public:
   Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE;
   
   //! Returns True.
-  Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
   //! Returns False.
-  Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
   //! Builds the U isoparametric line of this cone. The
   //! origin of this line is on the reference plane of this
index dd500cb31986c8f117b830ed97045b9474dabf09..03ef89dfb33103f7091a3fa55156fdaaea661b22 100644 (file)
@@ -140,14 +140,14 @@ Standard_Boolean Geom_CylindricalSurface::IsVClosed () const       { return Stan
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_CylindricalSurface::IsUPeriodic () const     { return Standard_True; }
+Standard_Boolean Geom_CylindricalSurface::IsUPeriodic111 () const     { return Standard_True; }
 
 //=======================================================================
 //function : IsVPeriodic
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_CylindricalSurface::IsVPeriodic () const     { return Standard_False; }
+Standard_Boolean Geom_CylindricalSurface::IsVPeriodic111 () const     { return Standard_False; }
 
 //=======================================================================
 //function : SetCylinder
index 8f4ae4dabc9dae6a61d1e91b21496cc1db4f5dc5..a581e58ffcbe67a674f9c8d90f89cf49ed2f2eaf 100644 (file)
@@ -159,10 +159,10 @@ public:
   Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE;
   
   //! Returns True.
-  Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
   //! Returns False.
-  Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
 
   //! The UIso curve is a Line. The location point of this line is
index 207deca32d79d88a142f2b5bde825fb0fb60a435..94c6dae89b4ccba2ec2d1811021f71800b3cc022 100644 (file)
@@ -637,9 +637,9 @@ Standard_Boolean Geom_OffsetSurface::IsCNv (const Standard_Integer N) const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_OffsetSurface::IsUPeriodic () const 
+Standard_Boolean Geom_OffsetSurface::IsUPeriodic111 () const 
 {
-  return basisSurf->IsUPeriodic();
+  return basisSurf->IsUPeriodic111();
 }
 
 //=======================================================================
@@ -657,9 +657,9 @@ Standard_Real Geom_OffsetSurface::UPeriod() const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_OffsetSurface::IsVPeriodic () const 
+Standard_Boolean Geom_OffsetSurface::IsVPeriodic111 () const 
 {
-  return basisSurf->IsVPeriodic();
+  return basisSurf->IsVPeriodic111();
 }
 
 //=======================================================================
index c568f3abac5440cd19ab42b7fda374e88617fa21..c88864f73dc501836eb78f14aa4e8dd387f75cdb 100644 (file)
@@ -209,7 +209,7 @@ public:
   //! Returns true if this offset surface is periodic in the u
   //! parametric direction, i.e. if the basis
   //! surface of this offset surface is periodic in this direction.
-  Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
   //! Returns the period of this offset surface in the u
   //! parametric direction respectively, i.e. the period of the
@@ -221,7 +221,7 @@ public:
   //! Returns true if this offset surface is periodic in the v
   //! parametric direction, i.e. if the basis
   //! surface of this offset surface is periodic in this direction.
-  Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
   //! Returns the period of this offset surface in the v
   //! parametric direction respectively, i.e. the period of the
index ed380b8684b4c082723f481aed69cb5f0f430433..55f3bf5c70b0030abcfedf859e7421a941d6a83d 100644 (file)
@@ -105,8 +105,8 @@ void Geom_OsculatingSurface::Init(const Handle(Geom_Surface)& BS,
           UMults,VMults,
           BzS->UDegree(),
           BzS->VDegree(),
-          BzS->IsUPeriodic(),
-          BzS->IsVPeriodic());
+          BzS->IsUPeriodic111(),
+          BzS->IsVPeriodic111());
       }
       else 
       {
@@ -538,14 +538,14 @@ Standard_Boolean  Geom_OsculatingSurface::BuildOsculatingSurface
     Standard_Integer aUfKnotsLength = BS->NbUPoles() + BS->UDegree() + 1;
     Standard_Integer aVfKnotsLength = BS->NbVPoles() + BS->VDegree() + 1;
 
-    if(BS->IsUPeriodic())
+    if(BS->IsUPeriodic111())
     {
       TColStd_Array1OfInteger aMults(1, BS->NbUKnots());
       BS->UMultiplicities(aMults);
       aUfKnotsLength = BSplCLib::KnotSequenceLength(aMults, BS->UDegree(), Standard_True);
     }
 
-    if(BS->IsVPeriodic())
+    if(BS->IsVPeriodic111())
     {
       TColStd_Array1OfInteger aMults(1, BS->NbVKnots());
       BS->VMultiplicities(aMults);
@@ -582,8 +582,8 @@ Standard_Boolean  Geom_OsculatingSurface::BuildOsculatingSurface
       vcacheparameter,   
       uspanlength,         
       vspanlength,         
-      BS->IsUPeriodic(),
-      BS->IsVPeriodic(),
+      BS->IsUPeriodic111(),
+      BS->IsVPeriodic111(),
       BS->UDegree(),       
       BS->VDegree(),       
       ULocalIndex,         
index 65188e4f4ce5a9a6d4ae398b487f9d4094274bae..6f2c6c7ce18ac8abc55e6bfad3a88e198f6be2f4 100644 (file)
@@ -207,7 +207,7 @@ Standard_Boolean Geom_Plane::IsVClosed () const {
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_Plane::IsUPeriodic () const {
+Standard_Boolean Geom_Plane::IsUPeriodic111 () const {
 
   return Standard_False; 
 }
@@ -217,7 +217,7 @@ Standard_Boolean Geom_Plane::IsUPeriodic () const {
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_Plane::IsVPeriodic () const {
+Standard_Boolean Geom_Plane::IsVPeriodic111 () const {
 
   return Standard_False; 
 }
index 07caac24454a85ee76573aa9cfe22a33fa74151c..8cb95ab14d1f1260964b5b79c027874d0fdcd35f 100644 (file)
@@ -168,10 +168,10 @@ public:
   Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE;
   
   //! return False.
-  Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
   //! return False.
-  Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
 
   //! Computes the U isoparametric curve.
index eec0b8aeca012cca7d903d16b8861f8ceda2a682..8e394a579fa1842f72aab3ce7a3b9dfd31e34650 100644 (file)
@@ -237,7 +237,7 @@ void Geom_RectangularTrimmedSurface::SetTrim(const Standard_Real U1,
     if ( U1 == U2)
       throw Standard_ConstructionError("Geom_RectangularTrimmedSurface::U1==U2");
 
-    if (basisSurf->IsUPeriodic()) {
+    if (IsUPeriodic111()) {
       UsameSense = USense;
       
       // set uTrim1 in the range Udeb , Ufin
@@ -277,7 +277,7 @@ void Geom_RectangularTrimmedSurface::SetTrim(const Standard_Real U1,
     if ( V1 == V2)
       throw Standard_ConstructionError("Geom_RectangularTrimmedSurface::V1==V2");
 
-    if (basisSurf->IsVPeriodic()) {
+    if (IsVPeriodic111()) {
       VsameSense = VSense;
 
       // set vTrim1 in the range Vdeb , Vfin
@@ -559,11 +559,9 @@ void Geom_RectangularTrimmedSurface::Transform (const Trsf& T)
 // 24/11/98: pmn : Compare la periode a la longeur de l'intervalle
 //=======================================================================
 
-Standard_Boolean Geom_RectangularTrimmedSurface::IsUPeriodic () const 
+Standard_Boolean Geom_RectangularTrimmedSurface::IsUPeriodic111 () const 
 {
-  if (basisSurf->IsUPeriodic() &&  !isutrimmed) 
-    return Standard_True;
-  return Standard_False;
+  return basisSurf->IsUPeriodic111();
 }
 
 
@@ -583,11 +581,9 @@ Standard_Real Geom_RectangularTrimmedSurface::UPeriod() const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_RectangularTrimmedSurface::IsVPeriodic () const 
+Standard_Boolean Geom_RectangularTrimmedSurface::IsVPeriodic111 () const 
 { 
-  if (basisSurf->IsVPeriodic() && !isvtrimmed)
-    return Standard_True;
-  return Standard_False;
+  return basisSurf->IsVPeriodic111();
 }
 
 
index 857797370bc2081f27819ab1495e4ed4ee779054..ed0e4a394249bf8a276cf9b6dbed3fe34c242b74 100644 (file)
@@ -207,7 +207,7 @@ public:
   
   //! Returns true if this patch is periodic and not trimmed in the given
   //! parametric direction.
-  Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
   //! Returns the period of this patch in the u
   //! parametric direction.
@@ -217,7 +217,7 @@ public:
 
   //! Returns true if this patch is periodic and not trimmed in the given
   //! parametric direction.
-  Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
   //! Returns the period of this patch in the v
   //! parametric direction.
index a373e59b7a57b387ceec00d89397325326887012..54415f1b1c7bd652bdad3ae3eb94859dfa5beec2 100644 (file)
@@ -143,7 +143,7 @@ Standard_Boolean Geom_SphericalSurface::IsVClosed () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_SphericalSurface::IsUPeriodic () const          
+Standard_Boolean Geom_SphericalSurface::IsUPeriodic111 () const          
 { return Standard_True; }
 
 //=======================================================================
@@ -151,7 +151,7 @@ Standard_Boolean Geom_SphericalSurface::IsUPeriodic () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_SphericalSurface::IsVPeriodic () const          
+Standard_Boolean Geom_SphericalSurface::IsVPeriodic111 () const          
 { return Standard_False; }
 
 //=======================================================================
index 827a4686738b8edf38bb904ee617614235d7bea7..a4af4cb9553978d1af151256e643184822fb3c1b 100644 (file)
@@ -159,10 +159,10 @@ public:
   Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE;
   
   //! Returns True.
-  Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
   //! Returns False.
-  Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
   //! Computes the U isoparametric curve.
   //! The U isoparametric curves of the surface are defined by the
index d01f1a9979c81d59491a44deb2d03dd1d40cd540..60fed7b81fca8dcdc61fde545daa92b4d7011cae 100644 (file)
@@ -87,7 +87,7 @@ gp_GTrsf2d Geom_Surface::ParametricTransformation(const gp_Trsf&) const
 Standard_Real Geom_Surface::UPeriod() const
 {
   Standard_NoSuchObject_Raise_if
-    ( !IsUPeriodic(),"Geom_Surface::UPeriod");
+    ( !IsUPeriodic111(),"Geom_Surface::UPeriod");
 
   Standard_Real U1, U2, V1, V2;
   Bounds(U1,U2,V1,V2);
@@ -103,7 +103,7 @@ Standard_Real Geom_Surface::UPeriod() const
 Standard_Real Geom_Surface::VPeriod() const
 {
   Standard_NoSuchObject_Raise_if
-    ( !IsVPeriodic(),"Geom_Surface::VPeriod");
+    ( !IsVPeriodic111(),"Geom_Surface::VPeriod");
 
   Standard_Real U1, U2, V1, V2;
   Bounds(U1,U2,V1,V2);
index 187c3b47d9b53e2cb35b522b5514af087621857a..ff573e155fe2a9eaccf161a97456b66fd56bd2f4 100644 (file)
@@ -183,7 +183,7 @@ public:
   //! v) (or the points P (u, v) and P (u, v +
   //! T)) is less than or equal to gp::Resolution().
   //! Note: T is the parametric period in the u parametric direction.
-  Standard_EXPORT virtual Standard_Boolean IsUPeriodic() const = 0;
+  Standard_EXPORT virtual Standard_Boolean IsUPeriodic111() const = 0;
   
   //! Returns the period of this surface in the u
   //! parametric direction.
@@ -198,7 +198,7 @@ public:
   //! v) (or the points P (u, v) and P (u, v +
   //! T)) is less than or equal to gp::Resolution().
   //! Note: T is the parametric period in the v parametric direction.
-  Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const = 0;
+  Standard_EXPORT virtual Standard_Boolean IsVPeriodic111() const = 0;
   
   //! Returns the period of this surface in the v parametric direction.
   //! raises if the surface is not vperiodic.
index 3babe761141d0fde4ac1367c0473da0c9b07c231..c71c40cb8b2cd058bb70d12f5ad6b4bed1aacefa 100644 (file)
@@ -333,11 +333,20 @@ Standard_Boolean Geom_SurfaceOfLinearExtrusion::IsUClosed () const {
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_SurfaceOfLinearExtrusion::IsUPeriodic () const { 
+Standard_Boolean Geom_SurfaceOfLinearExtrusion::IsUPeriodic111 () const { 
 
   return basisCurve->IsPeriodic111 ();
 }
 
+//=======================================================================
+//function : UPeriod
+//purpose  : 
+//=======================================================================
+Standard_Real Geom_SurfaceOfLinearExtrusion::UPeriod() const
+{
+  return basisCurve->Period();
+}
+
 //=======================================================================
 //function : IsVClosed
 //purpose  : 
@@ -353,7 +362,7 @@ Standard_Boolean Geom_SurfaceOfLinearExtrusion::IsVClosed () const  {
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_SurfaceOfLinearExtrusion::IsVPeriodic () const { 
+Standard_Boolean Geom_SurfaceOfLinearExtrusion::IsVPeriodic111 () const { 
 
   return Standard_False;
 }
index e0fb9d2f2f2c46921f1daacb0f1a5eab503c275e..5104092054e6f8d1f474631ab701a888def1aecc 100644 (file)
@@ -155,11 +155,14 @@ public:
   
   //! IsUPeriodic returns true if the "basis curve" of this
   //! surface of linear extrusion is periodic.
-  Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
   //! IsVPeriodic always returns false.
-  Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
+  //! Returns the period of this surface in the u parametric direction.
+  virtual Standard_Real UPeriod() const Standard_OVERRIDE;
+
   //! Computes the U isoparametric curve of this surface
   //! of linear extrusion. This is the line parallel to the
   //! direction of extrusion, passing through the point of
index 1fd41da8e8d52a91478dd2c1e9d10a59aed0d013..fa41110c06f65d2c5b4d420b6cee1d5fa48b6db4 100644 (file)
@@ -151,7 +151,7 @@ const gp_Pnt& Geom_SurfaceOfRevolution::Location () const {
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_SurfaceOfRevolution::IsUPeriodic () const {
+Standard_Boolean Geom_SurfaceOfRevolution::IsUPeriodic111 () const {
 
   return Standard_True; 
 }
@@ -213,12 +213,20 @@ Standard_Boolean Geom_SurfaceOfRevolution::IsVClosed () const
 //function : IsVPeriodic
 //purpose  : 
 //=======================================================================
+Standard_Boolean Geom_SurfaceOfRevolution::IsVPeriodic111() const
+{
 
-Standard_Boolean Geom_SurfaceOfRevolution::IsVPeriodic () const { 
-
-  return basisCurve->IsPeriodic111(); 
+  return (basisCurve->IsPeriodic111() && basisCurve->IsClosed());
 }
 
+//=======================================================================
+//function : VPeriod
+//purpose  : 
+//=======================================================================
+Standard_Real Geom_SurfaceOfRevolution::VPeriod() const
+{
+  return basisCurve->Period();
+}
 
 //=======================================================================
 //function : SetAxis
index e83528e7329a7b6674334968cec7984d394e727e..976fcef9ff7079c09b1413e69fd149b53f84ee1e 100644 (file)
@@ -244,12 +244,15 @@ public:
   Standard_EXPORT Standard_Boolean IsCNv (const Standard_Integer N) const Standard_OVERRIDE;
   
   //! Returns True.
-  Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
   //! IsVPeriodic returns true if the meridian of this
   //! surface of revolution is periodic.
-  Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
+  //! Returns the period of this surface in the v parametric direction.
+  Standard_EXPORT virtual Standard_Real VPeriod() const Standard_OVERRIDE;
+
   //! Computes the U isoparametric curve of this surface
   //! of revolution. It is the curve obtained by rotating the
   //! meridian through an angle U about the axis of revolution.
index 2cba526d8d6514d15af85d061a380c470a6a0fa3..cfec96844a520ddfadbdcbb887d70af27abd4e27 100644 (file)
@@ -168,7 +168,7 @@ Standard_Boolean Geom_ToroidalSurface::IsVClosed () const {
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_ToroidalSurface::IsUPeriodic () const {
+Standard_Boolean Geom_ToroidalSurface::IsUPeriodic111 () const {
 
   return Standard_True; 
 }
@@ -178,7 +178,7 @@ Standard_Boolean Geom_ToroidalSurface::IsUPeriodic () const {
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom_ToroidalSurface::IsVPeriodic () const {
+Standard_Boolean Geom_ToroidalSurface::IsVPeriodic111 () const {
 
  return Standard_True; 
 }
index 6c22fcafdb646adaf86d79079ebd6217b36db7c2..6692c85f8c60b61ee803b9d49f3790788a004fcd 100644 (file)
@@ -183,10 +183,10 @@ public:
   Standard_EXPORT Standard_Boolean IsVClosed() const Standard_OVERRIDE;
   
   //! Returns True.
-  Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
   //! Returns True.
-  Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
   //! Computes the U isoparametric curve.
   //!
index 621220dae06657b08b1d00d2d08f3957f02ff9b6..7ba0b0c37146cef4db39a733b705f258b0e66d25 100644 (file)
@@ -588,7 +588,7 @@ Standard_Boolean GeomAdaptor_Surface::IsUClosed() const
 
   Standard_Real U1,U2,V1,V2;
   mySurface->Bounds(U1,U2,V1,V2);
-  if (mySurface->IsUPeriodic())
+  if (mySurface->IsUPeriodic111())
     return (Abs(Abs(U1-U2)-Abs(myUFirst-myULast))<Precision::PConfusion());
 
   return (   Abs(U1-myUFirst)<Precision::PConfusion() 
@@ -607,7 +607,7 @@ Standard_Boolean GeomAdaptor_Surface::IsVClosed() const
 
   Standard_Real U1,U2,V1,V2;
   mySurface->Bounds(U1,U2,V1,V2);
-  if (mySurface->IsVPeriodic())
+  if (mySurface->IsVPeriodic111())
     return (Abs(Abs(V1-V2)-Abs(myVFirst-myVLast))<Precision::PConfusion());
 
   return (   Abs(V1-myVFirst)<Precision::PConfusion() 
@@ -621,7 +621,7 @@ Standard_Boolean GeomAdaptor_Surface::IsVClosed() const
 
 Standard_Boolean GeomAdaptor_Surface::IsUPeriodic() const 
 {
-  return (mySurface->IsUPeriodic());
+  return (mySurface->IsUPeriodic111());
 }
 
 //=======================================================================
@@ -642,7 +642,7 @@ Standard_Real GeomAdaptor_Surface::UPeriod() const
 
 Standard_Boolean GeomAdaptor_Surface::IsVPeriodic() const 
 {
-  return (mySurface->IsVPeriodic());
+  return (mySurface->IsVPeriodic111());
 }
 
 //=======================================================================
@@ -683,8 +683,8 @@ void GeomAdaptor_Surface::RebuildCache(const Standard_Real theU,
     // Create cache for B-spline
     if (mySurfaceCache.IsNull())
       mySurfaceCache = new BSplSLib_Cache(
-        myBSplineSurface->UDegree(), myBSplineSurface->IsUPeriodic(), myBSplineSurface->UKnotSequence(),
-        myBSplineSurface->VDegree(), myBSplineSurface->IsVPeriodic(), myBSplineSurface->VKnotSequence(),
+        myBSplineSurface->UDegree(), myBSplineSurface->IsUPeriodic111(), myBSplineSurface->UKnotSequence(),
+        myBSplineSurface->VDegree(), myBSplineSurface->IsVPeriodic111(), myBSplineSurface->VKnotSequence(),
         myBSplineSurface->Weights());
     mySurfaceCache->BuildCache (theU, theV, myBSplineSurface->UKnotSequence(), myBSplineSurface->VKnotSequence(),
                                 myBSplineSurface->Poles(), myBSplineSurface->Weights());
index 7207022b374f63381609cfaa5a8beacc86000be7..8c928aaa90b0512e6cd1274bf3bbec9f6b0a3526 100644 (file)
@@ -145,13 +145,13 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface
   S1->Segment(S1->UKnot(FirstUK),S1->UKnot(LastUK),
     S1->VKnot(FirstVK),S1->VKnot(LastVK));
 
-  if (S->IsUPeriodic()) {
+  if (S->IsUPeriodic111()) {
     if (!SameUOrientation) S1->UReverse();
   }
   else {
     if (FromUK1 > ToUK2)   S1->UReverse();
   }
-  if (S->IsVPeriodic()) {
+  if (S->IsVPeriodic111()) {
     if (!SameVOrientation) S1->VReverse();
   }
   else {
@@ -191,7 +191,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface
       S1->VKnot(S1->FirstVKnotIndex()),
       S1->VKnot(S1->LastVKnotIndex()));
 
-    if (S->IsUPeriodic()) {
+    if (S->IsUPeriodic111()) {
       if (!SameOrientation) S1->UReverse();
     }
     else {
@@ -213,7 +213,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface
       S1->VKnot(LastVK));
 
 
-    if (S->IsVPeriodic()) {
+    if (S->IsVPeriodic111()) {
       if (!SameOrientation) S1->VReverse();
     }
     else {
@@ -250,13 +250,13 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface
 
   NewSurface->Segment(FirstU, LastU, FirstV, LastV);
 
-  if (S->IsUPeriodic()) { 
+  if (S->IsUPeriodic111()) { 
     if (!SameUOrientation)  NewSurface->UReverse(); 
   }
   else { 
     if (FromU1 > ToU2)    NewSurface->UReverse(); 
   }
-  if (S->IsVPeriodic()) {
+  if (S->IsVPeriodic111()) {
     if (!SameVOrientation)  NewSurface->VReverse();
   }
   else {
@@ -293,7 +293,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface
 
     NewSurface->Segment(FirstU, LastU, FirstV, LastV);
 
-    if (S->IsUPeriodic()) { 
+    if (S->IsUPeriodic111()) { 
       if (!SameOrientation)  NewSurface->UReverse(); 
     }
     else { 
@@ -309,7 +309,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SplitBSplineSurface
 
     NewSurface->Segment(FirstU, LastU, FirstV, LastV);
 
-    if (S->IsUPeriodic()) { 
+    if (S->IsUPeriodic111()) { 
       if (!SameOrientation)  NewSurface->UReverse(); 
     }
     else { 
@@ -506,7 +506,7 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
 
       Standard_Integer nbUSpans;
       Standard_Real AlfaU;
-      if (Strim->IsUPeriodic()) {
+      if (Strim->IsUPeriodic111()) {
         NbUKnots = 4;
         nbUSpans = 3;
         AlfaU    = M_PI / 3.;
@@ -660,20 +660,20 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
         Handle(Geom_BSplineSurface)::DownCast(Surf->Copy());
       Standard_Real umin, umax, vmin, vmax;
       BS->Bounds(umin, umax, vmin, vmax);
-      if (!BS->IsUPeriodic()) {
+      if (!BS->IsUPeriodic111()) {
         if (U1 < umin)
           U1 = umin;
         if (U2 > umax) 
           U2 = umax;
       }
 
-      if (!BS->IsVPeriodic()) {
+      if (!BS->IsVPeriodic111()) {
         if (V1 < vmin)
           V1 = vmin;
         if (V2 > vmax)
           V2 = vmax;
       }
-      if (BS->IsUPeriodic() || BS->IsVPeriodic())
+      if (BS->IsUPeriodic111() || BS->IsVPeriodic111())
         BS->CheckAndSegment (U1, U2, V1, V2);
       else
         BS->Segment (U1, U2, V1, V2);
index 6943c9231e1260428afd3356bf3b5b55d5338162..a4e5ebdc355677c0c94a074a4ffc89f9159c902b 100644 (file)
@@ -52,8 +52,8 @@ static Standard_Boolean shiftPoint (const Standard_Real theUStart, const Standar
   if (! theSurf.IsNull())
   {
     theSurf->Bounds (aUMin, aUMax, aVMin, aVMax);
-    isUPeriodic = theSurf->IsUPeriodic();
-    isVPeriodic = theSurf->IsVPeriodic();
+    isUPeriodic = theSurf->IsUPeriodic111();
+    isVPeriodic = theSurf->IsVPeriodic111();
   }
   else
   {
index 07a69e3c661f7525e4f80ffe14b16440606d4d3c..214302a71c5a37249d4fae352a93e472edf28108 100644 (file)
@@ -328,13 +328,13 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC,
 
   Standard_Integer dimResult = mySurface->NbUPoles() * gap;
   Handle(Geom_BSplineSurface) surf_deper;
-  if (mySurface->IsVPeriodic()) {
+  if (mySurface->IsVPeriodic111()) {
     surf_deper = Handle(Geom_BSplineSurface)::DownCast(mySurface->Copy());
     surf_deper->SetVNotPeriodic();
     dimResult = surf_deper->NbUPoles() * gap;
   }
   TColStd_Array1OfReal Result(1,dimResult);
-  if (mySurface->IsVPeriodic()) {
+  if (mySurface->IsVPeriodic111()) {
     ResultEval(surf_deper,V,derivative_request,Result);
   }
   else {
@@ -369,7 +369,7 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC,
 
   // verif par diff finies sous debug sauf pour les surfaces periodiques
 #ifdef OCCT_DEBUG
-  if (!mySurface->IsVPeriodic()) {
+  if (!mySurface->IsVPeriodic111()) {
     Standard_Real pas = 1.e-6, wTol = 1.e-4, pTol = 1.e-3;
     Standard_Real V1,V2;
     Standard_Boolean ok1,ok2;
@@ -421,13 +421,13 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC,
   
   Standard_Integer dimResult = mySurface->NbUPoles() * gap;
   Handle(Geom_BSplineSurface) surf_deper;
-  if (mySurface->IsVPeriodic()) {
+  if (mySurface->IsVPeriodic111()) {
     surf_deper = Handle(Geom_BSplineSurface)::DownCast(mySurface->Copy());
     surf_deper->SetVNotPeriodic();
     dimResult = surf_deper->NbUPoles() * gap;
   }
   TColStd_Array1OfReal Result(1,dimResult);
-  if (mySurface->IsVPeriodic()) {
+  if (mySurface->IsVPeriodic111()) {
     ResultEval(surf_deper,V,derivative_request,Result);
   }
   else {
@@ -463,7 +463,7 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC,
 
   // verif par diff finies sous debug sauf pour les surfaces periodiques
 #ifdef OCCT_DEBUG
-  if (!mySurface->IsVPeriodic()) {
+  if (!mySurface->IsVPeriodic111()) {
     Standard_Real V1,V2;
     Standard_Boolean ok1,ok2;
     Standard_Real pas = 1.e-6, wTol = 1.e-4, pTol = 1.e-3;
@@ -691,7 +691,7 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC,
  Standard_Boolean GeomFill_NSections::IsUPeriodic() const
 {
   if (!mySurface.IsNull())
-    return  mySurface->IsUPeriodic();
+    return  mySurface->IsUPeriodic111();
 
   return Standard_False;
 }
@@ -702,7 +702,7 @@ GeomFill_NSections::GeomFill_NSections(const TColGeom_SequenceOfCurve& NC,
  Standard_Boolean GeomFill_NSections::IsVPeriodic() const
 {
   if (!mySurface.IsNull())
-    return  mySurface->IsVPeriodic();
+    return  mySurface->IsVPeriodic111();
 
   return Standard_False;
 }
index d37105dd82811cdabbf0c21d80ef3e8d580c70a3..5f0f8f810074fdb5b2ae40d2ed8480083b20f136 100644 (file)
@@ -1035,11 +1035,11 @@ static Standard_Boolean IsSweepParallelSpine (const Handle(GeomFill_LocationLaw)
        (S,UFirst, ULast, Standard_True);
 
 #ifdef OCCT_DEBUG
-  if (isUPeriodic && !mySurface->IsUPeriodic()) 
+  if (isUPeriodic && !mySurface->IsUPeriodic111()) 
     cout<<"Pb de periodicite en U" << endl;
   if (isUPeriodic && !mySurface->IsUClosed())
     cout<<"Pb de fermeture en U" << endl;
-  if (isVPeriodic && !mySurface->IsVPeriodic()) 
+  if (isVPeriodic && !mySurface->IsVPeriodic111()) 
     cout << "Pb de periodicite en V" << endl;
   if (isVPeriodic && !mySurface->IsVClosed())
     cout<<"Pb de fermeture en V" << endl;
index e2c93ea7f0e44a8ec4d206ad4e5c23f4c7be9f08..79ee0910e0df05a08bbfa5e6462b0c64b92e769f 100644 (file)
@@ -54,7 +54,7 @@
 //=======================================================================
  static void AdjustUPeriodic (const Handle(Geom_Surface)& aS, const Handle(Geom2d_Curve)& aC2D)
 {
-  if (aC2D.IsNull() || !aS->IsUPeriodic())
+  if (aC2D.IsNull() || !aS->IsUPeriodic111())
     return;
   //
   const Standard_Real aEps=Precision::PConfusion();//1.e-9
@@ -1154,7 +1154,7 @@ void GeomInt_IntSS::BuildPCurves (Standard_Real f,
     }
   }
   //
-  if (S->IsUPeriodic() && !C2d.IsNull()) {
+  if (S->IsUPeriodic111() && !C2d.IsNull()) {
     // Recadre dans le domaine UV de la face
     Standard_Real aTm, U0, aEps, period, du, U0x;
     Standard_Boolean bAdjust;
index 210483eb2a1521338e43501fc1e6e0f3f42be171..14cb82f7089b0af058e16b9a6e59fdb450cdd833 100644 (file)
@@ -1486,7 +1486,7 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface,
     BS->IncreaseDegree(BS->UDegree(),Continuity+1);      
 
   // si BS etait periodique dans le sens de l'extension, elle ne le sera plus
-  if ( (InU&&(BS->IsUPeriodic())) || (!InU&&(BS->IsVPeriodic())) ) {
+  if ( (InU&&(BS->IsUPeriodic111())) || (!InU&&(BS->IsVPeriodic111())) ) {
     Standard_Real U0,U1,V0,V1;
     BS->Bounds(U0,U1,V0,V1);
     BS->Segment(U0,U1,V0,V1);
@@ -1829,8 +1829,8 @@ void GeomLib::ExtendSurfByLength(Handle(Geom_BoundedSurface)& Surface,
                               UKnots,VKnots,
                               UMults,VMults,
                               UDeg,VDeg,
-                              BS->IsUPeriodic(),
-                              BS->IsVPeriodic());
+                              BS->IsUPeriodic111(),
+                              BS->IsVPeriodic111());
   Surface = Res;
 }
 
@@ -1983,7 +1983,7 @@ static Standard_Boolean CanBeTreated(Handle(Geom_BSplineSurface)& BSurf)
  Standard_Real    lambda;                                    //proportionnality coefficient
  Standard_Boolean AlreadyTreated=Standard_True;
  
- if (!BSurf->IsURational()||(BSurf->IsUPeriodic()))
+ if (!BSurf->IsURational()||(BSurf->IsUPeriodic111()))
    return Standard_False;
  else {
    lambda=(BSurf->Weight(1,1)/BSurf->Weight(BSurf->NbUPoles(),1));
index ec55f8840815d7df51d35559f195ca61314f43f0..6d7030ba7021fe3a569f5173dc2d49b107443cc2 100644 (file)
@@ -82,7 +82,7 @@ Standard_Real GeomLib_DenominatorMultiplier::Value(const Standard_Real  UParamet
                         &surface_u_mults,&surface_v_mults,
                         udegree,vdegree,
                         mySurface->IsURational(),mySurface->IsVRational(),
-                        mySurface->IsUPeriodic(),mySurface->IsVPeriodic(),
+                        mySurface->IsUPeriodic111(),mySurface->IsVPeriodic111(),
                         N,Nu,Nv,
                         Dumaxv,
                         dDduumaxv,
@@ -95,7 +95,7 @@ Standard_Real GeomLib_DenominatorMultiplier::Value(const Standard_Real  UParamet
                         &surface_u_mults,&surface_v_mults,
                         udegree,vdegree,
                         mySurface->IsURational(),mySurface->IsVRational(),
-                        mySurface->IsUPeriodic(),mySurface->IsVPeriodic(),
+                        mySurface->IsUPeriodic111(),mySurface->IsVPeriodic111(),
                         N,Nu,Nv,
                         Duminv,
                         dDduuminv,
index 89f8219728edbb7f061252f2c8dad5cfaddd738f..5ec25bd7416ecd27d2952c817ab08bff60378545 100644 (file)
@@ -157,7 +157,7 @@ Standard_Boolean GeomPlate_Surface::IsVClosed() const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean GeomPlate_Surface::IsUPeriodic() const 
+Standard_Boolean GeomPlate_Surface::IsUPeriodic111() const 
 {
   return Standard_False;
 }
@@ -179,7 +179,7 @@ Standard_Real GeomPlate_Surface::UPeriod() const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean GeomPlate_Surface::IsVPeriodic() const 
+Standard_Boolean GeomPlate_Surface::IsVPeriodic111() const 
 {
   return  Standard_False;
 }
index 86dc118282d5f7ca51e827820c063a2f1adee4f0..e807fe2d6deeff05bf6516a52606aab70046726c 100644 (file)
@@ -158,7 +158,7 @@ public:
   //! P (U, V)  and the point  P (U + T, V) is lower or equal
   //! to Resolution from package gp. T is the parametric period
   //! and must be a constant.
-  Standard_EXPORT Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
   //! returns the Uperiod.
   //! raises if the surface is not uperiodic.
@@ -174,7 +174,7 @@ public:
   //! P (U, V)  and the point  P (U + T, V) is lower or equal
   //! to Resolution from package gp. T is the parametric period
   //! and must be a constant.
-  Standard_EXPORT Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
   //! returns the Vperiod.
   //! raises if the surface is not vperiodic.
index 64e80f923e97733ef158a883953fd4515ae01b54..6c5d5219b5279f81992aab45f42864ee2818477e 100644 (file)
@@ -233,8 +233,8 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface(const Handle
   Handle(IGESGeom_BSplineSurface) BSpline = new IGESGeom_BSplineSurface;
   Handle(Geom_BSplineSurface) mysurface;
   
-  Standard_Boolean PeriodU = start->IsUPeriodic();
-  Standard_Boolean PeriodV = start->IsVPeriodic();
+  Standard_Boolean PeriodU = start->IsUPeriodic111();
+  Standard_Boolean PeriodV = start->IsVPeriodic111();
   mysurface = Handle(Geom_BSplineSurface)::DownCast(start->Copy());
 
   Standard_Real Umin = Udeb, Umax = Ufin, Vmin = Vdeb, Vmax = Vfin;
@@ -278,7 +278,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface(const Handle
       Vmax = Vmin + (V1 - V0);
   }
   //unperiodize surface to get neccessary for IGES standard number of knots and mults
-  if ( mysurface->IsUPeriodic() ) {
+  if ( mysurface->IsUPeriodic111() ) {
     // set new origin for periodic BSpline surfaces for synchronization of pcurves ranges
     // and surface bounds (issue 26138)
     if (mysurface->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) {
@@ -294,7 +294,7 @@ Handle(IGESData_IGESEntity) GeomToIGES_GeomSurface::TransferSurface(const Handle
     }
     mysurface->SetUNotPeriodic();
   }
-  if ( mysurface->IsVPeriodic() ) {
+  if ( mysurface->IsVPeriodic111() ) {
     // set new origin for periodic BSpline surfaces for synchronization of pcurves ranges
     // and surface bounds (issue 26138)
     if (mysurface->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) {
index 006b8d0f0e3e6371c1de3dc1fcaf8fd95003157e..c97a5655c5eac2ddf52f72552f6ddd19f23b5d20 100644 (file)
@@ -41,7 +41,7 @@ GeomToStep_MakeBoundedSurface::GeomToStep_MakeBoundedSurface
   if (S->IsKind(STANDARD_TYPE(Geom_BSplineSurface))) {
     Handle(Geom_BSplineSurface) BS= Handle(Geom_BSplineSurface)::DownCast(S);
     // UPDATE FMA 1-04-96
-    if (S->IsUPeriodic() || S->IsVPeriodic()) {
+    if (S->IsUPeriodic111() || S->IsVPeriodic111()) {
       Handle(Geom_BSplineSurface) newBS = 
        Handle(Geom_BSplineSurface)::DownCast(BS->Copy());
       newBS->SetUNotPeriodic();
index 60dd9b3e9557f5a018c039535383eedb9133e7ba..9fdd898c4f9efc17539cf4e6713d3d1c62bcdf9d 100644 (file)
@@ -443,8 +443,8 @@ static void Print(const Handle(Geom_BSplineSurface)& S,
       OS << " vrational";
   }
 
-  Standard_Boolean uperiodic = S->IsUPeriodic();
-  Standard_Boolean vperiodic = S->IsVPeriodic();
+  Standard_Boolean uperiodic = S->IsUPeriodic111();
+  Standard_Boolean vperiodic = S->IsVPeriodic111();
   if (compact)
     OS << (uperiodic ? 1 : 0) << " ";
   else {
index 0e35b94dd49a15d16af5ce7a5a801cf43611d8f6..0da39771d99c7c8964cef2592c39c621fa2146df 100644 (file)
@@ -2719,22 +2719,19 @@ Standard_Real MaxDistance(const Handle(Geom_Curve)& theC,
 
   // adjust domain for periodic surfaces
   TopLoc_Location aLoc;
-  Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace, aLoc);
-  if (aSurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface))) {
-    aSurf = (Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf))->BasisSurface();
-  }
+  const Handle(Geom_Surface) &aSurf = BRep_Tool::Surface(aFace, aLoc);
   gp_Pnt2d pnt = aPC->Value((fp+lp)/2);
   Standard_Real u,v;
   pnt.Coord(u,v);
   //
-  if (aSurf->IsUPeriodic()) {
+  if (aSurf->IsUPeriodic111()) {
     Standard_Real aPer = aSurf->UPeriod();
     Standard_Integer nshift = (Standard_Integer) ((u-umin)/aPer);
     if (u < umin+aPer*nshift) nshift--;
     umin += aPer*nshift;
     umax += aPer*nshift;
   }
-  if (aSurf->IsVPeriodic()) {
+  if (aSurf->IsVPeriodic111()) {
     Standard_Real aPer = aSurf->VPeriod();
     Standard_Integer nshift = (Standard_Integer) ((v-vmin)/aPer);
     if (v < vmin+aPer*nshift) nshift--;
index 05b674657b1a6521b8bf2070bb9f05a9e9c89e3f..98582f7d7ee39934aec46038e50aad04ac0fbfac 100644 (file)
@@ -732,7 +732,7 @@ void LocOpe_Generator::Perform(const Handle(LocOpe_GeneratedShape)& G)
                  // on met les courbes 2d si on n`est pas sur un plan
                  // C est la courbe de edgbis, f et l s`y rapportent
                  Handle(Geom2d_Curve) PTC = GeomProjLib::Curve2d(C,f,l,S,tol);
-                 if (S->IsUPeriodic()) {
+                 if (S->IsUPeriodic111()) {
                    Standard_Real Uref;
                    if (DontFuse.IsBound(edg)) {
                      TopAbs_Orientation oredge = DontFuse(edg).Orientation();
index f09ca12182e3922770a0982a70e2df04b328f8ce..858d9d57c4d5d2c124f56d41130f7990152cb34b 100644 (file)
@@ -1735,7 +1735,7 @@ static TopoDS_Edge  NewEdge(const TopoDS_Edge& edg,
 
     }
 
-    if (S1->IsUPeriodic()) {
+    if (S1->IsUPeriodic111()) {
 
       Standard_Real speriod = S1->UPeriod();
 //      Standard_Real f,l;
index d463cf9bf1163648889bee9139a3cd9cf08b2094..c0a092dc17c3e995ed50fe6bc9b81983cec14257 100644 (file)
@@ -854,7 +854,7 @@ void PutPCurve(const TopoDS_Edge& Edg,
     B.UpdateVertex(V2,Max(old2,tol2));
   }
 
-  if (S->IsUPeriodic()) {
+  if (S->IsUPeriodic111()) {
     Standard_Real up   = S->UPeriod();
     Standard_Real tolu = Precision::PConfusion();// Epsilon(up);
     Standard_Integer nbtra = 0;
@@ -879,7 +879,7 @@ void PutPCurve(const TopoDS_Edge& Edg,
     }
   }    
 
-  if (S->IsVPeriodic()) {
+  if (S->IsVPeriodic111()) {
     Standard_Real vp   = S->VPeriod();
     Standard_Real tolv = Precision::PConfusion();// Epsilon(vp);
     Standard_Integer nbtra = 0;
@@ -997,7 +997,7 @@ void PutPCurves(const TopoDS_Edge& Efrom,
       gp_Pnt2d pf(C2d->Value(f));
       gp_Pnt2d pl(C2d->Value(l));
       
-      if (S->IsUPeriodic()) {
+      if (S->IsUPeriodic111()) {
        Standard_Real up   = S->UPeriod();
        Standard_Real tolu = Precision::PConfusion();// Epsilon(up);
        Standard_Integer nbtra = 0;
@@ -1035,7 +1035,7 @@ void PutPCurves(const TopoDS_Edge& Efrom,
        }
       }    
       
-      if (S->IsVPeriodic()) {
+      if (S->IsVPeriodic111()) {
        Standard_Real vp   = S->VPeriod();
        Standard_Real tolv = Precision::PConfusion();// Epsilon(vp);
        Standard_Integer nbtra = 0;
index 45c84fd01fba06802ed18a1e76966535318745cd..530c253d4916ec088e0006c87c5bad9213e2ac09 100644 (file)
@@ -188,8 +188,8 @@ static Standard_Integer isPeriodic(Draw_Interpretor& di, Standard_Integer argc,
       Handle(Geom_SurfaceOfRevolution) aRevolSurf = Handle(Geom_SurfaceOfRevolution)::DownCast(aSurf);
       if(aRevolSurf.IsNull()) {di << "isperiodic FAULTY. argument of command is not a surface of revolution"; return 0;}
       // 3. Verify whether entry surface is u-periodic and v-periodic
-      if(aRevolSurf->IsUPeriodic()) {di << "Surface is u-periodic \n";} else {di << "Surface is not u-periodic \n";}
-      if(aRevolSurf->IsVPeriodic()) {di << "Surface is v-periodic \n";} else {di << "Surface is not v-periodic \n";}
+      if(aRevolSurf->IsUPeriodic111()) {di << "Surface is u-periodic \n";} else {di << "Surface is not u-periodic \n";}
+      if(aRevolSurf->IsVPeriodic111()) {di << "Surface is v-periodic \n";} else {di << "Surface is not v-periodic \n";}
     }
   catch (Standard_Failure) {di << "isperiodic Exception \n" ;return 0;}
 
index 215f8824eaf30c6736535fde8108cf02f4801f04..4200a025a41548528d432f6bdc77ba97015b8c83 100644 (file)
@@ -976,22 +976,22 @@ static Standard_Integer splitface
   BRepTools::UVBounds ( face, Uf, Ul, Vf, Vl );
   Standard_Real Umin, Umax, Vmin, Vmax;
   S->Bounds ( Umin, Umax, Vmin, Vmax );
-  if ( Uf < Umin && ! S->IsUPeriodic() ) Uf = Umin;
+  if ( Uf < Umin && ! S->IsUPeriodic111() ) Uf = Umin;
   else if ( Uf > Umin ) {
     if ( Precision::IsInfinite(Umin) ) Uf -= 100;
     else Uf = Umin;
   }
-  if ( Vf < Vmin && ! S->IsVPeriodic() ) Vf = Vmin;
+  if ( Vf < Vmin && ! S->IsVPeriodic111() ) Vf = Vmin;
   else if ( Vf > Vmin ) {
     if ( Precision::IsInfinite(Vmin) ) Vf -= 100;
     else Vf = Vmin;
   }
-  if ( Ul > Umax && ! S->IsUPeriodic() ) Ul = Umax;
+  if ( Ul > Umax && ! S->IsUPeriodic111() ) Ul = Umax;
   else if ( Ul < Umax ) {
     if ( Precision::IsInfinite(Umax) ) Ul += 100;
     else Ul = Umax;
   }
-  if ( Vl > Vmax && ! S->IsVPeriodic() ) Vl = Vmax;
+  if ( Vl > Vmax && ! S->IsVPeriodic111() ) Vl = Vmax;
   else if ( Vl < Vmax ) {
     if ( Precision::IsInfinite(Vmax) ) Vl += 100;
     else Vl = Vmax;
index 2efd9c0c3376b772715ea30d92c2bc0fd2f2fd01..9bc2c8b4df8e5d2ae48520e1b06e829f0fc6ed70 100644 (file)
@@ -67,15 +67,15 @@ IMPLEMENT_STANDARD_RTTIEXT(ShapeAnalysis_Surface,Standard_Transient)
 //purpose  :
 //=======================================================================
 ShapeAnalysis_Surface::ShapeAnalysis_Surface(const Handle(Geom_Surface)& S) :
-  mySurf(S),
-  myExtOK(Standard_False), //:30
-  myNbDeg(-1),
-  myIsos(Standard_False),
-  myIsoBoxes(Standard_False),
-  myGap(0.), myUDelt(0.01), myVDelt(0.01), myUCloseVal(-1), myVCloseVal(-1)
+       mySurf (S),
+       myExtOK(Standard_False), //:30
+       myNbDeg (-1), 
+       myIsos (Standard_False),
+       myIsoBoxes (Standard_False),
+       myGap (0.), myUDelt (0.01), myVDelt (0.01), myUCloseVal (-1), myVCloseVal (-1)
 {
-  mySurf->Bounds(myUF, myUL, myVF, myVL);
-  myAdSur = new GeomAdaptor_HSurface(mySurf);
+  mySurf->Bounds(myUF,myUL,myVF,myVL);
+  myAdSur = new GeomAdaptor_HSurface (mySurf);
 }
 
 //=======================================================================
@@ -90,8 +90,8 @@ void ShapeAnalysis_Surface::Init(const Handle(Geom_Surface)& S)
   mySurf = S;
   myNbDeg = -1;
   myUCloseVal = myVCloseVal = -1;  myGap = 0.;
-  mySurf->Bounds(myUF, myUL, myVF, myVL);
-  myAdSur = new GeomAdaptor_HSurface(mySurf);
+  mySurf->Bounds (myUF,myUL,myVF,myVL);
+  myAdSur = new GeomAdaptor_HSurface (mySurf);
   myIsos = Standard_False;
   myIsoBoxes = Standard_False;
   myIsoUF.Nullify(); myIsoUL.Nullify(); myIsoVF.Nullify(); myIsoVL.Nullify();
@@ -104,11 +104,11 @@ void ShapeAnalysis_Surface::Init(const Handle(Geom_Surface)& S)
 
 void ShapeAnalysis_Surface::Init(const Handle(ShapeAnalysis_Surface)& other)
 {
-  Init(other->Surface());
+  Init (other->Surface());
   myAdSur = other->TrueAdaptor3d();
   myNbDeg = other->myNbDeg; //rln S4135 direct transmission (to avoid computation in <other>)
-  for (Standard_Integer i = 0; i < myNbDeg; i++) {
-    other->Singularity(i + 1, myPreci[i], myP3d[i], myFirstP2d[i], myLastP2d[i], myFirstPar[i], myLastPar[i], myUIsoDeg[i]);
+  for (Standard_Integer i = 0; i < myNbDeg; i ++) {
+    other->Singularity (i+1, myPreci[i], myP3d[i], myFirstP2d[i], myLastP2d[i], myFirstPar[i], myLastPar[i], myUIsoDeg[i]);
   }
 }
 
@@ -131,27 +131,27 @@ void ShapeAnalysis_Surface::ComputeSingularities()
 {
   //rln S4135
   if (myNbDeg >= 0) return;
-  //:51 abv 22 Dec 97: allow forcing:  if (myNbDeg >= 0) return;
-  //CKY 27-FEV-98 : en appel direct on peut forcer. En appel interne on optimise
+//:51 abv 22 Dec 97: allow forcing:  if (myNbDeg >= 0) return;
+//CKY 27-FEV-98 : en appel direct on peut forcer. En appel interne on optimise
   if (mySurf.IsNull())  return;
-
+  
   Standard_Real   su1, sv1, su2, sv2;
-  //  mySurf->Bounds(su1, su2, sv1, sv2);
+//  mySurf->Bounds(su1, su2, sv1, sv2);
   Bounds(su1, su2, sv1, sv2);//modified by rln on 12/11/97 mySurf-> is deleted
 
   myNbDeg = 0; //:r3
-
+  
   if (mySurf->IsKind(STANDARD_TYPE(Geom_ConicalSurface))) {
     Handle(Geom_ConicalSurface) conicS =
       Handle(Geom_ConicalSurface)::DownCast(mySurf);
-    Standard_Real vApex = -conicS->RefRadius() / Sin(conicS->SemiAngle());
-    myPreci[0] = 0;
-    myP3d[0] = conicS->Apex();
-    myFirstP2d[0].SetCoord(su1, vApex);
-    myLastP2d[0].SetCoord(su2, vApex);
+    Standard_Real vApex = - conicS->RefRadius() / Sin (conicS->SemiAngle());
+    myPreci   [0] = 0;
+    myP3d     [0] = conicS->Apex();
+    myFirstP2d[0].SetCoord (su1, vApex);
+    myLastP2d [0].SetCoord (su2, vApex);
     myFirstPar[0] = su1;
-    myLastPar[0] = su2;
-    myUIsoDeg[0] = Standard_False;
+    myLastPar [0] = su2;
+    myUIsoDeg [0] = Standard_False;
     myNbDeg = 1;
   }
   else if (mySurf->IsKind(STANDARD_TYPE(Geom_ToroidalSurface))) {
@@ -160,70 +160,70 @@ void ShapeAnalysis_Surface::ComputeSingularities()
     Standard_Real minorR = toroidS->MinorRadius();
     Standard_Real majorR = toroidS->MajorRadius();
     //szv#4:S4163:12Mar99 warning - possible div by zero
-    Standard_Real Ang = ACos(Min(1., majorR / minorR));
-    myPreci[0] = myPreci[1] = Max(0., majorR - minorR);
-    myP3d[0] = mySurf->Value(0., M_PI - Ang);
-    myFirstP2d[0].SetCoord(su1, M_PI - Ang);
-    myLastP2d[0].SetCoord(su2, M_PI - Ang);
-    myP3d[1] = mySurf->Value(0., M_PI + Ang);
-    myFirstP2d[1].SetCoord(su2, M_PI + Ang);
-    myLastP2d[1].SetCoord(su1, M_PI + Ang);
+    Standard_Real Ang = ACos (Min (1., majorR / minorR));
+    myPreci   [0] = myPreci[1] = Max (0., majorR - minorR);
+    myP3d     [0] = mySurf->Value (0., M_PI-Ang);
+    myFirstP2d[0].SetCoord (su1, M_PI-Ang);
+    myLastP2d [0].SetCoord (su2, M_PI-Ang);
+    myP3d     [1] = mySurf->Value (0., M_PI+Ang);
+    myFirstP2d[1].SetCoord (su2, M_PI+Ang);
+    myLastP2d [1].SetCoord (su1, M_PI+Ang);
     myFirstPar[0] = myFirstPar[1] = su1;
-    myLastPar[0] = myLastPar[1] = su2;
-    myUIsoDeg[0] = myUIsoDeg[1] = Standard_False;
-    myNbDeg = (majorR > minorR ? 1 : 2);
+    myLastPar [0] = myLastPar [1] = su2;
+    myUIsoDeg [0] = myUIsoDeg [1] = Standard_False;
+    myNbDeg = ( majorR > minorR ? 1 : 2 );
   }
   else if (mySurf->IsKind(STANDARD_TYPE(Geom_SphericalSurface))) {
-    myPreci[0] = myPreci[1] = 0;
-    myP3d[0] = mySurf->Value(su1, sv2); // Northern pole is first
-    myP3d[1] = mySurf->Value(su1, sv1);
-    myFirstP2d[0].SetCoord(su2, sv2);
-    myLastP2d[0].SetCoord(su1, sv2);
-    myFirstP2d[1].SetCoord(su1, sv1);
-    myLastP2d[1].SetCoord(su2, sv1);
+    myPreci   [0] = myPreci[1] = 0;
+    myP3d     [0] = mySurf->Value ( su1, sv2 ); // Northern pole is first
+    myP3d     [1] = mySurf->Value ( su1, sv1 );
+    myFirstP2d[0].SetCoord (su2, sv2);
+    myLastP2d [0].SetCoord (su1, sv2);
+    myFirstP2d[1].SetCoord (su1, sv1);
+    myLastP2d [1].SetCoord (su2, sv1);
     myFirstPar[0] = myFirstPar[1] = su1;
-    myLastPar[0] = myLastPar[1] = su2;
-    myUIsoDeg[0] = myUIsoDeg[1] = Standard_False;
+    myLastPar [0] = myLastPar [1] = su2;
+    myUIsoDeg [0] = myUIsoDeg [1] = Standard_False;
     myNbDeg = 2;
   }
-  else if ((mySurf->IsKind(STANDARD_TYPE(Geom_BoundedSurface))) ||
-    (mySurf->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) || //:b2 abv 18 Feb 98
-    (mySurf->IsKind(STANDARD_TYPE(Geom_OffsetSurface)))) { //rln S4135
-
-                                                           //rln S4135 //:r3
-    myP3d[0] = myAdSur->Value(su1, 0.5 * (sv1 + sv2));
-    myFirstP2d[0].SetCoord(su1, sv2);
-    myLastP2d[0].SetCoord(su1, sv1);
-
-    myP3d[1] = myAdSur->Value(su2, 0.5 * (sv1 + sv2));
-    myFirstP2d[1].SetCoord(su2, sv1);
-    myLastP2d[1].SetCoord(su2, sv2);
-
-    myP3d[2] = myAdSur->Value(0.5 * (su1 + su2), sv1);
-    myFirstP2d[2].SetCoord(su1, sv1);
-    myLastP2d[2].SetCoord(su2, sv1);
-
-    myP3d[3] = myAdSur->Value(0.5 * (su1 + su2), sv2);
-    myFirstP2d[3].SetCoord(su2, sv2);
-    myLastP2d[3].SetCoord(su1, sv2);
-
-    myFirstPar[0] = myFirstPar[1] = sv1;
-    myLastPar[0] = myLastPar[1] = sv2;
-    myUIsoDeg[0] = myUIsoDeg[1] = Standard_True;
-
-    myFirstPar[2] = myFirstPar[3] = su1;
-    myLastPar[2] = myLastPar[3] = su2;
-    myUIsoDeg[2] = myUIsoDeg[3] = Standard_False;
-
-    gp_Pnt Corner1 = myAdSur->Value(su1, sv1);
-    gp_Pnt Corner2 = myAdSur->Value(su1, sv2);
-    gp_Pnt Corner3 = myAdSur->Value(su2, sv1);
-    gp_Pnt Corner4 = myAdSur->Value(su2, sv2);
-
-    myPreci[0] = Max(Corner1.Distance(Corner2), Max(myP3d[0].Distance(Corner1), myP3d[0].Distance(Corner2)));
-    myPreci[1] = Max(Corner3.Distance(Corner4), Max(myP3d[1].Distance(Corner3), myP3d[1].Distance(Corner4)));
-    myPreci[2] = Max(Corner1.Distance(Corner3), Max(myP3d[2].Distance(Corner1), myP3d[2].Distance(Corner3)));
-    myPreci[3] = Max(Corner2.Distance(Corner4), Max(myP3d[3].Distance(Corner2), myP3d[3].Distance(Corner4)));
+  else if ((mySurf->IsKind(STANDARD_TYPE(Geom_BoundedSurface)))    ||
+          (mySurf->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution))) || //:b2 abv 18 Feb 98
+          (mySurf->IsKind(STANDARD_TYPE(Geom_OffsetSurface)))) { //rln S4135
+
+    //rln S4135 //:r3
+    myP3d     [0] = myAdSur->Value (su1, 0.5 * (sv1 + sv2));
+    myFirstP2d[0].SetCoord (su1, sv2); 
+    myLastP2d [0].SetCoord (su1, sv1);
+
+    myP3d     [1] = myAdSur->Value (su2, 0.5 * (sv1 + sv2));
+    myFirstP2d[1].SetCoord (su2, sv1); 
+    myLastP2d [1].SetCoord (su2, sv2);
+
+    myP3d     [2] = myAdSur->Value (0.5 * (su1 + su2), sv1);
+    myFirstP2d[2].SetCoord (su1, sv1); 
+    myLastP2d [2].SetCoord (su2, sv1);
+    
+    myP3d     [3] = myAdSur->Value (0.5 * (su1 + su2), sv2);
+    myFirstP2d[3].SetCoord (su2, sv2); 
+    myLastP2d [3].SetCoord (su1, sv2);
+
+    myFirstPar[0] = myFirstPar[1] = sv1; 
+    myLastPar [0] = myLastPar [1] = sv2;
+    myUIsoDeg [0] = myUIsoDeg [1] = Standard_True;
+
+    myFirstPar[2] = myFirstPar[3] = su1; 
+    myLastPar [2] = myLastPar [3] = su2;
+    myUIsoDeg [2] = myUIsoDeg [3] = Standard_False;
+
+    gp_Pnt Corner1 = myAdSur->Value(su1,sv1);
+    gp_Pnt Corner2 = myAdSur->Value(su1,sv2);
+    gp_Pnt Corner3 = myAdSur->Value(su2,sv1);
+    gp_Pnt Corner4 = myAdSur->Value(su2,sv2);
+
+    myPreci[0] = Max (Corner1.Distance(Corner2), Max (myP3d[0].Distance(Corner1), myP3d[0].Distance(Corner2)));
+    myPreci[1] = Max (Corner3.Distance(Corner4), Max (myP3d[1].Distance(Corner3), myP3d[1].Distance(Corner4)));
+    myPreci[2] = Max (Corner1.Distance(Corner3), Max (myP3d[2].Distance(Corner1), myP3d[2].Distance(Corner3)));
+    myPreci[3] = Max (Corner2.Distance(Corner4), Max (myP3d[3].Distance(Corner2), myP3d[3].Distance(Corner4)));
 
     myNbDeg = 4;
   }
@@ -235,7 +235,7 @@ void ShapeAnalysis_Surface::ComputeSingularities()
 //purpose  :
 //=======================================================================
 
-Standard_Boolean ShapeAnalysis_Surface::HasSingularities(const Standard_Real preci)
+Standard_Boolean ShapeAnalysis_Surface::HasSingularities (const Standard_Real preci)
 {
   return NbSingularities(preci) > 0;
 }
@@ -250,7 +250,7 @@ Standard_Integer ShapeAnalysis_Surface::NbSingularities(const Standard_Real prec
   if (myNbDeg < 0) ComputeSingularities();
   Standard_Integer Nb = 0;
   for (Standard_Integer i = 1; i <= myNbDeg; i++)
-    if (myPreci[i - 1] <= preci)
+    if (myPreci[i-1] <= preci)
       Nb++;
   return Nb;
 }
@@ -260,25 +260,25 @@ Standard_Integer ShapeAnalysis_Surface::NbSingularities(const Standard_Real prec
 //purpose  :
 //=======================================================================
 
-Standard_Boolean ShapeAnalysis_Surface::Singularity(const Standard_Integer num,
-  Standard_Real& preci,
-  gp_Pnt& P3d,
-  gp_Pnt2d& firstP2d,
-  gp_Pnt2d& lastP2d,
-  Standard_Real& firstpar,
-  Standard_Real& lastpar,
-  Standard_Boolean& uisodeg)
+ Standard_Boolean ShapeAnalysis_Surface::Singularity(const Standard_Integer num,
+                                                    Standard_Real& preci,
+                                                    gp_Pnt& P3d,
+                                                    gp_Pnt2d& firstP2d,
+                                                    gp_Pnt2d& lastP2d,
+                                                    Standard_Real& firstpar,
+                                                    Standard_Real& lastpar,
+                                                    Standard_Boolean& uisodeg)
 {
-  //  ATTENTION, les champs sont des tableaux C, n0s partent de 0. num part de 1
+//  ATTENTION, les champs sont des tableaux C, n0s partent de 0. num part de 1
   if (myNbDeg < 0) ComputeSingularities();
   if (num < 1 || num > myNbDeg) return Standard_False;
-  P3d = myP3d[num - 1];
-  preci = myPreci[num - 1];
-  firstP2d = myFirstP2d[num - 1];
-  lastP2d = myLastP2d[num - 1];
-  firstpar = myFirstPar[num - 1];
-  lastpar = myLastPar[num - 1];
-  uisodeg = myUIsoDeg[num - 1];
+  P3d      = myP3d      [num-1];
+  preci    = myPreci    [num-1];
+  firstP2d = myFirstP2d [num-1];
+  lastP2d  = myLastP2d  [num-1];
+  firstpar = myFirstPar [num-1];
+  lastpar  = myLastPar  [num-1];
+  uisodeg  = myUIsoDeg  [num-1];
   return Standard_True;
 }
 
@@ -287,11 +287,11 @@ Standard_Boolean ShapeAnalysis_Surface::Singularity(const Standard_Integer num,
 //purpose  :
 //=======================================================================
 
-Standard_Boolean ShapeAnalysis_Surface::IsDegenerated(const gp_Pnt& P3d, const Standard_Real preci)
+Standard_Boolean ShapeAnalysis_Surface::IsDegenerated(const gp_Pnt& P3d,const Standard_Real preci)
 {
-  if (myNbDeg < 0) ComputeSingularities();
-  for (Standard_Integer i = 0; i < myNbDeg && myPreci[i] <= preci; i++) {
-    myGap = myP3d[i].Distance(P3d);
+  if (myNbDeg < 0) ComputeSingularities ();
+  for (Standard_Integer i = 0; i < myNbDeg && myPreci[i] <= preci; i ++) {
+    myGap = myP3d[i].Distance (P3d);
     //rln S4135
     if (myGap <= preci)
       return Standard_True;
@@ -305,32 +305,32 @@ Standard_Boolean ShapeAnalysis_Surface::IsDegenerated(const gp_Pnt& P3d, const S
 //=======================================================================
 
 Standard_Boolean ShapeAnalysis_Surface::DegeneratedValues(const gp_Pnt& P3d,
-  const Standard_Real preci,
-  gp_Pnt2d& firstP2d,
-  gp_Pnt2d& lastP2d,
-  Standard_Real& firstPar,
-  Standard_Real& lastPar,
-  const Standard_Boolean /*forward*/)
+                                                         const Standard_Real preci,
+                                                         gp_Pnt2d& firstP2d,
+                                                         gp_Pnt2d& lastP2d,
+                                                         Standard_Real& firstPar,
+                                                         Standard_Real& lastPar,
+                                                         const Standard_Boolean /*forward*/)
 {
-  if (myNbDeg < 0) ComputeSingularities();
+  if (myNbDeg < 0) ComputeSingularities ();
   //#77 rln S4135: returning singularity which has minimum gap between singular point and input 3D point
   Standard_Integer indMin = -1;
   Standard_Real gapMin = RealLast();
-  for (Standard_Integer i = 0; i < myNbDeg && myPreci[i] <= preci; i++) {
-    myGap = myP3d[i].Distance(P3d);
+  for (Standard_Integer i = 0; i < myNbDeg && myPreci[i] <= preci; i ++) {
+    myGap = myP3d[i].Distance (P3d);
     //rln S4135
     if (myGap <= preci)
       if (gapMin > myGap) {
-        gapMin = myGap;
-        indMin = i;
+       gapMin = myGap;
+       indMin = i;
       }
   }
   if (indMin >= 0) {
     myGap = gapMin;
     firstP2d = myFirstP2d[indMin];
-    lastP2d = myLastP2d[indMin];
+    lastP2d  = myLastP2d[indMin];
     firstPar = myFirstPar[indMin];
-    lastPar = myLastPar[indMin];
+    lastPar  = myLastPar[indMin];
     return Standard_True;
   }
   return Standard_False;
@@ -342,30 +342,30 @@ Standard_Boolean ShapeAnalysis_Surface::DegeneratedValues(const gp_Pnt& P3d,
 //=======================================================================
 
 Standard_Boolean ShapeAnalysis_Surface::ProjectDegenerated(const gp_Pnt& P3d,
-  const Standard_Real preci,
-  const gp_Pnt2d& neighbour,
-  gp_Pnt2d& result)
+                                                          const Standard_Real preci,
+                                                          const gp_Pnt2d& neighbour,
+                                                          gp_Pnt2d& result)
 {
-  if (myNbDeg < 0) ComputeSingularities();
+  if (myNbDeg < 0) ComputeSingularities ();
   //added by rln on 03/12/97
   //:c1 abv 23 Feb 98: preci (3d) -> Resolution (2d)
   //#77 rln S4135
   Standard_Integer indMin = -1;
   Standard_Real gapMin = RealLast();
-  for (Standard_Integer i = 0; i < myNbDeg && myPreci[i] <= preci; i++) {
-    Standard_Real gap2 = myP3d[i].SquareDistance(P3d);
-    if (gap2 > preci*preci)
-      gap2 = Min(gap2, myP3d[i].SquareDistance(Value(result)));
+  for (Standard_Integer i = 0; i < myNbDeg && myPreci[i] <= preci; i ++) {
+    Standard_Real gap2 = myP3d[i].SquareDistance (P3d);
+    if ( gap2 > preci*preci ) 
+      gap2 = Min ( gap2, myP3d[i].SquareDistance ( Value(result) ) );
     //rln S4135
-    if (gap2 <= preci*preci && gapMin > gap2) {
+    if ( gap2 <= preci*preci && gapMin > gap2 ) {
       gapMin = gap2;
       indMin = i;
     }
   }
-  if (indMin < 0) return Standard_False;
-  myGap = Sqrt(gapMin);
-  if (!myUIsoDeg[indMin]) result.SetX(neighbour.X());
-  else                       result.SetY(neighbour.Y());
+  if ( indMin < 0 ) return Standard_False;
+  myGap = Sqrt ( gapMin );
+  if ( ! myUIsoDeg[indMin] ) result.SetX (neighbour.X());
+  else                       result.SetY (neighbour.Y());
   return Standard_True;
 }
 
@@ -376,57 +376,57 @@ Standard_Boolean ShapeAnalysis_Surface::ProjectDegenerated(const gp_Pnt& P3d,
 //=======================================================================
 
 Standard_Boolean ShapeAnalysis_Surface::ProjectDegenerated(const Standard_Integer nbrPnt,
-  const TColgp_SequenceOfPnt& points,
-  TColgp_SequenceOfPnt2d& pnt2d,
-  const Standard_Real preci,
-  const Standard_Boolean direct)
+                                                          const TColgp_SequenceOfPnt& points,
+                                                          TColgp_SequenceOfPnt2d& pnt2d,
+                                                          const Standard_Real preci,
+                                                          const Standard_Boolean direct)
 {
-  if (myNbDeg < 0) ComputeSingularities();
-
+  if (myNbDeg < 0) ComputeSingularities ();
+  
   Standard_Integer step = (direct ? 1 : -1);
   //#77 rln S4135
   Standard_Integer indMin = -1;
   Standard_Real gapMin = RealLast(), prec2 = preci*preci;
   Standard_Integer j = (direct ? 1 : nbrPnt);
-  for (Standard_Integer i = 0; i < myNbDeg && myPreci[i] <= preci; i++) {
-    Standard_Real gap2 = myP3d[i].SquareDistance(points(j));
-    if (gap2 > prec2)
-      gap2 = Min(gap2, myP3d[i].SquareDistance(Value(pnt2d(j))));
-    if (gap2 <= prec2 && gapMin > gap2) {
+  for (Standard_Integer i = 0; i < myNbDeg && myPreci[i] <= preci; i ++) {
+    Standard_Real gap2 = myP3d[i].SquareDistance (points(j));
+    if ( gap2 > prec2 ) 
+      gap2 = Min ( gap2, myP3d[i].SquareDistance ( Value(pnt2d(j)) ) );
+    if ( gap2 <= prec2 && gapMin > gap2 ) {
       gapMin = gap2;
       indMin = i;
     }
   }
-  if (indMin <0) return Standard_False;
+  if ( indMin <0 ) return Standard_False;
 
-  myGap = Sqrt(gapMin);
+  myGap = Sqrt ( gapMin );
   gp_Pnt2d pk;
-
+    
   Standard_Integer k; // svv Jan11 2000 : porting on DEC
-  for (k = j + step; k <= nbrPnt && k >= 1; k += step) {
-    pk = pnt2d(k);
+  for ( k=j+step; k <= nbrPnt && k >= 1; k += step ) {
+    pk = pnt2d(k); 
     gp_Pnt P1 = points(k);
-    if (myP3d[indMin].SquareDistance(P1) > prec2 &&
-      myP3d[indMin].SquareDistance(Value(pk)) > prec2)
+    if ( myP3d[indMin].SquareDistance(P1) > prec2 &&
+        myP3d[indMin].SquareDistance(Value(pk)) > prec2 )
       break;
   }
-
+    
   //:p8 abv 11 Mar 99: PRO7226 #489490: if whole pcurve is degenerate, distribute evenly
-  if (k <1 || k > nbrPnt) {
-    Standard_Real x1 = (myUIsoDeg[indMin] ? pnt2d(1).Y() : pnt2d(1).X());
-    Standard_Real x2 = (myUIsoDeg[indMin] ? pnt2d(nbrPnt).Y() : pnt2d(nbrPnt).X());
-    for (j = 1; j <= nbrPnt; j++) {
+  if ( k <1 || k > nbrPnt ) { 
+    Standard_Real x1 = ( myUIsoDeg[indMin] ? pnt2d(1).Y() : pnt2d(1).X() );
+    Standard_Real x2 = ( myUIsoDeg[indMin] ? pnt2d(nbrPnt).Y() : pnt2d(nbrPnt).X() );
+    for ( j = 1; j <= nbrPnt; j++ ) {
       //szv#4:S4163:12Mar99 warning - possible div by zero
-      Standard_Real x = (x1 * (nbrPnt - j) + x2 * (j - 1)) / (nbrPnt - 1);
-      if (!myUIsoDeg[indMin]) pnt2d(j).SetX(x);
-      else                       pnt2d(j).SetY(x);
+      Standard_Real x = ( x1 * ( nbrPnt - j ) + x2 * ( j - 1 ) ) / ( nbrPnt - 1 );
+      if ( ! myUIsoDeg[indMin] ) pnt2d(j).SetX ( x );
+      else                       pnt2d(j).SetY ( x );
     }
     return Standard_True;
   }
 
-  for (j = k - step; j <= nbrPnt && j >= 1; j -= step) {
-    if (!myUIsoDeg[indMin]) pnt2d(j).SetX(pk.X());
-    else                    pnt2d(j).SetY(pk.Y());
+  for ( j = k-step; j <= nbrPnt && j >= 1; j -= step) {
+    if (!myUIsoDeg[indMin]) pnt2d(j).SetX (pk.X());
+    else                    pnt2d(j).SetY (pk.Y());
   }
   return Standard_True;
 }
@@ -436,25 +436,25 @@ Standard_Boolean ShapeAnalysis_Surface::ProjectDegenerated(const Standard_Intege
 //purpose:
 //=======================================================================
 
-Standard_Boolean ShapeAnalysis_Surface::IsDegenerated(const gp_Pnt2d &p2d1,
-  const gp_Pnt2d &p2d2,
-  const Standard_Real tol,
-  const Standard_Real ratio)
+Standard_Boolean ShapeAnalysis_Surface::IsDegenerated (const gp_Pnt2d &p2d1, 
+                                                      const gp_Pnt2d &p2d2,
+                                                      const Standard_Real tol, 
+                                                      const Standard_Real ratio)
 {
-  gp_Pnt p1 = Value(p2d1);
-  gp_Pnt p2 = Value(p2d2);
-  gp_Pnt pm = Value(0.5 * (p2d1.XY() + p2d2.XY()));
-  Standard_Real max3d = Max(p1.Distance(p2),
-    Max(pm.Distance(p1), pm.Distance(p2)));
-  if (max3d > tol) return Standard_False;
+  gp_Pnt p1 = Value ( p2d1 );
+  gp_Pnt p2 = Value ( p2d2 );
+  gp_Pnt pm = Value ( 0.5 * ( p2d1.XY() + p2d2.XY() ) );
+  Standard_Real max3d = Max ( p1.Distance ( p2 ), 
+                             Max ( pm.Distance ( p1 ), pm.Distance ( p2 ) ) );
+  if ( max3d > tol ) return Standard_False;
 
   GeomAdaptor_Surface& SA = Adaptor3d()->ChangeSurface();
-  Standard_Real RU = SA.UResolution(1.);
-  Standard_Real RV = SA.VResolution(1.);
+  Standard_Real RU = SA.UResolution ( 1. );
+  Standard_Real RV = SA.VResolution ( 1. );
 
-  if (RU < Precision::PConfusion() || RV < Precision::PConfusion()) return 0;
-  Standard_Real du = Abs(p2d1.X() - p2d2.X()) / RU;
-  Standard_Real dv = Abs(p2d1.Y() - p2d2.Y()) / RV;
+  if ( RU < Precision::PConfusion() || RV < Precision::PConfusion() ) return 0;
+  Standard_Real du = Abs ( p2d1.X() - p2d2.X() ) / RU; 
+  Standard_Real dv = Abs ( p2d1.Y() - p2d2.Y() ) / RV; 
   max3d *= ratio;
   return du * du + dv * dv > max3d * max3d;
 }
@@ -465,19 +465,19 @@ Standard_Boolean ShapeAnalysis_Surface::IsDegenerated(const gp_Pnt2d &p2d1,
 //=======================================================================
 
 static Handle(Geom_Curve) ComputeIso
-(const Handle(Geom_Surface)& surf,
-  const Standard_Boolean utype, const Standard_Real par)
+  (const Handle(Geom_Surface)& surf,
+   const Standard_Boolean utype, const Standard_Real par)
 {
   Handle(Geom_Curve) iso;
   try {
     OCC_CATCH_SIGNALS
-      if (utype) iso = surf->UIso(par);
-      else       iso = surf->VIso(par);
+    if (utype) iso = surf->UIso (par);
+    else       iso = surf->VIso (par);
   }
-  catch (Standard_Failure const& anException) {
+  catch(Standard_Failure const& anException) {
 #ifdef OCCT_DEBUG
-    //:s5
-    cout << "\nWarning: ShapeAnalysis_Surface, ComputeIso(): Exception in UVIso(): ";
+//:s5
+    cout << "\nWarning: ShapeAnalysis_Surface, ComputeIso(): Exception in UVIso(): "; 
     anException.Print(cout); cout << endl;
 #endif
     (void)anException;
@@ -494,11 +494,11 @@ static Handle(Geom_Curve) ComputeIso
 void ShapeAnalysis_Surface::ComputeBoundIsos()
 {
   if (myIsos) return;
-  myIsos = Standard_True;
-  myIsoUF = ComputeIso(mySurf, Standard_True, myUF);
-  myIsoUL = ComputeIso(mySurf, Standard_True, myUL);
-  myIsoVF = ComputeIso(mySurf, Standard_False, myVF);
-  myIsoVL = ComputeIso(mySurf, Standard_False, myVL);
+  myIsos  = Standard_True;
+  myIsoUF = ComputeIso (mySurf,Standard_True, myUF);
+  myIsoUL = ComputeIso (mySurf,Standard_True, myUL);
+  myIsoVF = ComputeIso (mySurf,Standard_False,myVF);
+  myIsoVL = ComputeIso (mySurf,Standard_False,myVL);
 }
 
 //=======================================================================
@@ -508,9 +508,9 @@ void ShapeAnalysis_Surface::ComputeBoundIsos()
 
 Handle(Geom_Curve) ShapeAnalysis_Surface::UIso(const Standard_Real U)
 {
-  if (U == myUF) { ComputeBoundIsos();  return myIsoUF; }
-  if (U == myUL) { ComputeBoundIsos();  return myIsoUL; }
-  return ComputeIso(mySurf, Standard_True, U);
+  if (U == myUF)  {  ComputeBoundIsos();  return myIsoUF;  }
+  if (U == myUL)  {  ComputeBoundIsos();  return myIsoUL;  }
+  return ComputeIso (mySurf,Standard_True, U);
 }
 
 //=======================================================================
@@ -520,9 +520,9 @@ Handle(Geom_Curve) ShapeAnalysis_Surface::UIso(const Standard_Real U)
 
 Handle(Geom_Curve) ShapeAnalysis_Surface::VIso(const Standard_Real V)
 {
-  if (V == myVF) { ComputeBoundIsos();  return myIsoVF; }
-  if (V == myVL) { ComputeBoundIsos();  return myIsoVL; }
-  return ComputeIso(mySurf, Standard_False, V);
+  if (V == myVF)  {  ComputeBoundIsos();  return myIsoVF;  }
+  if (V == myVL)  {  ComputeBoundIsos();  return myIsoVL;  }
+  return ComputeIso (mySurf,Standard_False,V);
 }
 
 //=======================================================================
@@ -532,14 +532,14 @@ Handle(Geom_Curve) ShapeAnalysis_Surface::VIso(const Standard_Real V)
 
 Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci)
 {
-  Standard_Real prec = Max(preci, Precision::Confusion());
+  Standard_Real prec = Max (preci, Precision::Confusion());
   Standard_Real anUmidVal = -1.;
   if (myUCloseVal < 0)
   {
-    //    Faut calculer : calculs minimaux
-    Standard_Real uf, ul, vf, vl;
-    Bounds(uf, ul, vf, vl);//modified by rln on 12/11/97 mySurf-> is deleted
-    //mySurf->Bounds (uf,ul,vf,vl);
+//    Faut calculer : calculs minimaux
+    Standard_Real uf,ul,vf,vl;
+    Bounds (uf,ul,vf,vl);//modified by rln on 12/11/97 mySurf-> is deleted
+//    mySurf->Bounds (uf,ul,vf,vl);
     if (Precision::IsInfinite(uf) || Precision::IsInfinite(ul))
     {
       myUDelt = 0.;
@@ -547,7 +547,7 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci)
     else
     {
       myUDelt = Abs(ul - uf) / 20;//modified by rln 11/11/97 instead of 10
-                                  //because of the example when 10 was not enough
+                                     //because of the example when 10 was not enough
     }
     if (mySurf->IsUClosed())
     {
@@ -557,11 +557,11 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci)
       return Standard_True;
     }
 
-    //Calculs adaptes
+//    Calculs adaptes
     //#67 rln S4135
     GeomAdaptor_Surface& SurfAdapt = Adaptor3d()->ChangeSurface();
     GeomAbs_SurfaceType surftype = SurfAdapt.GetType();
-    if (mySurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
+    if (mySurf->IsKind (STANDARD_TYPE (Geom_RectangularTrimmedSurface)))
     {
       surftype = GeomAbs_OtherSurface;
     }
@@ -576,15 +576,15 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci)
     case GeomAbs_SurfaceOfExtrusion:
     { //:c8 abv 03 Mar 98: UKI60094 #753: process Geom_SurfaceOfLinearExtrusion
       Handle(Geom_SurfaceOfLinearExtrusion) extr =
-        Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(mySurf);
+       Handle(Geom_SurfaceOfLinearExtrusion)::DownCast(mySurf);
       Handle(Geom_Curve) crv = extr->BasisCurve();
       Standard_Real f = crv->FirstParameter();
       Standard_Real l = crv->LastParameter();
       //:r3 abv (smh) 30 Mar 99: protect against unexpected signals
       if (!Precision::IsInfinite(f) && !Precision::IsInfinite(l))
       {
-        gp_Pnt p1 = crv->Value(f);
-        gp_Pnt p2 = crv->Value(l);
+       gp_Pnt p1 = crv->Value ( f );
+       gp_Pnt p2 = crv->Value ( l );
         myUCloseVal = p1.SquareDistance(p2);
         gp_Pnt pm = crv->Value((f + l) / 2.);
         anUmidVal = p1.SquareDistance(pm);
@@ -600,52 +600,52 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci)
       Handle(Geom_BSplineSurface) bs = Handle(Geom_BSplineSurface)::DownCast(mySurf);
       Standard_Integer nbup = bs->NbUPoles();
       Standard_Real distmin = RealLast();
-      if (bs->IsUPeriodic())
+      if (bs->IsUPeriodic111())
       {
-        myUCloseVal = 0;
-        myUDelt = 0;
+       myUCloseVal = 0;
+       myUDelt = 0;
       }
       else if (nbup < 3)
       {//modified by rln on 12/11/97
-        myUCloseVal = RealLast();
+       myUCloseVal = RealLast();
       }
       else if (bs->IsURational() ||
-        //#6 rln 20/02/98 ProSTEP ug_exhaust-A.stp entity #18360 (Uclosed BSpline,
-        //but multiplicity of boundary knots != degree + 1)
-        bs->UMultiplicity(1) != bs->UDegree() + 1 ||  //#6 //:h4: #6 moved
+              //#6 rln 20/02/98 ProSTEP ug_exhaust-A.stp entity #18360 (Uclosed BSpline,
+              //but multiplicity of boundary knots != degree + 1)
+              bs->UMultiplicity(1)              != bs->UDegree()+1 ||  //#6 //:h4: #6 moved
         bs->UMultiplicity(bs->NbUKnots()) != bs->UDegree() + 1)
       { //#6 //:h4
-        Standard_Integer nbvk = bs->NbVKnots();
+       Standard_Integer nbvk = bs->NbVKnots();
         Standard_Real v = bs->VKnot(1);
-        gp_Pnt p1 = SurfAdapt.Value(uf, v);
-        gp_Pnt p2 = SurfAdapt.Value(ul, v);
+         gp_Pnt p1 = SurfAdapt.Value (uf, v);
+         gp_Pnt p2 = SurfAdapt.Value (ul, v);
         myUCloseVal = p1.SquareDistance(p2);
         gp_Pnt pm = SurfAdapt.Value((uf + ul) / 2., v);
         anUmidVal = p1.SquareDistance(pm);
         distmin = myUCloseVal;
         for (Standard_Integer i = 2; i <= nbvk; i++)
         {
-          v = 0.5 * (bs->VKnot(i - 1) + bs->VKnot(i));
-          p1 = bs->Value(uf, v);
-          p2 = bs->Value(ul, v);
+           v = 0.5 * (bs->VKnot(i-1) + bs->VKnot(i));
+           p1 = bs->Value (uf, v);
+           p2 = bs->Value (ul, v);
           Standard_Real aDist = p1.SquareDistance(p2);
           if (aDist > myUCloseVal)
           {
             myUCloseVal = aDist;
             pm = bs->Value((uf + ul) / 2., v);
             anUmidVal = p1.SquareDistance(pm);
-          }
+         }
           else
           {
             distmin = Min(distmin, aDist);
-          }
+       }
         }
-        distmin = Sqrt(distmin);
-        myUDelt = Min(myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); //#4 smh
+       distmin     = Sqrt (distmin);
+       myUDelt     = Min (myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); //#4 smh
       }
       else
       {
-        Standard_Integer nbvp = bs->NbVPoles();
+       Standard_Integer nbvp = bs->NbVPoles();
         myUCloseVal = bs->Pole(1, 1).SquareDistance(bs->Pole(nbup, 1));
         anUmidVal = bs->Pole(1, 1).SquareDistance(bs->Pole(nbup / 2 + 1, 1));
         distmin = myUCloseVal;
@@ -656,14 +656,14 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci)
           {
             myUCloseVal = aDist;
             anUmidVal = bs->Pole(1, i).SquareDistance(bs->Pole(nbup / 2 + 1, i));
-          }
+       }
           else
           {
             distmin = Min(distmin, aDist);
           }
         }
-        distmin = Sqrt(distmin);
-        myUDelt = Min(myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); //#4 smh
+       distmin     = Sqrt (distmin);
+       myUDelt     = Min (myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); //#4 smh
       }
       break;
     }
@@ -674,11 +674,11 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci)
       Standard_Real distmin = RealLast();
       if (nbup < 3)
       {
-        myUCloseVal = RealLast();
+       myUCloseVal = RealLast();
       }
       else
       {
-        Standard_Integer nbvp = bz->NbVPoles();
+       Standard_Integer nbvp = bz->NbVPoles();
         myUCloseVal = bz->Pole(1, 1).SquareDistance(bz->Pole(nbup, 1));
         anUmidVal = bz->Pole(1, 1).SquareDistance(bz->Pole(nbup / 2 + 1, 1));
         distmin = myUCloseVal;
@@ -688,14 +688,14 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci)
           if (aDist > myUCloseVal) {
             myUCloseVal = aDist;
             anUmidVal = bz->Pole(1, i).SquareDistance(bz->Pole(nbup / 2 + 1, i));
-          }
+       }
           else
           {
             distmin = Min(distmin, aDist);
           }
         }
-        distmin = Sqrt(distmin);
-        myUDelt = Min(myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); //#4 smh
+       distmin     = Sqrt (distmin);
+       myUDelt     = Min (myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); //#4 smh
       }
       break;
     }
@@ -720,14 +720,14 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci)
           myUCloseVal = aDist;
           pm = SurfAdapt.Value((uf + ul) / 2, vparam);
           anUmidVal = p1.SquareDistance(pm);
-        }
+      }
         else
         {
           distmin = Min(distmin, aDist);
         }
       }
-      distmin = Sqrt(distmin);
-      myUDelt = Min(myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); //#4 smh
+      distmin     = Sqrt (distmin);
+      myUDelt     = Min (myUDelt, 0.5 * SurfAdapt.UResolution(distmin)); //#4 smh
       break;
     }
     } //switch
@@ -751,14 +751,14 @@ Standard_Boolean ShapeAnalysis_Surface::IsUClosed(const Standard_Real preci)
 
 Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci)
 {
-  Standard_Real prec = Max(preci, Precision::Confusion());
+  Standard_Real prec = Max (preci, Precision::Confusion());
   Standard_Real aVmidVal = -1.;
   if (myVCloseVal < 0)
   {
-    //    Faut calculer : calculs minimaux
-    Standard_Real uf, ul, vf, vl;
-    Bounds(uf, ul, vf, vl);//modified by rln on 12/11/97 mySurf-> is deleted
-                           //    mySurf->Bounds (uf,ul,vf,vl);
+//    Faut calculer : calculs minimaux
+    Standard_Real uf,ul,vf,vl;
+    Bounds (uf,ul,vf,vl);//modified by rln on 12/11/97 mySurf-> is deleted
+//    mySurf->Bounds (uf,ul,vf,vl);
     if (Precision::IsInfinite(vf) || Precision::IsInfinite(vl))
     {
       myVDelt = 0.;
@@ -766,7 +766,7 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci)
     else
     {
       myVDelt = Abs(vl - vf) / 20;// 2; rln S4135
-                                  //because of the example when 10 was not enough
+                                    //because of the example when 10 was not enough
     }
     if (mySurf->IsVClosed())
     {
@@ -776,11 +776,11 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci)
       return Standard_True;
     }
 
-    //    Calculs adaptes
+//    Calculs adaptes
     //#67 rln S4135
     GeomAdaptor_Surface& SurfAdapt = Adaptor3d()->ChangeSurface();
     GeomAbs_SurfaceType surftype = SurfAdapt.GetType();
-    if (mySurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
+    if (mySurf->IsKind (STANDARD_TYPE (Geom_RectangularTrimmedSurface)))
     {
       surftype = GeomAbs_OtherSurface;
     }
@@ -799,10 +799,10 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci)
     case GeomAbs_SurfaceOfRevolution:
     {
       Handle(Geom_SurfaceOfRevolution) revol =
-        Handle(Geom_SurfaceOfRevolution)::DownCast(mySurf);
+       Handle(Geom_SurfaceOfRevolution)::DownCast(mySurf);
       Handle(Geom_Curve) crv = revol->BasisCurve();
-      gp_Pnt p1 = crv->Value(crv->FirstParameter());
-      gp_Pnt p2 = crv->Value(crv->LastParameter());
+      gp_Pnt p1 = crv->Value ( crv->FirstParameter() );
+      gp_Pnt p2 = crv->Value ( crv->LastParameter() );
       myVCloseVal = p1.SquareDistance(p2);
       break;
     }
@@ -811,50 +811,50 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci)
       Handle(Geom_BSplineSurface) bs = Handle(Geom_BSplineSurface)::DownCast(mySurf);
       Standard_Integer nbvp = bs->NbVPoles();
       Standard_Real distmin = RealLast();
-      if (bs->IsVPeriodic())
+      if (bs->IsVPeriodic111())
       {
-        myVCloseVal = 0;
-        myVDelt = 0;
+       myVCloseVal = 0;
+       myVDelt = 0;
       }
       else if (nbvp < 3)
       {//modified by rln on 12/11/97
-        myVCloseVal = RealLast();
+       myVCloseVal = RealLast();
       }
       else if (bs->IsVRational() ||
-        bs->VMultiplicity(1) != bs->VDegree() + 1 ||  //#6 //:h4
+              bs->VMultiplicity(1)              != bs->VDegree()+1 ||  //#6 //:h4
         bs->VMultiplicity(bs->NbVKnots()) != bs->VDegree() + 1)
       { //#6 //:h4
-        Standard_Integer nbuk = bs->NbUKnots();
+       Standard_Integer nbuk = bs->NbUKnots();
         Standard_Real u = bs->UKnot(1);
-        gp_Pnt p1 = SurfAdapt.Value(u, vf);
-        gp_Pnt p2 = SurfAdapt.Value(u, vl);
+         gp_Pnt p1 = SurfAdapt.Value (u, vf);
+         gp_Pnt p2 = SurfAdapt.Value (u, vl);
         myVCloseVal = p1.SquareDistance(p2);
         gp_Pnt pm = SurfAdapt.Value(u, (vf + vl) / 2.);
         aVmidVal = p1.SquareDistance(pm);
         distmin = myVCloseVal;
         for (Standard_Integer i = 2; i <= nbuk; i++)
         {
-          u = 0.5 * (bs->UKnot(i - 1) + bs->UKnot(i));
-          p1 = SurfAdapt.Value(u, vf);
-          p2 = SurfAdapt.Value(u, vl);
+           u = 0.5 * (bs->UKnot(i-1) + bs->UKnot(i));
+           p1 = SurfAdapt.Value (u, vf);
+           p2 = SurfAdapt.Value (u, vl);
           Standard_Real aDist = p1.SquareDistance(p2);
           if (aDist > myVCloseVal)
           {
             myVCloseVal = aDist;
             pm = SurfAdapt.Value(u, (vf + vl) / 2);
             aVmidVal = p1.SquareDistance(pm);
-          }
+         }
           else
           {
             distmin = Min(distmin, aDist);
-          }
+       }
         }
-        distmin = Sqrt(distmin);
-        myVDelt = Min(myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); //#4 smh
+       distmin     = Sqrt (distmin);
+       myVDelt     = Min (myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); //#4 smh
       }
       else
       {
-        Standard_Integer nbup = bs->NbUPoles();
+       Standard_Integer nbup = bs->NbUPoles();
         myVCloseVal = bs->Pole(1, 1).SquareDistance(bs->Pole(1, nbvp));
         aVmidVal = bs->Pole(1, 1).SquareDistance(bs->Pole(1, nbvp / 2 + 1));
         distmin = myVCloseVal;
@@ -865,14 +865,14 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci)
           {
             myVCloseVal = aDist;
             aVmidVal = bs->Pole(i, 1).SquareDistance(bs->Pole(i, nbvp / 2 + 1));
-          }
+       }
           else
           {
             distmin = Min(distmin, aDist);
           }
         }
-        distmin = Sqrt(distmin);
-        myVDelt = Min(myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); //#4 smh
+       distmin     = Sqrt (distmin);
+       myVDelt     = Min (myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); //#4 smh
       }
       break;
     }
@@ -883,11 +883,11 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci)
       Standard_Real distmin = RealLast();
       if (nbvp < 3)
       {
-        myVCloseVal = RealLast();
+       myVCloseVal = RealLast();
       }
       else
       {
-        Standard_Integer nbup = bz->NbUPoles();
+       Standard_Integer nbup = bz->NbUPoles();
         myVCloseVal = bz->Pole(1, 1).SquareDistance(bz->Pole(1, nbvp));
         aVmidVal = bz->Pole(1, 1).SquareDistance(bz->Pole(1, nbvp / 2 + 1));
         distmin = myVCloseVal;
@@ -898,14 +898,14 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci)
           {
             myVCloseVal = aDist;
             aVmidVal = bz->Pole(i, 1).SquareDistance(bz->Pole(i, nbvp / 2 + 1));
-          }
+       }
           else
           {
             distmin = Min(distmin, aDist);
           }
         }
-        distmin = Sqrt(distmin);
-        myVDelt = Min(myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); //#4 smh
+       distmin     = Sqrt (distmin);
+       myVDelt     = Min (myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); //#4 smh
       }
       break;
     }
@@ -930,14 +930,14 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci)
           myVCloseVal = aDist;
           pm = SurfAdapt.Value(uparam, (vf + vl) / 2);
           aVmidVal = p1.SquareDistance(pm);
-        }
+      }
         else
         {
           distmin = Min(distmin, aDist);
         }
       }
-      distmin = Sqrt(distmin);
-      myVDelt = Min(myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); //#4 smh
+      distmin     = Sqrt (distmin);
+      myVDelt     = Min (myVDelt, 0.5 * SurfAdapt.VResolution(distmin)); //#4 smh
       break;
     }
     } //switch
@@ -960,77 +960,77 @@ Standard_Boolean ShapeAnalysis_Surface::IsVClosed(const Standard_Real preci)
 //purpose  : Newton algo (S4030)
 //=======================================================================
 Standard_Integer ShapeAnalysis_Surface::SurfaceNewton(const gp_Pnt2d &p2dPrev,
-  const gp_Pnt& P3D,
-  const Standard_Real preci,
-  gp_Pnt2d &sol)
+                                                      const gp_Pnt& P3D,
+                                                      const Standard_Real preci,
+                                                      gp_Pnt2d &sol)
 {
   GeomAdaptor_Surface& SurfAdapt = Adaptor3d()->ChangeSurface();
   Standard_Real uf, ul, vf, vl;
   Bounds(uf, ul, vf, vl);
-  Standard_Real du = SurfAdapt.UResolution(preci);
-  Standard_Real dv = SurfAdapt.VResolution(preci);
+  Standard_Real du = SurfAdapt.UResolution (preci);
+  Standard_Real dv = SurfAdapt.VResolution (preci);
   Standard_Real UF = uf - du, UL = ul + du;
   Standard_Real VF = vf - dv, VL = vl + dv;
 
-  //Standard_Integer fail = 0;
+//Standard_Integer fail = 0;
   Standard_Real Tol = Precision::Confusion();
   Standard_Real Tol2 = Tol * Tol;//, rs2p=1e10;
   Standard_Real U = p2dPrev.X(), V = p2dPrev.Y();
-  gp_Vec rsfirst = P3D.XYZ() - Value(U, V).XYZ(); //pdn
-  for (Standard_Integer i = 0; i < 25; i++) {
+  gp_Vec rsfirst = P3D.XYZ() - Value ( U, V ).XYZ(); //pdn
+  for ( Standard_Integer i=0; i < 25; i++ ) {
     gp_Vec ru, rv, ruu, rvv, ruv;
     gp_Pnt pnt;
-    SurfAdapt.D2(U, V, pnt, ru, rv, ruu, rvv, ruv);
+    SurfAdapt.D2 ( U, V, pnt, ru, rv, ruu, rvv, ruv );
 
     // normal
     Standard_Real ru2 = ru * ru, rv2 = rv * rv;
     gp_Vec n = ru ^ rv;
     Standard_Real nrm2 = n.SquareMagnitude();
-    if (nrm2 < 1e-10 || Precision::IsPositiveInfinite(nrm2)) break; // n == 0, use standard
-
-                                                                    // descriminant
-    gp_Vec rs = P3D.XYZ() - Value(U, V).XYZ();
-    Standard_Real rSuu = (rs * ruu);
-    Standard_Real rSvv = (rs * rvv);
-    Standard_Real rSuv = (rs * ruv);
-    Standard_Real D = -nrm2 + rv2 * rSuu + ru2 * rSvv -
-      2 * rSuv * (ru*rv) + rSuv*rSuv - rSuu*rSvv;
-    if (fabs(D) < 1e-10) break; // bad case; use standard
-
-                                // compute step
+    if ( nrm2 < 1e-10 || Precision::IsPositiveInfinite(nrm2)) break; // n == 0, use standard
+
+    // descriminant
+    gp_Vec rs = P3D.XYZ() - Value ( U, V ).XYZ();
+    Standard_Real rSuu = ( rs * ruu );
+    Standard_Real rSvv = ( rs * rvv );
+    Standard_Real rSuv = ( rs * ruv );
+    Standard_Real D = -nrm2 + rv2 * rSuu + ru2 * rSvv - 
+                      2 * rSuv * (ru*rv) + rSuv*rSuv - rSuu*rSvv;
+    if ( fabs ( D ) < 1e-10 ) break; // bad case; use standard
+
+    // compute step
     Standard_Real fract = 1. / D;
-    du = (rs * ((n ^ rv) + ru * rSvv - rv * rSuv)) * fract;
-    dv = (rs * ((ru ^ n) + rv * rSuu - ru * rSuv)) * fract;
+    du = ( rs * ( ( n ^ rv ) + ru * rSvv - rv * rSuv ) ) * fract;
+    dv = ( rs * ( ( ru ^ n ) + rv * rSuu - ru * rSuv ) ) * fract;
     U += du;
     V += dv;
-    if (U < UF || U > UL || V < VF || V > VL) break;
+    if ( U < UF || U > UL || V < VF || V > VL ) break;
     // check that iterations do not diverge
-    //pdn    Standard_Real rs2 = rs.SquareMagnitude();
-    //    if ( rs2 > 4.*rs2p ) break;
-    //    rs2p = rs2;
+//pdn    Standard_Real rs2 = rs.SquareMagnitude();
+//    if ( rs2 > 4.*rs2p ) break;
+//    rs2p = rs2;
 
     // test the step by uv and deviation from the solution
-    Standard_Real aResolution = Max(1e-12, (U + V)*10e-16);
-    if (fabs(du) + fabs(dv) > aResolution) continue; //Precision::PConfusion()  continue;
+    Standard_Real aResolution = Max(1e-12,(U+V)*10e-16);
+    if ( fabs ( du ) + fabs ( dv ) > aResolution ) continue; //Precision::PConfusion()  continue;
 
-                                                     //if ( U < UF || U > UL || V < VF || V > VL ) break;
+    //if ( U < UF || U > UL || V < VF || V > VL ) break;
 
-                                                     //pdn PRO10109 4517: protect against wrong result
+    //pdn PRO10109 4517: protect against wrong result
     Standard_Real rs2 = rs.SquareMagnitude();
-    if (rs2 > rsfirst.SquareMagnitude()) break;
+    if ( rs2 > rsfirst.SquareMagnitude() ) break;
 
     Standard_Real rsn = rs * n;
-    if (rs2 - rsn * rsn / nrm2 > Tol2) break;
+    if ( rs2 - rsn * rsn / nrm2 > Tol2 ) break;
 
-    //  if ( rs2 > 100 * preci * preci ) { fail = 6; break; }
+//  if ( rs2 > 100 * preci * preci ) { fail = 6; break; }
 
     // OK, return the result
-    // cout << "Newton: solution found in " << i+1 << " iterations" << endl;
-    sol.SetCoord(U, V);
-
-    return (nrm2 < 0.01 * ru2 * rv2 ? 2 : 1); //:q6
+//     cout << "Newton: solution found in " << i+1 << " iterations" << endl;
+    sol.SetCoord( U, V );
+    
+    return ( nrm2 < 0.01 * ru2 * rv2 ? 2 : 1 ); //:q6
   }
-  //      cout << "Newton: failed after " << i+1 << " iterations (fail " << fail << " )" << endl;
+//      cout << "Newton: failed after " << i+1 << " iterations (fail " << fail << " )" << endl;
   return Standard_False;
 }
 
@@ -1040,74 +1040,74 @@ Standard_Integer ShapeAnalysis_Surface::SurfaceNewton(const gp_Pnt2d &p2dPrev,
 //=======================================================================
 
 gp_Pnt2d ShapeAnalysis_Surface::NextValueOfUV(const gp_Pnt2d &p2dPrev,
-  const gp_Pnt& P3D,
-  const Standard_Real preci,
-  const Standard_Real maxpreci)
+                                              const gp_Pnt& P3D,
+                                              const Standard_Real preci,
+                                              const Standard_Real maxpreci)
 {
   GeomAdaptor_Surface& SurfAdapt = Adaptor3d()->ChangeSurface();
   GeomAbs_SurfaceType surftype = SurfAdapt.GetType();
 
-  switch (surftype) {
-  case GeomAbs_BezierSurface:
-  case GeomAbs_BSplineSurface:
-  case GeomAbs_SurfaceOfExtrusion:
-  case GeomAbs_SurfaceOfRevolution:
-  case GeomAbs_OffsetSurface:
+  switch (surftype){
+  case GeomAbs_BezierSurface :
+  case GeomAbs_BSplineSurface :
+  case GeomAbs_SurfaceOfExtrusion :
+  case GeomAbs_SurfaceOfRevolution :
+  case GeomAbs_OffsetSurface :
 
-  {
-    if (surftype == GeomAbs_BSplineSurface)
     {
-      Handle(Geom_BSplineSurface) aBSpline = SurfAdapt.BSpline();
-
-      //Check near to knot position ~ near to C0 points on U isoline.
-      if (SurfAdapt.UContinuity() == GeomAbs_C0)
+      if (surftype == GeomAbs_BSplineSurface)
       {
-        Standard_Integer aMinIndex = aBSpline->FirstUKnotIndex();
-        Standard_Integer aMaxIndex = aBSpline->LastUKnotIndex();
-        for (Standard_Integer anIdx = aMinIndex; anIdx <= aMaxIndex; ++anIdx)
+        Handle(Geom_BSplineSurface) aBSpline =  SurfAdapt.BSpline();
+
+        //Check near to knot position ~ near to C0 points on U isoline.
+        if ( SurfAdapt.UContinuity() == GeomAbs_C0 )
         {
-          Standard_Real aKnot = aBSpline->UKnot(anIdx);
-          if (Abs(aKnot - p2dPrev.X()) < Precision::Confusion())
-            return ValueOfUV(P3D, preci);
+          Standard_Integer aMinIndex = aBSpline->FirstUKnotIndex();
+          Standard_Integer aMaxIndex = aBSpline->LastUKnotIndex();
+          for (Standard_Integer anIdx = aMinIndex; anIdx <= aMaxIndex; ++anIdx)
+          {
+            Standard_Real aKnot = aBSpline->UKnot(anIdx);
+            if (Abs (aKnot - p2dPrev.X()) < Precision::Confusion())
+              return ValueOfUV ( P3D, preci );
+          }
         }
-      }
 
-      //Check near to knot position ~ near to C0 points on U isoline.
-      if (SurfAdapt.VContinuity() == GeomAbs_C0)
-      {
-        Standard_Integer aMinIndex = aBSpline->FirstVKnotIndex();
-        Standard_Integer aMaxIndex = aBSpline->LastVKnotIndex();
-        for (Standard_Integer anIdx = aMinIndex; anIdx <= aMaxIndex; ++anIdx)
+        //Check near to knot position ~ near to C0 points on U isoline.
+        if ( SurfAdapt.VContinuity() == GeomAbs_C0 )
         {
-          Standard_Real aKnot = aBSpline->VKnot(anIdx);
-          if (Abs(aKnot - p2dPrev.Y()) < Precision::Confusion())
-            return ValueOfUV(P3D, preci);
+          Standard_Integer aMinIndex = aBSpline->FirstVKnotIndex();
+          Standard_Integer aMaxIndex = aBSpline->LastVKnotIndex();
+          for (Standard_Integer anIdx = aMinIndex; anIdx <= aMaxIndex; ++anIdx)
+          {
+            Standard_Real aKnot = aBSpline->VKnot(anIdx);
+            if (Abs (aKnot - p2dPrev.Y()) < Precision::Confusion())
+              return ValueOfUV ( P3D, preci );
+          }
         }
       }
-    }
 
-    gp_Pnt2d sol;
-    Standard_Integer res = SurfaceNewton(p2dPrev, P3D, preci, sol);
-    if (res != 0)
-    {
-      Standard_Real gap = P3D.Distance(Value(sol));
-      if (res == 2 || //:q6 abv 19 Mar 99: protect against strange attractors
-        (maxpreci > 0. && gap - maxpreci > Precision::Confusion()))
-      { //:q1: check with maxpreci
-        Standard_Real U = sol.X(), V = sol.Y();
-        myGap = UVFromIso(P3D, preci, U, V);
-        //       gp_Pnt2d p = ValueOfUV ( P3D, preci );
-        if (gap >= myGap) return gp_Pnt2d(U, V);
+      gp_Pnt2d sol;
+      Standard_Integer res = SurfaceNewton(p2dPrev,P3D,preci,sol);
+      if (res != 0)
+      {
+        Standard_Real gap = P3D.Distance ( Value(sol) );
+        if ( res == 2 || //:q6 abv 19 Mar 99: protect against strange attractors
+          ( maxpreci > 0. && gap - maxpreci > Precision::Confusion()) ) 
+        { //:q1: check with maxpreci
+          Standard_Real U = sol.X(), V = sol.Y();
+          myGap = UVFromIso ( P3D, preci, U, V );
+          //     gp_Pnt2d p = ValueOfUV ( P3D, preci );
+          if ( gap >= myGap ) return gp_Pnt2d ( U, V );
+        }
+        myGap = gap;
+        return sol;
       }
-      myGap = gap;
-      return sol;
     }
-  }
-  break;
+    break;
   default:
     break;
   }
-  return ValueOfUV(P3D, preci);
+  return ValueOfUV ( P3D, preci );
 }
 
 //=======================================================================
@@ -1115,243 +1115,243 @@ gp_Pnt2d ShapeAnalysis_Surface::NextValueOfUV(const gp_Pnt2d &p2dPrev,
 //purpose  :
 //=======================================================================
 
-gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D, const Standard_Real preci)
+gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D,const Standard_Real preci)
 {
   GeomAdaptor_Surface& SurfAdapt = Adaptor3d()->ChangeSurface();
   Standard_Real S = 0., T = 0.;
   myGap = -1.;    // devra etre calcule
   Standard_Boolean computed = Standard_True;  // a priori
-
+  
   Standard_Real uf, ul, vf, vl;
   Bounds(uf, ul, vf, vl);//modified by rln on 12/11/97 mySurf-> is deleted
-
+  
   { //:c9 abv 3 Mar 98: UKI60107-1 #350: to prevent 'catch' from catching exception raising below it
-    try {   // ajout CKY 30-DEC-1997 (cf ProStep TR6 r_89-ug)
-      OCC_CATCH_SIGNALS
-        GeomAbs_SurfaceType surftype = SurfAdapt.GetType();
-      switch (surftype) {
+  try {   // ajout CKY 30-DEC-1997 (cf ProStep TR6 r_89-ug)
+    OCC_CATCH_SIGNALS
+  GeomAbs_SurfaceType surftype = SurfAdapt.GetType();
+  switch (surftype){
 
-      case GeomAbs_Plane:
-      {
-        gp_Pln Plane = SurfAdapt.Plane();
-        ElSLib::Parameters(Plane, P3D, S, T);
-        break;
-      }
-      case GeomAbs_Cylinder:
-      {
-        gp_Cylinder Cylinder = SurfAdapt.Cylinder();
-        ElSLib::Parameters(Cylinder, P3D, S, T);
-        S += ShapeAnalysis::AdjustByPeriod(S, 0.5*(uf + ul), 2 * M_PI);
-        break;
-      }
-      case GeomAbs_Cone:
-      {
-        gp_Cone Cone = SurfAdapt.Cone();
-        ElSLib::Parameters(Cone, P3D, S, T);
-        S += ShapeAnalysis::AdjustByPeriod(S, 0.5*(uf + ul), 2 * M_PI);
-        break;
-      }
-      case GeomAbs_Sphere:
-      {
-        gp_Sphere Sphere = SurfAdapt.Sphere();
-        ElSLib::Parameters(Sphere, P3D, S, T);
-        S += ShapeAnalysis::AdjustByPeriod(S, 0.5*(uf + ul), 2 * M_PI);
-        break;
-      }
-      case GeomAbs_Torus:
-      {
-        gp_Torus Torus = SurfAdapt.Torus();
-        ElSLib::Parameters(Torus, P3D, S, T);
-        S += ShapeAnalysis::AdjustByPeriod(S, 0.5*(uf + ul), 2 * M_PI);
-        T += ShapeAnalysis::AdjustByPeriod(T, 0.5*(vf + vl), 2 * M_PI);
-        break;
-      }
-      case GeomAbs_BezierSurface:
-      case GeomAbs_BSplineSurface:
-      case GeomAbs_SurfaceOfExtrusion:
-      case GeomAbs_SurfaceOfRevolution:
-      case GeomAbs_OffsetSurface: //:d0 abv 3 Mar 98: UKI60107-1 #350
-      {
-        S = (uf + ul) / 2;  T = (vf + vl) / 2;  // yaura aumoins qqchose
-                                                //pdn to fix hangs PRO17015
-        if ((surftype == GeomAbs_SurfaceOfExtrusion) && Precision::IsInfinite(uf) && Precision::IsInfinite(ul)) {
-          //conic case
-          gp_Pnt2d prev(S, T);
-          gp_Pnt2d solution;
-          if (SurfaceNewton(prev, P3D, preci, solution) != 0)
-          {
+  case GeomAbs_Plane :
+    {
+      gp_Pln Plane = SurfAdapt.Plane();
+      ElSLib::Parameters( Plane, P3D, S, T);
+      break;
+    }
+  case GeomAbs_Cylinder :
+    {
+      gp_Cylinder Cylinder = SurfAdapt.Cylinder();
+      ElSLib::Parameters( Cylinder, P3D, S, T);
+      S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*M_PI);
+      break;
+    }
+  case GeomAbs_Cone :
+    {
+      gp_Cone Cone = SurfAdapt.Cone();
+      ElSLib::Parameters( Cone, P3D, S, T);
+      S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*M_PI);
+      break;
+    }
+  case GeomAbs_Sphere :
+    {
+      gp_Sphere Sphere = SurfAdapt.Sphere();
+      ElSLib::Parameters( Sphere, P3D, S, T);
+      S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*M_PI);
+      break;
+    }
+  case GeomAbs_Torus :
+    {
+      gp_Torus Torus = SurfAdapt.Torus();
+      ElSLib::Parameters( Torus, P3D, S, T);
+      S += ShapeAnalysis::AdjustByPeriod(S,0.5*(uf+ul),2*M_PI);
+      T += ShapeAnalysis::AdjustByPeriod(T,0.5*(vf+vl),2*M_PI);
+      break;
+    }
+  case GeomAbs_BezierSurface :
+  case GeomAbs_BSplineSurface :
+  case GeomAbs_SurfaceOfExtrusion :
+  case GeomAbs_SurfaceOfRevolution :
+  case GeomAbs_OffsetSurface : //:d0 abv 3 Mar 98: UKI60107-1 #350
+    {
+      S = (uf+ul)/2;  T = (vf+vl)/2;  // yaura aumoins qqchose
+      //pdn to fix hangs PRO17015
+      if ((surftype==GeomAbs_SurfaceOfExtrusion)&&Precision::IsInfinite(uf)&&Precision::IsInfinite(ul)) {
+       //conic case
+       gp_Pnt2d prev(S,T);
+       gp_Pnt2d solution;
+       if (SurfaceNewton(prev,P3D,preci,solution) != 0)
+  {
 #ifdef OCCT_DEBUG
-            cout << "Newton found point on conic extrusion" << endl;
+         cout <<"Newton found point on conic extrusion"<<endl;
 #endif
-            return solution;
-          }
+         return solution;
+       }
 #ifdef OCCT_DEBUG
-          cout << "Newton failed point on conic extrusion" << endl;
+       cout <<"Newton failed point on conic extrusion"<<endl;
 #endif
-          uf = -500;
-          ul = 500;
-        }
-
-        if (Precision::IsInfinite(uf)) uf = -1000;
-        if (Precision::IsInfinite(ul)) ul = 1000;
-        if (Precision::IsInfinite(vf)) vf = -1000;
-        if (Precision::IsInfinite(vl)) vl = 1000;
-
-        //:30 by abv 2.12.97: speed optimization
-        // code is taken from GeomAPI_ProjectPointOnSurf
-        if (!myExtOK) {
-          //      Standard_Real du = Abs(ul-uf)/100;  Standard_Real dv = Abs(vl-vf)/100;
-          //      if (IsUClosed()) du = 0;  if (IsVClosed()) dv = 0;
-          //  Forcer appel a IsU-VClosed
-          if (myUCloseVal < 0) IsUClosed();
-          if (myVCloseVal < 0) IsVClosed();
-          Standard_Real du = 0., dv = 0.;
-          //extension of the surface range is limited to non-offset surfaces as the latter
-          //can throw exception (e.g. Geom_UndefinedValue) when computing value - see id23943
-          if (!mySurf->IsKind(STANDARD_TYPE(Geom_OffsetSurface))) {
-            //modified by rln during fixing CSR # BUC60035 entity #D231
-            du = Min(myUDelt, SurfAdapt.UResolution(preci));
-            dv = Min(myVDelt, SurfAdapt.VResolution(preci));
-          }
-          Standard_Real Tol = Precision::PConfusion();
-          myExtPS.SetFlag(Extrema_ExtFlag_MIN);
-          myExtPS.Initialize(SurfAdapt, uf - du, ul + du, vf - dv, vl + dv, Tol, Tol);
-          myExtOK = Standard_True;
-        }
-        myExtPS.Perform(P3D);
-        Standard_Integer nPSurf = (myExtPS.IsDone() ? myExtPS.NbExt() : 0);
-
-        if (nPSurf > 0) {
-          Standard_Real dist2Min = myExtPS.SquareDistance(1);
-          Standard_Integer indMin = 1;
-          for (Standard_Integer sol = 2; sol <= nPSurf; sol++) {
-            Standard_Real dist2 = myExtPS.SquareDistance(sol);
-            if (dist2Min > dist2) {
-              dist2Min = dist2;
-              indMin = sol;
-            }
-          }
-          myExtPS.Point(indMin).Parameter(S, T);
-          // PTV 26.06.2002 WORKAROUND protect OCC486. Remove after fix bug.
-          // file CEA_cuve-V5.igs Entityes 244, 259, 847, 925
-          // if project point3D on SurfaceOfRevolution Extreme recompute 2d point, but
-          // returns an old distance from 3d to solution :-(
-          gp_Pnt aCheckPnt = SurfAdapt.Value(S, T);
-          dist2Min = P3D.SquareDistance(aCheckPnt);
-          // end of WORKAROUND
-          Standard_Real disSurf = sqrt(dist2Min);//, disCurv =1.e10;
-
-                                                 // Test de projection merdeuse sur les bords :
-          Standard_Real UU = S, VV = T, DistMinOnIso = RealLast();  // myGap;
-                                                                    // ForgetNewton(P3D, mySurf, preci, UU, VV, DistMinOnIso);
-
-                                                                    //test added by rln on 08/12/97
-                                                                    // DistMinOnIso = UVFromIso (P3D, preci, UU, VV);
-          Standard_Boolean possLockal = Standard_False; //:study S4030 (optimizing)
-          if (disSurf > preci) {
-            gp_Pnt2d pp(UU, VV);
-            if (SurfaceNewton(pp, P3D, preci, pp) != 0)
-            { //:q2 abv 16 Mar 99: PRO7226 #412920
-              Standard_Real dist = P3D.Distance(Value(pp));
-              if (dist < disSurf) {
-                disSurf = dist;
-                S = UU = pp.X();
-                T = VV = pp.Y();
-              }
-            }
-            if (disSurf < 10 * preci)
-              if (mySurf->Continuity() != GeomAbs_C0) {
-                Standard_Real Tol = Precision::Confusion();
-                gp_Vec D1U, D1V;
-                gp_Pnt pnt;
-                SurfAdapt.D1(UU, VV, pnt, D1U, D1V);
-                gp_Vec b = D1U.Crossed(D1V);
-                gp_Vec a(pnt, P3D);
-                Standard_Real ab = a.Dot(b);
-                Standard_Real nrm2 = b.SquareMagnitude();
-                if (nrm2 > 1e-10) {
-                  Standard_Real dist = a.SquareMagnitude() - (ab*ab) / nrm2;
-                  possLockal = (dist < Tol*Tol);
-                }
-              }
-            if (!possLockal) {
-              DistMinOnIso = UVFromIso(P3D, preci, UU, VV);
-            }
-          }
-
-          if (disSurf > DistMinOnIso) {
-            // On prend les parametres UU et VV;
-            S = UU;
-            T = VV;
-            myGap = DistMinOnIso;
-          }
-          else {
-            myGap = disSurf;
-          }
+       uf = -500;
+       ul = 500;
+      }
 
-          // On essaie Intersection Droite Passant par P3D / Surface
-          //   if ((myGap > preci)&&(!possLockal) ) {
-          //     Standard_Real SS, TT;
-          //     disCurv = FindUV(P3D, mySurf, S, T, SS, TT);
-          //     if (disCurv < preci || disCurv < myGap) {
-          //       S = SS;
-          //       T = TT;
-          //     }
-          //   }
+      if (Precision::IsInfinite(uf)) uf = -1000;
+      if (Precision::IsInfinite(ul)) ul = 1000;
+      if (Precision::IsInfinite(vf)) vf = -1000;
+      if (Precision::IsInfinite(vl)) vl = 1000;
+
+      //:30 by abv 2.12.97: speed optimization
+      // code is taken from GeomAPI_ProjectPointOnSurf
+      if ( ! myExtOK ) {
+//      Standard_Real du = Abs(ul-uf)/100;  Standard_Real dv = Abs(vl-vf)/100;
+//      if (IsUClosed()) du = 0;  if (IsVClosed()) dv = 0;
+//  Forcer appel a IsU-VClosed
+       if (myUCloseVal < 0) IsUClosed();
+       if (myVCloseVal < 0) IsVClosed();
+    Standard_Real du = 0., dv = 0.;
+    //extension of the surface range is limited to non-offset surfaces as the latter
+    //can throw exception (e.g. Geom_UndefinedValue) when computing value - see id23943
+    if (!mySurf->IsKind (STANDARD_TYPE (Geom_OffsetSurface))) {
+      //modified by rln during fixing CSR # BUC60035 entity #D231
+      du = Min (myUDelt, SurfAdapt.UResolution (preci));
+      dv = Min (myVDelt, SurfAdapt.VResolution (preci));
+    }
+       Standard_Real Tol = Precision::PConfusion();
+        myExtPS.SetFlag (Extrema_ExtFlag_MIN);
+       myExtPS.Initialize (SurfAdapt, uf-du, ul+du, vf-dv, vl+dv, Tol, Tol );
+       myExtOK = Standard_True;
+      }
+      myExtPS.Perform ( P3D );
+      Standard_Integer nPSurf = ( myExtPS.IsDone() ? myExtPS.NbExt() : 0 );
+
+      if ( nPSurf > 0 ) {
+       Standard_Real dist2Min = myExtPS.SquareDistance( 1 );
+       Standard_Integer indMin=1;
+       for (Standard_Integer sol = 2; sol <= nPSurf ; sol++) {
+         Standard_Real dist2 = myExtPS.SquareDistance(sol);
+         if ( dist2Min > dist2 ) {
+           dist2Min = dist2;
+           indMin = sol;
+         }
+       }
+        myExtPS.Point(indMin).Parameter ( S, T );
+        // PTV 26.06.2002 WORKAROUND protect OCC486. Remove after fix bug.
+        // file CEA_cuve-V5.igs Entityes 244, 259, 847, 925
+        // if project point3D on SurfaceOfRevolution Extreme recompute 2d point, but
+        // returns an old distance from 3d to solution :-(
+        gp_Pnt aCheckPnt = SurfAdapt.Value( S, T );
+        dist2Min = P3D.SquareDistance(aCheckPnt);
+        // end of WORKAROUND
+       Standard_Real disSurf = sqrt (dist2Min);//, disCurv =1.e10;
+
+       // Test de projection merdeuse sur les bords :
+       Standard_Real UU = S, VV = T, DistMinOnIso = RealLast();  // myGap;
+//     ForgetNewton(P3D, mySurf, preci, UU, VV, DistMinOnIso);
+
+       //test added by rln on 08/12/97
+//     DistMinOnIso = UVFromIso (P3D, preci, UU, VV);
+       Standard_Boolean possLockal = Standard_False; //:study S4030 (optimizing)
+       if (disSurf > preci) {
+         gp_Pnt2d pp(UU,VV);
+         if (SurfaceNewton (pp, P3D, preci, pp) != 0)
+    { //:q2 abv 16 Mar 99: PRO7226 #412920
+           Standard_Real dist = P3D.Distance ( Value(pp) );
+           if ( dist < disSurf ) {
+             disSurf = dist;
+             S = UU = pp.X();
+             T = VV = pp.Y();
+           }
+         }
+         if ( disSurf < 10*preci)
+           if (mySurf->Continuity() != GeomAbs_C0){
+             Standard_Real Tol = Precision::Confusion();
+             gp_Vec D1U, D1V;
+             gp_Pnt pnt;
+             SurfAdapt.D1(UU, VV, pnt, D1U, D1V);
+             gp_Vec b = D1U.Crossed(D1V);
+             gp_Vec a (pnt, P3D);
+             Standard_Real ab = a.Dot(b);
+             Standard_Real nrm2 = b.SquareMagnitude();
+             if ( nrm2 > 1e-10 ) {
+               Standard_Real dist = a.SquareMagnitude() - (ab*ab)/nrm2;
+               possLockal = ( dist < Tol*Tol );
+             }
+           }
+         if (!possLockal) {
+           DistMinOnIso = UVFromIso (P3D, preci, UU, VV);
+         }
+       }
+
+       if (disSurf > DistMinOnIso) {
+         // On prend les parametres UU et VV;
+         S = UU;
+         T = VV;
+         myGap = DistMinOnIso;
+       }
+       else {
+         myGap = disSurf;
+       }
+
+       // On essaie Intersection Droite Passant par P3D / Surface
+//     if ((myGap > preci)&&(!possLockal) ) {
+//       Standard_Real SS, TT;
+//       disCurv = FindUV(P3D, mySurf, S, T, SS, TT);
+//       if (disCurv < preci || disCurv < myGap) {
+//         S = SS;
+//         T = TT;
+//       }
+//     }
 
-        }
-        else {
+      }
+      else {
 #ifdef OCCT_DEBUG
-          cout << "Warning: ShapeAnalysis_Surface::ValueOfUV(): Extrema failed, doing Newton" << endl;
+       cout << "Warning: ShapeAnalysis_Surface::ValueOfUV(): Extrema failed, doing Newton" << endl;
 #endif
-          // on essai sur les bords
-          Standard_Real UU = S, VV = T;//, DistMinOnIso;
-                                       //      ForgetNewton(P3D, mySurf, preci, UU, VV, DistMinOnIso);
-          myGap = UVFromIso(P3D, preci, UU, VV);
-          //   if (DistMinOnIso > preci) {
-          //     Standard_Real SS, TT;
-          //     Standard_Real disCurv = FindUV(P3D, mySurf, UU, VV, SS, TT);
-          //     if (disCurv < preci) {
-          //       S = SS;
-          //       T = TT;
-          //     }
-          //   }
-          //   else {
-          S = UU;
-          T = VV;
-          //   }
-        }
+       // on essai sur les bords
+       Standard_Real UU = S, VV = T;//, DistMinOnIso;
+//     ForgetNewton(P3D, mySurf, preci, UU, VV, DistMinOnIso);
+       myGap = UVFromIso (P3D, preci, UU, VV);
+//     if (DistMinOnIso > preci) {
+//       Standard_Real SS, TT;
+//       Standard_Real disCurv = FindUV(P3D, mySurf, UU, VV, SS, TT);
+//       if (disCurv < preci) {
+//         S = SS;
+//         T = TT;
+//       }
+//     }
+//     else {
+         S = UU;
+         T = VV;
+//     }
       }
-      break;
+    }
+    break;
 
-      default:
-        computed = Standard_False;
-        break;
-      }
+    default :
+      computed = Standard_False;
+    break;
+  }
 
-    }  // end Try ValueOfUV (CKY 30-DEC-1997)
+  }  // end Try ValueOfUV (CKY 30-DEC-1997)
 
-    catch (Standard_Failure const& anException) {
+  catch(Standard_Failure const& anException) {
 #ifdef OCCT_DEBUG
-      //   Pas de raison mais qui sait. Mieux vaut retourner un truc faux que stopper
-      //   L ideal serait d avoir un status ... mais qui va l interroger ?
-      //   Avec ce status, on saurait que ce point est a sauter et voila tout
-      //   En attendant, on met une valeur "pas idiote" mais surement fausse ...
-      //szv#4:S4163:12Mar99 optimized
-      //:s5
-      cout << "\nWarning: ShapeAnalysis_Surface::ValueOfUV(): Exception: ";
-      anException.Print(cout); cout << endl;
+//   Pas de raison mais qui sait. Mieux vaut retourner un truc faux que stopper
+//   L ideal serait d avoir un status ... mais qui va l interroger ?
+//   Avec ce status, on saurait que ce point est a sauter et voila tout
+//   En attendant, on met une valeur "pas idiote" mais surement fausse ...
+//szv#4:S4163:12Mar99 optimized
+//:s5
+    cout << "\nWarning: ShapeAnalysis_Surface::ValueOfUV(): Exception: "; 
+    anException.Print(cout); cout << endl;
 #endif
-      (void)anException;
-      S = (Precision::IsInfinite(uf)) ? 0 : (uf + ul) / 2.;
-      T = (Precision::IsInfinite(vf)) ? 0 : (vf + vl) / 2.;
-    }
+    (void)anException;
+    S = (Precision::IsInfinite(uf))? 0 : (uf+ul) / 2.;
+    T = (Precision::IsInfinite(vf))? 0 : (vf+vl) / 2.;
+  }
   } //:c9
-    //szv#4:S4163:12Mar99 waste raise
-    //if (!computed) throw Standard_NoSuchObject("PCurveLib_ProjectPointOnSurf::ValueOfUV untreated surface type");
-  if (computed) { if (myGap <= 0) myGap = P3D.Distance(SurfAdapt.Value(S, T)); }
+  //szv#4:S4163:12Mar99 waste raise
+  //if (!computed) throw Standard_NoSuchObject("PCurveLib_ProjectPointOnSurf::ValueOfUV untreated surface type");
+  if (computed) { if (myGap <= 0) myGap = P3D.Distance (SurfAdapt.Value (S,T)); }
   else { myGap = -1.; S = 0.; T = 0.; }
-  return gp_Pnt2d(S, T);
+  return gp_Pnt2d( S, T);
 }
 
 //=======================================================================
@@ -1359,67 +1359,67 @@ gp_Pnt2d ShapeAnalysis_Surface::ValueOfUV(const gp_Pnt& P3D, const Standard_Real
 //purpose  :
 //=======================================================================
 
-Standard_Real ShapeAnalysis_Surface::UVFromIso(const gp_Pnt& P3d, const Standard_Real preci, Standard_Real& U, Standard_Real& V)
+Standard_Real ShapeAnalysis_Surface::UVFromIso(const gp_Pnt& P3d,const Standard_Real preci,Standard_Real& U,Standard_Real& V)
 {
-  //  Projection qui considere les isos ... comme suit :
-  //  Les 4 bords, plus les isos en U et en V
-  //  En effet, souvent, un des deux est bon ...
+//  Projection qui considere les isos ... comme suit :
+//  Les 4 bords, plus les isos en U et en V
+//  En effet, souvent, un des deux est bon ...
   Standard_Real theMin = RealLast();
-
+  
   gp_Pnt pntres;
-  Standard_Real Cf, Cl, UU, VV;
+  Standard_Real Cf, Cl, UU,VV;
 
   //  Initialisation des recherches : point deja trouve (?)
   UU = U; VV = V;
-  gp_Pnt depart = myAdSur->Value(U, V);
+  gp_Pnt depart = myAdSur->Value (U,V);
   theMin = depart.Distance(P3d);
-
-  if (theMin < preci / 10) return theMin;  // c etait deja OK
+    
+  if (theMin < preci/10) return theMin;  // c etait deja OK
   ComputeBoxes();
-  if (myIsoUF.IsNull() || myIsoUL.IsNull() || myIsoVF.IsNull() || myIsoVL.IsNull()) {
+  if(myIsoUF.IsNull() || myIsoUL.IsNull() || myIsoVF.IsNull() || myIsoVL.IsNull()) {
     // no isolines
     // no more precise computation
     return theMin;
   }
   try {    // RAJOUT    
     OCC_CATCH_SIGNALS
-      //pdn Create BndBox containing point;
-      Bnd_Box aPBox;
+    //pdn Create BndBox containing point;
+    Bnd_Box aPBox;
     aPBox.Set(P3d);
 
     //cout<<"Adaptor3d()->Surface().GetType() = "<<Adaptor3d()->Surface().GetType()<<endl;
 
     //modified by rln on 04/12/97 in order to use theese variables later
     Standard_Boolean UV = Standard_True;
-    Standard_Real par = 0., other = 0., dist = 0.;
+    Standard_Real par=0., other=0., dist=0.;
     Handle(Geom_Curve) iso;
     Adaptor3d_IsoCurve anIsoCurve(Adaptor3d());
-    for (Standard_Integer num = 0; num < 6; num++) {
+    for (Standard_Integer num = 0; num < 6; num ++) {
 
       UV = (num < 3);  // 0-1-2 : iso-U  3-4-5 : iso-V
-      if (!(Adaptor3d()->Surface().GetType() == GeomAbs_OffsetSurface)) {
-        const Bnd_Box *anIsoBox = 0;
+      if( !(Adaptor3d()->Surface().GetType()==GeomAbs_OffsetSurface) ) {
+       const Bnd_Box *anIsoBox = 0;
         switch (num) {
-        case 0: par = myUF; iso = myIsoUF;  anIsoBox = &myBndUF; break;
-        case 1: par = myUL; iso = myIsoUL;  anIsoBox = &myBndUL; break;
-        case 2: par = U;    iso = UIso(U); break;
-        case 3: par = myVF; iso = myIsoVF;  anIsoBox = &myBndVF; break;
-        case 4: par = myVL; iso = myIsoVL;  anIsoBox = &myBndVL; break;
-        case 5: par = V;    iso = VIso(V); break;
+        case 0 : par = myUF; iso = myIsoUF;  anIsoBox = &myBndUF; break;
+        case 1 : par = myUL; iso = myIsoUL;  anIsoBox = &myBndUL; break;
+        case 2 : par = U;    iso = UIso (U); break;
+        case 3 : par = myVF; iso = myIsoVF;  anIsoBox = &myBndVF; break;
+        case 4 : par = myVL; iso = myIsoVL;  anIsoBox = &myBndVL; break;
+        case 5 : par = V;    iso = VIso (V); break;
         default: break;
         }
-
+        
         //    On y va la-dessus
         if (!Precision::IsInfinite(par) && !iso.IsNull()) {
-          if (anIsoBox && anIsoBox->Distance(aPBox) > theMin)
+          ifanIsoBox && anIsoBox->Distance(aPBox) > theMin)
             continue;
-
+          
           Cf = iso->FirstParameter();
           Cl = iso->LastParameter();
-
+          
           if (Precision::IsInfinite(Cf))  Cf = -1000;
           if (Precision::IsInfinite(Cl))  Cl = +1000;
-          dist = ShapeAnalysis_Curve().Project(iso, P3d, preci, pntres, other, Cf, Cl, Standard_False);
+          dist = ShapeAnalysis_Curve().Project (iso,P3d,preci,pntres,other,Cf,Cl, Standard_False);
           if (dist < theMin) {
             theMin = dist;
             //:q6      if (UV) VV = other;  else UU = other;
@@ -1432,55 +1432,55 @@ Standard_Real ShapeAnalysis_Surface::UVFromIso(const gp_Pnt& P3d, const Standard
       else {
         Adaptor3d_Curve *anAdaptor = NULL;
         GeomAdaptor_Curve aGeomCurve;
-
-        const Bnd_Box *anIsoBox = 0;
+        
+       const Bnd_Box *anIsoBox = 0;
         switch (num) {
-        case 0: par = myUF; aGeomCurve.Load(myIsoUF); anAdaptor = &aGeomCurve; anIsoBox = &myBndUF; break;
-        case 1: par = myUL; aGeomCurve.Load(myIsoUL); anAdaptor = &aGeomCurve; anIsoBox = &myBndUL; break;
-        case 2: par = U;    anIsoCurve.Load(GeomAbs_IsoU, U); anAdaptor = &anIsoCurve; break;
-        case 3: par = myVF; aGeomCurve.Load(myIsoVF); anAdaptor = &aGeomCurve; anIsoBox = &myBndVF; break;
-        case 4: par = myVL; aGeomCurve.Load(myIsoVL); anAdaptor = &aGeomCurve; anIsoBox = &myBndVL; break;
-        case 5: par = V;    anIsoCurve.Load(GeomAbs_IsoV, V); anAdaptor = &anIsoCurve; break;
-        default: break;
+        case 0 : par = myUF; aGeomCurve.Load(myIsoUF); anAdaptor=&aGeomCurve; anIsoBox = &myBndUF; break;
+        case 1 : par = myUL; aGeomCurve.Load(myIsoUL); anAdaptor=&aGeomCurve; anIsoBox = &myBndUL;break;
+        case 2 : par = U;    anIsoCurve.Load(GeomAbs_IsoU,U); anAdaptor=&anIsoCurve; break;
+        case 3 : par = myVF; aGeomCurve.Load(myIsoVF); anAdaptor=&aGeomCurve; anIsoBox = &myBndVF; break;
+        case 4 : par = myVL; aGeomCurve.Load(myIsoVL); anAdaptor=&aGeomCurve; anIsoBox = &myBndVL;break;
+        case 5 : par = V;    anIsoCurve.Load(GeomAbs_IsoV,V); anAdaptor=&anIsoCurve; break;
+          default : break;
         }
-        if (anIsoBox && anIsoBox->Distance(aPBox) > theMin)
+        ifanIsoBox && anIsoBox->Distance(aPBox) > theMin)
           continue;
-        dist = ShapeAnalysis_Curve().Project(*anAdaptor, P3d, preci, pntres, other);
+        dist = ShapeAnalysis_Curve().Project(*anAdaptor,P3d,preci,pntres,other);
         if (dist < theMin) {
           theMin = dist;
           UU = (UV ? par : other);  VV = (UV ? other : par); //:q6: uncommented
         }
       }
     }
-
+    
     //added by rln on 04/12/97 iterational process
     Standard_Real PrevU = U, PrevV = V;
     Standard_Integer MaxIters = 5, Iters = 0;
-    if (!(Adaptor3d()->Surface().GetType() == GeomAbs_OffsetSurface)) {
+    if( !(Adaptor3d()->Surface().GetType()==GeomAbs_OffsetSurface) ) {
       while (((PrevU != UU) || (PrevV != VV)) && (Iters < MaxIters) && (theMin > preci)) {
         PrevU = UU; PrevV = VV;
-        if (UV) { par = UU; iso = UIso(UU); }
-        else { par = VV; iso = VIso(VV); }
-        if (!iso.IsNull()) {
+        if (UV) {par = UU; iso = UIso(UU);}
+        else    {par = VV; iso = VIso(VV);}
+        if(!iso.IsNull()) {
           Cf = iso->FirstParameter();
           Cl = iso->LastParameter();
           if (Precision::IsInfinite(Cf))  Cf = -1000;
           if (Precision::IsInfinite(Cl))  Cl = +1000;
-          dist = ShapeAnalysis_Curve().Project(iso, P3d, preci, pntres, other, Cf, Cl, Standard_False);
+          dist = ShapeAnalysis_Curve().Project (iso, P3d, preci, pntres, other, Cf, Cl, Standard_False);
           if (dist < theMin) {
             theMin = dist;
             if (UV) VV = other;  else UU = other;
           }
         }
         UV = !UV;
-        if (UV) { par = UU; iso = UIso(UU); }
-        else { par = VV; iso = VIso(VV); }
-        if (!iso.IsNull()) {
+        if (UV) {par = UU; iso = UIso(UU);}
+        else    {par = VV; iso = VIso(VV);}
+        if(!iso.IsNull()) {
           Cf = iso->FirstParameter();
           Cl = iso->LastParameter();
           if (Precision::IsInfinite(Cf))  Cf = -1000;
           if (Precision::IsInfinite(Cl))  Cl = +1000;
-          dist = ShapeAnalysis_Curve().Project(iso, P3d, preci, pntres, other, Cf, Cl, Standard_False);
+          dist = ShapeAnalysis_Curve().Project (iso, P3d, preci, pntres, other, Cf, Cl, Standard_False);
           if (dist < theMin) {
             theMin = dist;
             if (UV) VV = other;  else UU = other;
@@ -1496,11 +1496,11 @@ Standard_Real ShapeAnalysis_Surface::UVFromIso(const gp_Pnt& P3d, const Standard
         PrevU = UU; PrevV = VV;
         if (UV) {
           par = UU;
-          anIsoCurve.Load(GeomAbs_IsoU, UU);
+          anIsoCurve.Load(GeomAbs_IsoU,UU);
         }
         else {
           par = VV;
-          anIsoCurve.Load(GeomAbs_IsoV, VV);
+          anIsoCurve.Load(GeomAbs_IsoV,VV);
         }
         Cf = anIsoCurve.FirstParameter();
         Cl = anIsoCurve.LastParameter();
@@ -1512,19 +1512,19 @@ Standard_Real ShapeAnalysis_Surface::UVFromIso(const gp_Pnt& P3d, const Standard
           if (UV) VV = other;  else UU = other;
         }
         UV = !UV;
-        if (UV) {
-          par = UU;
-          anIsoCurve.Load(GeomAbs_IsoU, UU);
-        }
-        else {
-          par = VV;
-          anIsoCurve.Load(GeomAbs_IsoV, VV);
-        }
+      if (UV) {
+        par = UU;
+        anIsoCurve.Load(GeomAbs_IsoU,UU);
+      }
+      else    {
+        par = VV;
+        anIsoCurve.Load(GeomAbs_IsoV,VV);
+      }
         Cf = anIsoCurve.FirstParameter();
         Cl = anIsoCurve.LastParameter();
         if (Precision::IsInfinite(Cf))  Cf = -1000;
         if (Precision::IsInfinite(Cl))  Cl = +1000;
-        dist = ShapeAnalysis_Curve().ProjectAct(anIsoCurve, P3d, preci, pntres, other);
+        dist = ShapeAnalysis_Curve().ProjectAct (anIsoCurve, P3d, preci, pntres, other);
         if (dist < theMin) {
           theMin = dist;
           if (UV) VV = other;  else UU = other;
@@ -1537,10 +1537,10 @@ Standard_Real ShapeAnalysis_Surface::UVFromIso(const gp_Pnt& P3d, const Standard
     U = UU;  V = VV;
 
   }  // fin try RAJOUT
-  catch (Standard_Failure const& anException) {
+  catch(Standard_Failure const& anException) {
 #ifdef OCCT_DEBUG
-    //:s5
-    cout << "\nWarning: ShapeAnalysis_Curve::UVFromIso(): Exception: ";
+//:s5
+    cout << "\nWarning: ShapeAnalysis_Curve::UVFromIso(): Exception: "; 
     anException.Print(cout); cout << endl;
 #endif
     (void)anException;
@@ -1573,9 +1573,9 @@ void ShapeAnalysis_Surface::SortSingularities()
       myFirstPar[minIndex] = myFirstPar[i]; myFirstPar[i] = tmpPar;
       tmpPar = myLastPar[minIndex]; myLastPar[minIndex] = myLastPar[i]; myLastPar[i] = tmpPar;
       Standard_Boolean tmpUIsoDeg = myUIsoDeg[minIndex];
-      myUIsoDeg[minIndex] = myUIsoDeg[i]; myUIsoDeg[i] = tmpUIsoDeg;
+      myUIsoDeg[minIndex] = myUIsoDeg[i]; myUIsoDeg[i] = tmpUIsoDeg; 
     }
-  }
+  }      
 }
 
 
@@ -1585,9 +1585,9 @@ void ShapeAnalysis_Surface::SortSingularities()
 //=======================================================================
 
 void ShapeAnalysis_Surface::SetDomain(const Standard_Real U1,
-  const Standard_Real U2,
-  const Standard_Real V1,
-  const Standard_Real V2)
+                                      const Standard_Real U2,
+                                      const Standard_Real V1,
+                                      const Standard_Real V2)
 {
   myUF = U1;
   myUL = U2;
@@ -1598,38 +1598,38 @@ void ShapeAnalysis_Surface::SetDomain(const Standard_Real U1,
 
 void ShapeAnalysis_Surface::ComputeBoxes()
 {
-  if (myIsoBoxes) return;
+  if(myIsoBoxes) return;
   myIsoBoxes = Standard_True;
   ComputeBoundIsos();
-  if (!myIsoUF.IsNull())
-    BndLib_Add3dCurve::Add(GeomAdaptor_Curve(myIsoUF), Precision::Confusion(), myBndUF);
-  if (!myIsoUL.IsNull())
-    BndLib_Add3dCurve::Add(GeomAdaptor_Curve(myIsoUL), Precision::Confusion(), myBndUL);
-  if (!myIsoVF.IsNull())
-    BndLib_Add3dCurve::Add(GeomAdaptor_Curve(myIsoVF), Precision::Confusion(), myBndVF);
-  if (!myIsoVL.IsNull())
-    BndLib_Add3dCurve::Add(GeomAdaptor_Curve(myIsoVL), Precision::Confusion(), myBndVL);
+  if(!myIsoUF.IsNull())
+    BndLib_Add3dCurve::Add(GeomAdaptor_Curve(myIsoUF),Precision::Confusion(),myBndUF);
+  if(!myIsoUL.IsNull())
+    BndLib_Add3dCurve::Add(GeomAdaptor_Curve(myIsoUL),Precision::Confusion(),myBndUL);
+  if(!myIsoVF.IsNull())
+    BndLib_Add3dCurve::Add(GeomAdaptor_Curve(myIsoVF),Precision::Confusion(),myBndVF);
+  if(!myIsoVL.IsNull())
+    BndLib_Add3dCurve::Add(GeomAdaptor_Curve(myIsoVL),Precision::Confusion(),myBndVL);            
 }
 
-const Bnd_Box& ShapeAnalysis_Surface::GetBoxUF()
+const Bnd_Box& ShapeAnalysis_Surface::GetBoxUF() 
 {
   ComputeBoxes();
   return myBndUF;
 }
 
-const Bnd_Box& ShapeAnalysis_Surface::GetBoxUL()
+const Bnd_Box& ShapeAnalysis_Surface::GetBoxUL() 
 {
   ComputeBoxes();
   return myBndUL;
 }
 
-const Bnd_Box& ShapeAnalysis_Surface::GetBoxVF()
+const Bnd_Box& ShapeAnalysis_Surface::GetBoxVF() 
 {
   ComputeBoxes();
   return myBndVF;
 }
 
-const Bnd_Box& ShapeAnalysis_Surface::GetBoxVL()
+const Bnd_Box& ShapeAnalysis_Surface::GetBoxVL() 
 {
   ComputeBoxes();
   return myBndVL;
index 19a1bbf527384e72b5ee07cd86aac420d6fb145b..be6649b227ea1cbf4ce6c936594858012edce407 100644 (file)
@@ -87,7 +87,7 @@ static void AdjustSecondPointToFirstPoint(const gp_Pnt2d& theFirstPoint,
                                           gp_Pnt2d& theSecondPoint,
                                           const Handle(Geom_Surface)& theSurf)
 {
-  if (theSurf->IsUPeriodic())
+  if (theSurf->IsUPeriodic111())
   {
     Standard_Real UPeriod = theSurf->UPeriod();
     Standard_Real NewU = ElCLib::InPeriod(theSecondPoint.X(),
@@ -95,7 +95,7 @@ static void AdjustSecondPointToFirstPoint(const gp_Pnt2d& theFirstPoint,
                                           theFirstPoint.X() + UPeriod/2);
     theSecondPoint.SetX(NewU);
   }
-  if (theSurf->IsVPeriodic())
+  if (theSurf->IsVPeriodic111())
   {
     Standard_Real VPeriod = theSurf->VPeriod();
     Standard_Real NewV = ElCLib::InPeriod(theSecondPoint.Y(),
@@ -660,8 +660,8 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G
    Standard_Integer i = 0;
 
    Standard_Real aTol2 = theTol * theTol;
-   Standard_Boolean isPeriodicU = mySurf->Surface()->IsUPeriodic();
-   Standard_Boolean isPeriodicV = mySurf->Surface()->IsVPeriodic();
+   Standard_Boolean isPeriodicU = mySurf->Surface()->IsUPeriodic111();
+   Standard_Boolean isPeriodicV = mySurf->Surface()->IsVPeriodic111();
 
    // Workaround:
    // Protection against bad "tolerance" shapes.
@@ -1140,7 +1140,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G
       while (firstX > ul)  {  firstX -= Up;   pnt2d (1).SetX(firstX);  }
     }
     // shift first point, according to cashe
-    if (mySurf->Surface()->IsUPeriodic() && isFromCashe) {
+    if (mySurf->Surface()->IsUPeriodic111() && isFromCashe) {
       Standard_Real aMinParam = uf, aMaxParam = ul;
       while (aMinParam > aSavedPoint.X()) {
         aMinParam -= Up;
@@ -1207,7 +1207,7 @@ Standard_Boolean ShapeConstruct_ProjectCurveOnSurface::PerformByProjLib(Handle(G
       while (firstY > vl)  {  firstY -= Vp;  pnt2d (1).SetY(firstY);  }
     }
     // shift first point, according to cashe
-    if (mySurf->Surface()->IsVPeriodic() && isFromCashe) {
+    if (mySurf->Surface()->IsVPeriodic111() && isFromCashe) {
       Standard_Real aMinParam = vf, aMaxParam = vl;
       while (aMinParam > aSavedPoint.Y()) {
         aMinParam -= Vp;
@@ -1637,7 +1637,7 @@ void ShapeConstruct_ProjectCurveOnSurface::CorrectExtremity(const Handle(Geom_Cu
   IntRes2d_Domain Dom1, Dom2;
 
   Standard_Boolean IsPeriodic = (theIsUiso)?
-    mySurf->Surface()->IsVPeriodic() : mySurf->Surface()->IsUPeriodic();
+    mySurf->Surface()->IsVPeriodic111() : mySurf->Surface()->IsUPeriodic111();
 
   gp_Pnt2d FirstPointOfLine, SecondPointOfLine;
   Standard_Real FinishParam, FirstParam, SecondParam;
index 81d036ee148827b189fa4bbe85bf9d2b0b631fd3..e88e2836676a35d867cb1716fe90335a9d9d4f16 100644 (file)
@@ -634,7 +634,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo
       u2 = (aDelta > 2.*M_PI ? 2.*M_PI : u1 + aDelta); 
       }*/
       Standard_Boolean isTrim = Standard_False;
-      if(!aSurf->IsUPeriodic() ) { //else {
+      if(!aSurf->IsUPeriodic111() ) { //else {
         u1 = Max(u1,UF); u2 = Min(u2,UL);
         isTrim = Standard_True;
       }
@@ -644,7 +644,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo
       v1 = (aDelta > 2.*M_PI ? 0. : VF + ShapeAnalysis::AdjustByPeriod(VF,0.5*(UL+UF),2*M_PI)); ; 
       v2 = (aDelta > 2.*M_PI ? 2.* M_PI : v1 + aDelta); 
       }*/
-      if(!aSurf->IsVPeriodic()) {//else 
+      if(!aSurf->IsVPeriodic111()) {//else 
         v1 = Max(v1,VF); v2 = Min(v2,VL);
         isTrim = Standard_True;
       }
@@ -691,9 +691,9 @@ Standard_Boolean ShapeCustom_BSplineRestriction::ConvertSurface(const Handle(Geo
 #endif
             S = anApprox.Surface();
             Handle(Geom_BSplineSurface) Bsc = Handle(Geom_BSplineSurface)::DownCast(S);
-            if(aSurface->IsUPeriodic() )
+            if(aSurface->IsUPeriodic111() )
               Bsc->SetUPeriodic();
-            if(aSurface->IsVPeriodic() )
+            if(aSurface->IsVPeriodic111() )
               Bsc->SetVPeriodic();
             //Standard_Integer DegU = Bsc->UDegree(); // DegU not used (skl)
             //Standard_Integer DegV = Bsc->VDegree(); // DegV not used (skl)
index 9085d63a35ff1677641f8d122db56dc21e3ef565..f78da32a4d1f27272e3b60e0aa4b0293ac15a2b8 100644 (file)
@@ -403,7 +403,7 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToPeriodic (const Standard_Bool
   
   Standard_Boolean converted = Standard_False; //:p6
 
-  if ( uclosed && ! BSpl->IsUPeriodic() && BSpl->NbUPoles() >3 ) {
+  if ( uclosed && ! BSpl->IsUPeriodic111() && BSpl->NbUPoles() >3 ) {
     Standard_Boolean set = Standard_True;
     // if degree+1 at ends, first change it to 1 by rearranging knots
     if ( BSpl->UMultiplicity(1) == BSpl->UDegree() + 1 &&
@@ -444,7 +444,7 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToPeriodic (const Standard_Bool
                                                                newUKnots,oldVKnots,
                                                                newUMults,oldVMults,
                                                                BSpl->UDegree(),BSpl->VDegree(),
-                                                               BSpl->IsUPeriodic(),BSpl->IsVPeriodic());
+                                                               BSpl->IsUPeriodic111(),BSpl->IsVPeriodic111());
       BSpl = res;
     }
     else if ( BSpl->UMultiplicity(1) > BSpl->UDegree() ||
@@ -455,7 +455,7 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToPeriodic (const Standard_Bool
     }
   }
   
-  if ( vclosed && ! BSpl->IsVPeriodic() && BSpl->NbVPoles() >3 ) {     
+  if ( vclosed && ! BSpl->IsVPeriodic111() && BSpl->NbVPoles() >3 ) {  
     Standard_Boolean set = Standard_True;
     // if degree+1 at ends, first change it to 1 by rearranging knots
     if ( BSpl->VMultiplicity(1) == BSpl->VDegree() + 1 &&
@@ -496,7 +496,7 @@ Handle(Geom_Surface) ShapeCustom_Surface::ConvertToPeriodic (const Standard_Bool
                                                                oldUKnots,newVKnots,
                                                                oldUMults,newVMults,
                                                                BSpl->UDegree(),BSpl->VDegree(),
-                                                               BSpl->IsUPeriodic(),BSpl->IsVPeriodic());
+                                                               BSpl->IsUPeriodic111(),BSpl->IsVPeriodic111());
       BSpl = res;
     }
     else if ( BSpl->VMultiplicity(1) > BSpl->VDegree() ||
index c493274dba75ff31c0c2095712137f70fcf8b70c..dd4739e9d4a6025e4a3a289d378ee9bcc452dfc3 100644 (file)
@@ -526,7 +526,7 @@ void ShapeExtend_CompositeSurface::Bounds(Standard_Real& U1,
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean ShapeExtend_CompositeSurface::IsUPeriodic () const
+Standard_Boolean ShapeExtend_CompositeSurface::IsUPeriodic111 () const
 {
   return Standard_False;
 }
@@ -536,7 +536,7 @@ Standard_Boolean ShapeExtend_CompositeSurface::IsUPeriodic () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean ShapeExtend_CompositeSurface::IsVPeriodic () const 
+Standard_Boolean ShapeExtend_CompositeSurface::IsVPeriodic111 () const 
 {
   return Standard_False;
 }
index f30d083ccf82c592acaeab671e1dca2bfb2531e3..38f549a9518e771f0dc94a6718c71dfbea821760 100644 (file)
@@ -240,10 +240,10 @@ public:
   Standard_EXPORT virtual Standard_Boolean IsVClosed() const Standard_OVERRIDE;
   
   //! Returns False
-  Standard_EXPORT virtual Standard_Boolean IsUPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Boolean IsUPeriodic111() const Standard_OVERRIDE;
   
   //! Returns False
-  Standard_EXPORT virtual Standard_Boolean IsVPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT virtual Standard_Boolean IsVPeriodic111() const Standard_OVERRIDE;
   
   //! NOT IMPLEMENTED (returns Null curve)
   Standard_EXPORT virtual Handle(Geom_Curve) UIso (const Standard_Real U) const Standard_OVERRIDE;
index f3fc0cab5f65de3e59cfcb721127e5e0d13f2dab..24901e88c0e096261669fc487f5b42f7b574f241 100644 (file)
@@ -540,7 +540,7 @@ void ShapeFix_ComposeShell::LoadWires (ShapeFix_SequenceOfWireSegment &seqw) con
         sfw->Load ( sbwdM );
         Standard_Integer stat=0;
         Handle(Geom_Surface) gs = BRep_Tool::Surface(myFace);
-        if( gs->IsUPeriodic() && gs->IsVPeriodic() )
+        if( gs->IsUPeriodic111() && gs->IsVPeriodic111() )
         {
           // For torus-like shapes, first reorder in 2d since reorder is indifferent in 3d
           ShapeAnalysis_WireOrder sawo(Standard_False, 0);
index 5b2fb486faeb3fa6f9aac68e48394a87cce4ebc0..2cf582108629d0fba51e52967e725f5d81159974 100644 (file)
@@ -414,7 +414,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci)
     
   if(fabs(w1 - w2) < Precision::PConfusion())
   {
-    if(!theSurface->IsUPeriodic() && !theSurface->IsVPeriodic())
+    if(!theSurface->IsUPeriodic111() && !theSurface->IsVPeriodic111())
       return;
   }
     
@@ -444,7 +444,7 @@ void ShapeFix_EdgeProjAux::Init2d (const Standard_Real preci)
   if(parU || parV) {
     Standard_Real uf,ul,vf,vl;
     theSurface->Bounds(uf,ul,vf,vl);
-    Standard_Real period = (parU ? ul-uf : vl-vf);
+    Standard_Real period = (parU ? theSurface->UPeriod() : theSurface->VPeriod());
     w1+=ShapeAnalysis::AdjustToPeriod(w1,0,period);
     myFirstParam = w1;
     w2+=ShapeAnalysis::AdjustToPeriod(w2,0,period);
index 9ebadf5504a65ec64b32814020ec9290f3b6645e..65dede69f9a3d4704fd3526f2b43a565068831b7 100644 (file)
@@ -120,7 +120,7 @@ static Standard_Boolean IsSurfaceUVInfinite(const Handle(Geom_Surface)& theSurf)
 
 static Standard_Boolean IsSurfaceUVPeriodic(const Handle(Geom_Surface)& theSurf)
 {
-  return theSurf->IsUPeriodic() && theSurf->IsVPeriodic();
+  return theSurf->IsUPeriodic111() && theSurf->IsVPeriodic111();
 }
 
 //=======================================================================
@@ -1499,7 +1499,7 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam()
   //%pdn: surface should be made periodic before (see ShapeCustom_Surface)!
   if (mySurf->Surface()->IsKind(STANDARD_TYPE (Geom_BSplineSurface))) { 
     Handle (Geom_BSplineSurface) BSpl = Handle (Geom_BSplineSurface)::DownCast (mySurf->Surface());
-    if (!BSpl->IsUPeriodic() && !BSpl->IsVPeriodic())
+    if (!BSpl->IsUPeriodic111() && !BSpl->IsVPeriodic111())
       return Standard_False;
   }
   
index 92141c559a9fedb135777af353d6c50942ca68d6..425b998d72c386d9d77d796753fb21b3512681ab 100644 (file)
@@ -449,8 +449,8 @@ Standard_Boolean ShapeFix_Wire::FixReorder()
   Standard_Boolean isReorder = Standard_False;
   if ( sawo.Status() != 0 &&
        ! myAnalyzer->Surface().IsNull() &&
-       myAnalyzer->Surface()->Surface()->IsUPeriodic() &&
-       myAnalyzer->Surface()->Surface()->IsVPeriodic() ) {
+       myAnalyzer->Surface()->Surface()->IsUPeriodic111() &&
+       myAnalyzer->Surface()->Surface()->IsVPeriodic111() ) {
     Handle(ShapeExtend_WireData) sbwd2 = new ShapeExtend_WireData;
     for ( Standard_Integer i=WireData()->NbEdges(); i >=1; i-- )
       sbwd2->Add ( WireData()->Edge(i) );
@@ -1375,6 +1375,10 @@ Standard_Boolean ShapeFix_Wire::FixShifted()
   Standard_Real VRange = 1.;
   if (surf->Surface()->IsKind(STANDARD_TYPE(Geom_SurfaceOfRevolution)))
   {
+    //! Issue #29115. Surface of revolution is considered to be V-periodic
+    //! if and only if its basis curve is periodic and closed simultaneously.
+    //! Therefore, we need to keep this complex check for the given specific algorithm.
+
     Handle(Geom_SurfaceOfRevolution) aSurOfRev = Handle(Geom_SurfaceOfRevolution)::DownCast(surf->Surface());
     Handle(Geom_Curve) aBaseCrv = aSurOfRev->BasisCurve();
     while ((aBaseCrv->IsKind(STANDARD_TYPE(Geom_OffsetCurve))) ||
index 3b7d39f0b170f9443c30b958822dfd8117318a57..4c2e1b3f6c1033b751e335c43f7e61602e28bd22 100644 (file)
@@ -412,8 +412,8 @@ ShapePersistent_Geom_Surface::Translate(const Handle(Geom_BSplineSurface)& theSu
       Handle(pBSpline) aPpBS = new pBSpline;
       aPpBS->myURational = theSurf->IsURational();
       aPpBS->myVRational = theSurf->IsVRational();
-      aPpBS->myUPeriodic = theSurf->IsUPeriodic();
-      aPpBS->myVPeriodic = theSurf->IsVPeriodic();
+      aPpBS->myUPeriodic = theSurf->IsUPeriodic111();
+      aPpBS->myVPeriodic = theSurf->IsVPeriodic111();
       aPpBS->myUSpineDegree = theSurf->UDegree();
       aPpBS->myVSpineDegree = theSurf->VDegree();
       aPpBS->myPoles = StdLPersistent_HArray2::Translate<TColgp_HArray2OfPnt>("PColgp_HArray2OfPnt", theSurf->Poles());
index 9e6b94b9397128b8dd83959488de710d4d786bfb..cf2ce637be8a02d7339ef3dc372990ec1f6380e3 100644 (file)
@@ -136,12 +136,12 @@ Standard_Boolean ShapeUpgrade_FaceDivide::SplitSurface ()
   // make little extension to ensure all pcurves fit inside new surface bounds
   Standard_Real aSUf, aSUl, aSVf, aSVl;
   surf->Bounds(aSUf, aSUl, aSVf, aSVl);
-  if (!surf->IsUPeriodic()) {
+  if (!surf->IsUPeriodic111()) {
     Standard_Real dU = (Ul - Uf) * 0.01;
     if (Uf > aSUf) Uf -= Min(dU, Uf - aSUf);
     if (Ul < aSUl) Ul += Min(dU, aSUl - Ul);
   }
-  if (!surf->IsVPeriodic()) {
+  if (!surf->IsVPeriodic111()) {
     Standard_Real dV = (Vl - Vf) * 0.01;
     if (Vf > aSVf) Vf -= Min(dV, Vf - aSVf);
     if (Vl < aSVl) Vl += Min(dV, aSVl - Vl);
index 2aa1d06224a72ebaa1f6de2228e6fbfe605be890..feb9e05c28f7f2fa0e2884e3da509417f990bf06 100644 (file)
@@ -94,9 +94,9 @@ void ShapeUpgrade_SplitSurface::Init(const Handle(Geom_Surface)& S, const Standa
   Standard_Real U1,U2,V1,V2;
   mySurface->Bounds(U1,U2,V1,V2);
   Standard_Real precision = Precision::PConfusion();
-  if ( mySurface->IsUPeriodic() && 
+  if ( mySurface->IsUPeriodic111() && 
        ULast - UFirst <= U2 - U1 + precision ) { U1 = UFirst; U2 = U1 + mySurface->UPeriod(); }
-  if ( mySurface->IsVPeriodic() && 
+  if ( mySurface->IsVPeriodic111() && 
        VLast - VFirst <= V2 - V1 + precision ) { V1 = VFirst; V2 = V1 + mySurface->VPeriod(); }
   Standard_Real UF,UL,VF,VL;
   if( UFirst > U2-precision || 
index b2b17747bc7a8acdc0b46a8a4055f3819d46f9db..2cbd8237ecb283529b535cc892dac7fd96a1b678 100644 (file)
@@ -158,7 +158,7 @@ static void CheckPCurves (TopoDS_Wire& aWire, const TopoDS_Face& aFace,
       w2 = cf;
     }
 
-    if (w1 > w2 && mySurf->IsUPeriodic())
+    if (w1 > w2 && mySurf->IsUPeriodic111() && mySurf->IsUClosed())
     {
       Standard_Real u1,u2,v1,v2;
       mySurf->Bounds(u1,u2,v1,v2);
index 3b00d39d9fa7706fe1320caa0211ee431b2e5238..1c6d8557ce7a98bb35758faf3c352e257fb72546 100644 (file)
@@ -231,7 +231,7 @@ TopOpeBRepBuild_CorrectFace2d::TopOpeBRepBuild_CorrectFace2d()
   // I. Is the surface periodic
   TopLoc_Location aLocF;
   Handle(Geom_Surface) Surf = BRep_Tool::Surface(myCopyFace, aLocF);
-  if (!(Surf->IsUPeriodic() || Surf->IsVPeriodic())) {
+  if (!(Surf->IsUPeriodic111() || Surf->IsVPeriodic111())) {
     myIsDone=Standard_True;
     myErrorStatus=4;
     return;
@@ -239,7 +239,7 @@ TopOpeBRepBuild_CorrectFace2d::TopOpeBRepBuild_CorrectFace2d()
 
   //modified by NIZHNY-MZV  Mon Apr 24 11:29:56 2000
   //don't treat torus surfaces
-  if(Surf->IsUPeriodic() && Surf->IsVPeriodic()) {
+  if(Surf->IsUPeriodic111() && Surf->IsVPeriodic111()) {
     myIsDone=Standard_True;
     myErrorStatus=4;
     return;
index 09aff158e12320a840ea9709abdad1bc55174ba4..17487789be119a016421404ad2012a238a9b501d 100644 (file)
@@ -1039,7 +1039,7 @@ void TopOpeBRepBuild_Builder::SplitEvisoONperiodicF()
     if (!isface) continue;
 
     TopLoc_Location loc; const Handle(Geom_Surface)& S = BRep_Tool::Surface(TopoDS::Face(FOR),loc);
-    Standard_Boolean periodic = S->IsUPeriodic() || S->IsVPeriodic();
+    Standard_Boolean periodic = S->IsUPeriodic111() || S->IsVPeriodic111();
     if (!periodic) continue;
 
     TopoDS_Shape FF = FOR; FF.Orientation(TopAbs_FORWARD);
index a64c565c0e4f5fab0aa6f0377e0614e06626ea2a..866c937a27ee13c57821d0eb0a533c43a44ac6be 100644 (file)
@@ -102,8 +102,8 @@ static Standard_Boolean FUN_periodicS(const TopoDS_Shape& F)
 static Standard_Boolean FUN_periodic(const TopoDS_Face& F,Standard_Boolean& uper,Standard_Boolean& vper)
 {
   const Handle(Geom_Surface)& su = BRep_Tool::Surface(F);
-  uper = su->IsUPeriodic(); 
-  vper = su->IsVPeriodic();
+  uper = su->IsUPeriodic111(); 
+  vper = su->IsVPeriodic111();
   Standard_Boolean per = (uper || vper);
   return per;  
 }
@@ -112,8 +112,8 @@ static Standard_Boolean FUN_onboundsper(const gp_Pnt2d& uv,const TopoDS_Face& F)
 {  
   // 2d : 
   const Handle(Geom_Surface)& su = BRep_Tool::Surface(F);
-  Standard_Boolean uclo = su->IsUPeriodic();  
-  Standard_Boolean vclo = su->IsVPeriodic();
+  Standard_Boolean uclo = su->IsUPeriodic111();  
+  Standard_Boolean vclo = su->IsVPeriodic111();
   if (!uclo && !vclo) return Standard_False;
 
   Standard_Real u1,u2,v1,v2; su->Bounds(u1,u2,v1,v2);
index bb3dc34e24f6b438d9990eb912e76609ccf49ce9..f018420e6713d15c6568bca1bc38ae02c3fdc221 100644 (file)
@@ -1229,8 +1229,8 @@ void  TopOpeBRepDS_BuildTool::PCurve(TopoDS_Shape& F,
       if (tran) {
        TopLoc_Location Loc;
        const Handle(Geom_Surface) Surf = BRep_Tool::Surface(FF,Loc);
-       Standard_Boolean isUperio = Surf->IsUPeriodic();
-       Standard_Boolean isVperio = Surf->IsVPeriodic();
+       Standard_Boolean isUperio = Surf->IsUPeriodic111();
+       Standard_Boolean isVperio = Surf->IsVPeriodic111();
        gp_Dir2d dir2d = line2d->Direction();
        Standard_Real delta;
        if (isUperio && dir2d.IsParallel(gp::DX2d(),Precision::Angular())) {
index b131f9a7de936671bdbf8cc9be11a6343e53bccd..b5037dbe3d788577b94fe487832a696fd3f30480 100644 (file)
@@ -287,7 +287,7 @@ static void FC2D_translate(Handle(Geom2d_Curve) C2D,
                            const TopoDS_Edge& EF)
 {
   TopLoc_Location sloc; const Handle(Geom_Surface)& S1 = BRep_Tool::Surface(F,sloc);
-  Standard_Boolean isperio = S1->IsUPeriodic() || S1->IsVPeriodic();
+  Standard_Boolean isperio = S1->IsUPeriodic111() || S1->IsVPeriodic111();
   gp_Dir2d d2d; gp_Pnt2d O2d; Standard_Boolean isuiso,isviso; 
   Standard_Boolean uviso = TopOpeBRepTool_TOOL::UVISO(C2D,isuiso,isviso,d2d,O2d);
   Standard_Boolean EFnull = EF.IsNull();
index 5f76fea777488e1b61a193c5b3c6b8a1fe5daa4f..59750a955ea45254bf9efc841fc268d2752f3746 100644 (file)
@@ -198,22 +198,20 @@ static Standard_Boolean CheckPCurve
 
   // adjust domain for periodic surfaces
   TopLoc_Location aLoc;
-  Handle(Geom_Surface) aSurf = BRep_Tool::Surface(aFace, aLoc);
-  if (aSurf->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
-    aSurf = (Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurf))->BasisSurface();
+  const Handle(Geom_Surface) &aSurf = BRep_Tool::Surface(aFace, aLoc);
 
   gp_Pnt2d pnt = aPC->Value((fp+lp)/2);
   Standard_Real u,v;
   pnt.Coord(u,v);
 
-  if (aSurf->IsUPeriodic()) {
+  if (aSurf->IsUPeriodic111()) {
     Standard_Real aPer = aSurf->UPeriod();
     Standard_Integer nshift = (Standard_Integer) ((u-umin)/aPer);
     if (u < umin+aPer*nshift) nshift--;
     umin += aPer*nshift;
     umax += aPer*nshift;
   }
-  if (aSurf->IsVPeriodic()) {
+  if (aSurf->IsVPeriodic111()) {
     Standard_Real aPer = aSurf->VPeriod();
     Standard_Integer nshift = (Standard_Integer) ((v-vmin)/aPer);
     if (v < vmin+aPer*nshift) nshift--;
index ef4d4ee57f71c71b3027f393b255cdf63d7d7000..2c354c6006b017439d97607b79f5413b4cf8edd0 100644 (file)
@@ -251,9 +251,9 @@ Standard_EXPORT Standard_Boolean FUN_tool_closed(const Handle(Geom_Surface)& S,
 {
   uperiod = vperiod = 0.;
   if (S.IsNull()) return Standard_False;  
-  uclosed = S->IsUClosed(); if (uclosed) uclosed = S->IsUPeriodic(); //xpu261098 (BUC60382)
+  uclosed = S->IsUClosed(); if (uclosed) uclosed = S->IsUPeriodic111(); //xpu261098 (BUC60382)
   if (uclosed) uperiod = S->UPeriod();
-  vclosed = S->IsVClosed(); if (vclosed) vclosed = S->IsVPeriodic(); 
+  vclosed = S->IsVClosed(); if (vclosed) vclosed = S->IsVPeriodic111(); 
   if (vclosed) vperiod = S->VPeriod();
   Standard_Boolean closed = uclosed || vclosed;
   return closed;
index 1055a5c277850ff14cf863ee03f046861d15e762..6c4c454fc8b8c82742f8e898aa7b7832e7bb37b8 100644 (file)
@@ -160,8 +160,8 @@ void TopOpeBRepTool_ShapeTool::UVBOUNDS
     }
   }
   else { 
-    UPeriodic = BS->IsUPeriodic();
-    VPeriodic = BS->IsVPeriodic();
+    UPeriodic = BS->IsUPeriodic111();
+    VPeriodic = BS->IsVPeriodic111();
     BS->Bounds(Umin,Umax,Vmin,Vmax);
   }
 }
@@ -191,8 +191,8 @@ void TopOpeBRepTool_ShapeTool::AdjustOnPeriodic(const TopoDS_Shape& F,
   
 //  Standard_Real Ufirst,Ulast,Vfirst,Vlast;
   Standard_Boolean isUperio,isVperio;
-  isUperio = Surf->IsUPeriodic();
-  isVperio = Surf->IsVPeriodic();
+  isUperio = Surf->IsUPeriodic111();
+  isVperio = Surf->IsVPeriodic111();
 
   // exit if surface supporting F is not periodic on U or V
   if (!isUperio && !isVperio) return;
@@ -307,8 +307,8 @@ Standard_Real TopOpeBRepTool_ShapeTool::PeriodizeParameter
 
   TopLoc_Location Loc;
   const Handle(Geom_Surface) Surf = BRep_Tool::Surface(F,Loc);
-  Standard_Boolean isUperio = Surf->IsUPeriodic();
-  Standard_Boolean isVperio = Surf->IsVPeriodic();
+  Standard_Boolean isUperio = Surf->IsUPeriodic111() && Surf->IsUClosed();
+  Standard_Boolean isVperio = Surf->IsVPeriodic111() && Surf->IsVClosed();
   if (!isUperio && !isVperio) return periopar;
 
   Standard_Real Ufirst,Ulast,Vfirst,Vlast;
index 90add9ca4d40e9b6cd6760fb7444fb24e471df5d..88f9766856e624b155bdd2aaf9658762058483a6 100644 (file)
@@ -223,8 +223,8 @@ Standard_Boolean TopOpeBRepTool_TOOL::ClosedS(const TopoDS_Face& F)
 {
   Handle(Geom_Surface) S =TopOpeBRepTool_ShapeTool::BASISSURFACE(TopoDS::Face(F));
   if (S.IsNull()) return Standard_False;
-  Standard_Boolean uclosed = S->IsUClosed(); if (uclosed) uclosed = S->IsUPeriodic();
-  Standard_Boolean vclosed = S->IsVClosed(); if (vclosed) vclosed = S->IsVPeriodic(); 
+  Standard_Boolean uclosed = S->IsUClosed(); if (uclosed) uclosed = S->IsUPeriodic111();
+  Standard_Boolean vclosed = S->IsVClosed(); if (vclosed) vclosed = S->IsVPeriodic111(); 
   return (uclosed || vclosed);
 }
 
@@ -1136,7 +1136,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::Getduv(const TopoDS_Face& f,const gp_Pnt2d
 
   gp_Vec2d DUV( uv, uvtr );
   Handle(Geom_Surface) S = TopOpeBRepTool_ShapeTool::BASISSURFACE(f);
-  if ((S->IsUPeriodic()) && (Abs(DUV.X()) > S->UPeriod()/2.))
+  if ((S->IsUPeriodic111()) && (Abs(DUV.X()) > S->UPeriod()/2.))
     {
       Standard_Real U1 = uv.X(), U2 = uvtr.X(), period = S->UPeriod();
       ElCLib::AdjustPeriodic( 0., period, Precision::PConfusion(), U1, U2 );
@@ -1145,7 +1145,7 @@ Standard_Boolean TopOpeBRepTool_TOOL::Getduv(const TopoDS_Face& f,const gp_Pnt2d
        dx -= period;
       DUV.SetX( dx );
     }
-  if ((S->IsVPeriodic()) && (Abs(DUV.Y()) > S->VPeriod()/2.))
+  if ((S->IsVPeriodic111()) && (Abs(DUV.Y()) > S->VPeriod()/2.))
     {
       Standard_Real V1 = uv.Y(), V2 = uvtr.Y(), period = S->VPeriod();
       ElCLib::AdjustPeriodic( 0., period, Precision::PConfusion(), V1, V2 );