Salome HOME
Typo-fix by Kunda
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_GetInPlace_1.cxx
index ad30fedab38333c6d90e03255245577371bd2f37..7dbcbbc0295a2324f0f127d2ad47cbc571c26b71 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -59,8 +59,7 @@
 
 #include <IntTools_Tools.hxx>
 
-#include <BOPTools_Tools3D.hxx>
-#include <BOPTools_Tools2D.hxx>
+#include <GEOMAlgo_AlgoTools.hxx>
 
 
 
@@ -93,7 +92,7 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
 {
   Standard_Boolean bOk;
   Standard_Integer iErr;
-  Standard_Real aTol2;
+  //Standard_Real aTol2;
   TopAbs_ShapeEnum aType1, aType2;
   TopAbs_State aState;
   gp_Pnt aP1, aP2;
@@ -102,7 +101,7 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
   //
   iErr=0;
   bOk=Standard_False;
-  aTol2=myTolerance*myTolerance;
+  //aTol2=myTolerance*myTolerance;
   aType1=aS1.ShapeType();
   aType2=aS2.ShapeType();
   //
@@ -240,7 +239,6 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
   gp_Pnt aPx;
   gp_Pnt2d aP2Dx;
   gp_Vec aDNx;
-
   TopoDS_Face aF;
   TopExp_Explorer aExp;
   //
@@ -248,9 +246,8 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
   aCoef=10.;
   //
   aExp.Init (aZ, TopAbs_FACE);
-  for (; aExp.More() ; aExp.Next()) {
+  if (aExp.More()) {
     aF=*((TopoDS_Face*)&aExp.Current());
-    break;
   }
   //
   iErr=PntInFace(aF, aPx, aP2Dx);
@@ -259,7 +256,7 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
   }
   //
   aP2Dx.Coord(aUx, aVx);
-  BOPTools_Tools2D::FaceNormal(aF, aUx, aVx, aDNx);
+  GEOMAlgo_AlgoTools::FaceNormal(aF, aUx, aVx, aDNx);
   aDNx.Reverse();
   //
   aP.SetXYZ(aPx.XYZ()+aCoef*aTol*aDNx.XYZ());
@@ -369,29 +366,31 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
   //
   // 4.
   aNbDomains=aHatcher.NbDomains(aIx);
-  for (i=1; i<=aNbDomains; ++i) {
-    const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
-    bHasFirstPoint=aDomain.HasFirstPoint();
-    if (!bHasFirstPoint) {
-      iErr=5;
-      return iErr;
-    }
-    //
-    aV1=aDomain.FirstPoint().Parameter();
-    //
-    bHasSecondPoint=aDomain.HasSecondPoint();
-    if (!bHasSecondPoint) {
-      iErr=6;
-      return iErr;
-    }
-    //
-    aV2=aDomain.SecondPoint().Parameter();
-    //
-    aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
-    //
-    break;
+  if (!aNbDomains) {
+    iErr=5;
+    return iErr;
+  }
+  //
+  i=1;
+  const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
+  bHasFirstPoint=aDomain.HasFirstPoint();
+  if (!bHasFirstPoint) {
+    iErr=5;
+    return iErr;
+  }
+  //
+  aV1=aDomain.FirstPoint().Parameter();
+  //
+  bHasSecondPoint=aDomain.HasSecondPoint();
+  if (!bHasSecondPoint) {
+    iErr=6;
+    return iErr;
   }
   //
+  aV2=aDomain.SecondPoint().Parameter();
+  //
+  aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
+  //
   aS->D0(aUx, aVx, aPx);
   //
   theP2D.SetCoord(aUx, aVx);