0024510: Remove unused local variables
[occt.git] / src / IntTools / IntTools_EdgeEdge.cxx
old mode 100755 (executable)
new mode 100644 (file)
index e0cd5e5..efb517c
@@ -1,21 +1,17 @@
 // Created on: 2000-10-26
 // Created by: Peter KURNEV
-// Copyright (c) 2000-2012 OPEN CASCADE SAS
+// Copyright (c) 2000-2014 OPEN CASCADE SAS
 //
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
 //
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// This library is free software; you can redistribute it and / or modify it
+// under the terms of the GNU Lesser General Public version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
 //
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 #include <IntTools_EdgeEdge.ixx>
 
@@ -585,7 +581,7 @@ IntTools_EdgeEdge::IntTools_EdgeEdge()
   Standard_Integer step = 1, stepcheck = 1000, steplimit = 100000;
   Standard_Real value = (IP==1) ? DistanceFunction(0.5*(a+b)) : DerivativeFunction(0.5*(a+b));
   
-  while (1) {
+  for(;;) {
     x0=.5*(a+b);
 
     if (IP==1)
@@ -703,7 +699,7 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
   //
   //
   Standard_Boolean aVFlag1, aVFlag2, aGeomFlag1, aGeomFlag2;
-  Standard_Real Df2m2, Dm2l2, Df2l2, df2m2, dm2l2, df2l2, df1m1, dm1l1, df1l1;
+  Standard_Real Df2m2, Dm2l2, Df2l2, df2m2, dm2l2, df2l2, df1l1;
   Standard_Real tV1, tV2;
   //
   // parametric differences for C2
@@ -739,8 +735,6 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
   }
   //
   // geometric distances for C1
-  df1m1=aPf1.Distance(aPm1);
-  dm1l1=aPm1.Distance(aPl1);
   df1l1=aPf1.Distance(aPl1);
   //
   // if geometric distances between boundaries is less than myCriteria
@@ -866,7 +860,7 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
   void IntTools_EdgeEdge::IsIntersection (const Standard_Real ta, 
                                          const Standard_Real tb) 
 {
-  Standard_Integer i, aNb, pri;
+  Standard_Integer i, aNb;
   Standard_Real t, f;
   GeomAbs_CurveType aCT1, aCT2;
   IntTools_CArray1OfReal anArgs, aFunc;
@@ -922,7 +916,7 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
   }
   //
   // Prepare values of arguments for the interval [ta, tb]
-  pri=IntTools::PrepareArgs (myCFrom, tb, ta, myDiscret, myDeflection, anArgs);
+  IntTools::PrepareArgs (myCFrom, tb, ta, myDiscret, myDeflection, anArgs);
   aNb=anArgs.Length();
 
   aFunc.Resize(aNb);
@@ -946,7 +940,7 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
                                             const IntTools_CArray1OfReal& f)  
 {
   Standard_Integer i, n, k;
-  Standard_Real fr, tr, anEpsNull;
+  Standard_Real tr, anEpsNull;
   IntTools_CArray1OfReal fd;
   TColStd_SequenceOfReal aTSeq, aFSeq;
   
@@ -993,7 +987,6 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
     //aa
     if (fd1*fd2 < 0.) {
       tr=FindSimpleRoot(2, t1, t2, fd1);
-      fr=DistanceFunction(tr);
       myPar1=tr;
       myParallel=Standard_False;
       break;
@@ -1001,7 +994,6 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
     
     if (!bF1 && bF2) {
       tr=t2;
-      fr=fd2;
       myPar1=tr;
       myParallel=Standard_False;
       break;
@@ -1009,7 +1001,6 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
     
     if (bF1 && !bF2) {
       tr=t1;
-      fr=fd1;
       myPar1=tr;
       myParallel=Standard_False;
       break;
@@ -1252,7 +1243,7 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
   Standard_Real aTFR1, aTLR1, aTFR2, aTLR2;
   Standard_Real aTL1, aTL2, aTC1, aTC2;
   Standard_Real aRC, aDLC, aD2, aC2, aTLx, aTCx;
-  GeomAbs_CurveType aTFrom, aTTo;
+  GeomAbs_CurveType aTFrom;
   gp_Circ aCirc;
   gp_Lin  aLine;
   gp_Pnt aPC, aPLx, aPCx;
@@ -1262,7 +1253,6 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
   (aCP.Ranges2())(1).Range(aTFR2, aTLR2);
   //
   aTFrom=myCFrom.GetType();
-  aTTo  =myCTo.GetType();
   //
   aTL1=aTFR1;
   aTL2=aTLR1;
@@ -1438,13 +1428,12 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
      (myCFrom.GetType() == GeomAbs_Circle && myCTo.GetType() == GeomAbs_Line))
   {
     Standard_Real aRadius;
-    GeomAbs_CurveType aTFrom, aTTo;
+    GeomAbs_CurveType aTFrom;
     gp_Circ aCirc;
     gp_Lin  aLine;
     gp_Pnt aPCenter, aPOnLine;
 
     aTFrom=myCFrom.GetType();
-    aTTo  =myCTo.GetType();
     
     if (aTFrom==GeomAbs_Circle) {
       aCirc=myCFrom.Circle();
@@ -1512,7 +1501,7 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
   //
   IsParallel = Standard_False;
   IsCoincide = Standard_False;
-  Tolang2 = 1.e-16;
+  Tolang2 = Precision::Angular();
   Tol2 = myCriteria*myCriteria; 
   //
   gp_Lin C1 = myCFrom.Line();
@@ -1521,6 +1510,7 @@ Standard_Integer IntTools_EdgeEdge::FindRangeOnCurve2(IntTools_CommonPrt&  aComm
   const gp_Dir& D2 = C2.Position().Direction();
   Standard_Real aCos = D1.Dot(D2);
   Standard_Real Ang2;
+
   if(aCos >= 0. ) {
     Ang2 = 2.*(1. - aCos);
   }