]> OCCT Git - occt-copy.git/commitdiff
Corrections according to remarks. CR24694_8
authorjgv <jgv@opencascade.com>
Thu, 4 Jun 2015 11:54:41 +0000 (14:54 +0300)
committermkv <mkv@opencascade.com>
Thu, 4 Jun 2015 15:47:36 +0000 (18:47 +0300)
src/IntWalk/IntWalk_IWalking_2.gxx
src/IntWalk/IntWalk_IWalking_4.gxx
src/IntWalk/IntWalk_IWalking_6.gxx

index fad59567bf5d60f2fa80cbde362ae2abc66fde64..2ac369ddcb5224ece493e3a85ac9c0f984e460d6 100644 (file)
@@ -214,16 +214,16 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage
     previousPoint.ParametersOnS1(Up,Vp);
   }
 
-  IntWalk_VectorOfWalkingData wdata [2] = {wd2, wd3};
+  IntWalk_VectorOfWalkingData* wdata [2] = {&wd2, &wd3};
   for (Standard_Integer ind = 0; ind < 2; ind++)
-    for (size_t i = 1; i < wdata[ind].size(); i++) { 
-      if (wdata[ind][i].etat > 0) { 
+    for (size_t i = 1; i < wdata[ind]->size(); i++) { 
+      if ((*(wdata[ind]))[i].etat > 0) { 
         // debug jag 05.04.94
         
         //      if ((Up-wd2[i].ustart)*(UV(1)-wd2[i].ustart) +
         //       (Vp-wd2[i].vstart)*(UV(2)-wd2[i].vstart) <= 0)
-        Utest = wdata[ind][i].ustart;
-        Vtest = wdata[ind][i].vstart;
+        Utest = (*(wdata[ind]))[i].ustart;
+        Vtest = (*(wdata[ind]))[i].vstart;
         
         Du  = UV(1)-Utest;
         Dv  = UV(2)-Vtest;
@@ -237,7 +237,7 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage
         if ((Abs(Du) < tolu2 && Abs(Dv) < tolv2) ||
             (Abs(Dup) < tolu2 && Abs(Dvp) < tolv2)) { 
           
-          wdata[ind][i].etat = -wdata[ind][i].etat;
+          (*(wdata[ind]))[i].etat = -(*(wdata[ind]))[i].etat;
         }
         else {
           Standard_Real DDu = (UV(1)-Up);
@@ -247,7 +247,7 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage
           if(DD1<=DDD) { 
             Standard_Real DD2 = Dup*Dup+Dvp*Dvp;
             if(DD2<=DDD && ((Du*Dup) + (Dv*Dvp*tolu/tolv) <= 0.)) {    
-              wdata[ind][i].etat = -wdata[ind][i].etat;
+              (*(wdata[ind]))[i].etat = -(*(wdata[ind]))[i].etat;
             }
           }
         }
index bcf30c4993a2ae6e90539fd0f49e29a01630f225..a6ace30f8d2545dcb3398b855cc63bca584501c8 100644 (file)
@@ -397,9 +397,10 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
                 gp_Vec   newd3d;
                 gp_Dir2d newd2d;
                 Standard_Boolean IsDiscriminantNull;
-                ComputeDirOfTangentialIntersection(Func, StepSignTangent,
-                                                   IsDiscriminantNull, SignOfBcoeff,
-                                                   newd3d, newd2d);
+                Standard_Boolean DirComputed =
+                  ComputeDirOfTangentialIntersection(Func, StepSignTangent,
+                                                     IsDiscriminantNull, SignOfBcoeff,
+                                                     newd3d, newd2d);
                 if (!IsDiscriminantNull) //we have gone from tangent line
                 {
                   //take line from prevprevP to prevP
@@ -419,30 +420,33 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
                   Uvap(2) = ProjCurSol.Y();
                   Func.Values(Uvap, FuncVal, D);
                   /////////
-                  ComputeDirOfTangentialIntersection(Func, StepSignTangent,
-                                                     IsDiscriminantNull, SignOfBcoeff,
-                                                     newd3d, newd2d);
+                  DirComputed = ComputeDirOfTangentialIntersection(Func, StepSignTangent,
+                                                                    IsDiscriminantNull, SignOfBcoeff,
+                                                                    newd3d, newd2d);
                 }
-                if (SignOfBcoeff == 0) //point of branching
-                  Status = IntWalk_ArretSurPoint;
-                else
+                if (DirComputed)
                 {
-                  if (PrevSignOfBcoeff == 0 ||
-                      SignOfBcoeff == PrevSignOfBcoeff)
-                  {                  
-                    Status = IntWalk_OKtangent;
-                    MakeWalkingPoint(2, Uvap(1), Uvap(2), Func, previousPoint);
-                    previousd3d = newd3d;
-                    previousd2d = newd2d;
-                    CurrentLine->AddPoint(previousPoint);
-                  }
-                  else //change of sign of Bcoeff
+                  if (SignOfBcoeff == 0) //point of branching
+                    Status = IntWalk_ArretSurPoint;
+                  else
                   {
-                    MakeWalkingPoint(1, Uvap(1), Uvap(2), Func, Psol);
-                    FindExactCuspPoint(Func, Psol,
-                                       PrevSignOfBcoeff, SignOfBcoeff);
-                    Psol.ParametersOnSurface(reversed, Uvap(1), Uvap(2));
-                    //Status = IntWalk_ArretSurPoint;
+                    if (PrevSignOfBcoeff == 0 ||
+                        SignOfBcoeff == PrevSignOfBcoeff)
+                    {                  
+                      Status = IntWalk_OKtangent;
+                      MakeWalkingPoint(2, Uvap(1), Uvap(2), Func, previousPoint);
+                      previousd3d = newd3d;
+                      previousd2d = newd2d;
+                      CurrentLine->AddPoint(previousPoint);
+                    }
+                    else //change of sign of Bcoeff
+                    {
+                      MakeWalkingPoint(1, Uvap(1), Uvap(2), Func, Psol);
+                      FindExactCuspPoint(Func, Psol,
+                                         PrevSignOfBcoeff, SignOfBcoeff);
+                      Psol.ParametersOnSurface(reversed, Uvap(1), Uvap(2));
+                      //Status = IntWalk_ArretSurPoint;
+                    }
                   }
                 }
               }
@@ -776,31 +780,33 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
               gp_Vec   newd3d;
               gp_Dir2d newd2d;
               Standard_Boolean IsDiscriminantNull;
-              ComputeDirOfTangentialIntersection(Func, StepSignTangent,
-                                                 IsDiscriminantNull, SignOfBcoeff,
-                                                 newd3d, newd2d);
-              if (SignOfBcoeff == 0) //point of branching
-              {
-                //Status = IntWalk_ArretSurPoint;
-              }
-              else
+              if (ComputeDirOfTangentialIntersection(Func, StepSignTangent,
+                                                     IsDiscriminantNull, SignOfBcoeff,
+                                                     newd3d, newd2d))
               {
-                if (PrevSignOfBcoeff == 0 ||
-                    SignOfBcoeff == PrevSignOfBcoeff)
+                if (SignOfBcoeff == 0) //point of branching
                 {
-                  Status = IntWalk_OKtangent;
-                  MakeWalkingPoint(2, Uvap(1), Uvap(2), Func, previousPoint);
-                  previousd3d = newd3d;
-                  previousd2d = newd2d;
-                  CurrentLine->AddPoint(previousPoint);
+                  //Status = IntWalk_ArretSurPoint;
                 }
-                else //change of sign of Bcoeff
+                else
                 {
-                  MakeWalkingPoint(1, Uvap(1), Uvap(2), Func, Psol);
-                  FindExactCuspPoint(Func, Psol,
-                                     PrevSignOfBcoeff, SignOfBcoeff);
-                  Psol.ParametersOnSurface(reversed, Uvap(1), Uvap(2));
-                  //Status = IntWalk_ArretSurPoint;
+                  if (PrevSignOfBcoeff == 0 ||
+                      SignOfBcoeff == PrevSignOfBcoeff)
+                  {
+                    Status = IntWalk_OKtangent;
+                    MakeWalkingPoint(2, Uvap(1), Uvap(2), Func, previousPoint);
+                    previousd3d = newd3d;
+                    previousd2d = newd2d;
+                    CurrentLine->AddPoint(previousPoint);
+                  }
+                  else //change of sign of Bcoeff
+                  {
+                    MakeWalkingPoint(1, Uvap(1), Uvap(2), Func, Psol);
+                    FindExactCuspPoint(Func, Psol,
+                                       PrevSignOfBcoeff, SignOfBcoeff);
+                    Psol.ParametersOnSurface(reversed, Uvap(1), Uvap(2));
+                    //Status = IntWalk_ArretSurPoint;
+                  }
                 }
               }
               if (Status == IntWalk_ArretSurPoint) {
index 62271321e25353afe15b93fa2f10c32e147636c7..8d62b26abb126cfedf1fc465ac62d0805fdc3f38 100644 (file)
@@ -303,9 +303,10 @@ void IntWalk_IWalking::OpenLine(const Standard_Integer N,
     gp_Vec   newd3d;
     gp_Dir2d newd2d;
     Standard_Boolean IsDiscriminantNull;
-    ComputeDirOfTangentialIntersection(sp, theSign,
-                                       IsDiscriminantNull, theSignOfBcoeff,
-                                       newd3d, newd2d);
+    if (!ComputeDirOfTangentialIntersection(sp, theSign,
+                                            IsDiscriminantNull, theSignOfBcoeff,
+                                            newd3d, newd2d))
+      StdFail_UndefinedDerivative::Raise();
     previousd3d = newd3d;
     previousd2d = newd2d;
   }