]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx
Salome HOME
0021672: [CEA 565] Dump Study from script
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_GetInPlace_1.cxx
index 0bebbba4a75c8e807ab2ded98d72a1867231fa1d..25f418db438c730c2b98be6b174b984475aa6c23 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  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
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
-// File:     GEOMAlgo_GetInPlace_1.cxx
-// Author:   Peter KURNEV
+// File:       GEOMAlgo_GetInPlace_1.cxx
+// Author:     Peter KURNEV
 
 #include <GEOMAlgo_GetInPlace.hxx>
 
-#include <Basics_OCCTVersion.hxx>
-
 #include <math.h>
 
 #include <gp_Pnt.hxx>
@@ -40,9 +39,8 @@
 #include <Geom2dAdaptor_Curve.hxx>
 #include <Geom2dHatch_Hatcher.hxx>
 #include <Geom2dHatch_Intersector.hxx>
-#include <GeomAPI_ProjectPointOnCurve.hxx>
-
 #include <HatchGen_Domain.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
 
 #include <TopAbs_State.hxx>
 #include <TopAbs_ShapeEnum.hxx>
@@ -53,9 +51,9 @@
 #include <TopoDS_Solid.hxx>
 #include <TopoDS_Face.hxx>
 
+#include <BRep_Tool.hxx>
 #include <TopExp_Explorer.hxx>
 
-#include <BRep_Tool.hxx>
 #include <BRepTools.hxx>
 #include <BRepClass3d_SolidClassifier.hxx>
 
 #include <BOPTools_Tools2D.hxx>
 
 
+
 static
   Standard_Integer PntInEdge(const TopoDS_Edge& aF,
-                             gp_Pnt& aP);
+                            gp_Pnt& aP);
 static
   Standard_Integer PntInEdge(const TopoDS_Edge& aF,
-                             gp_Pnt& aP,
-                             Standard_Real& aT);
+                            gp_Pnt& aP,
+                            Standard_Real& aT);
 static
   Standard_Integer PntInFace(const TopoDS_Face& aF,
-                             gp_Pnt& aP);
+                            gp_Pnt& aP);
 static
   Standard_Integer PntInFace(const TopoDS_Face& aF,
-                             gp_Pnt& aP,
-                             gp_Pnt2d& theP2D);
+                            gp_Pnt& aP,
+                            gp_Pnt2d& theP2D);
 static
   Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
-                              const Standard_Real aTol,
-                              gp_Pnt& aP);
+                             const Standard_Real aTol,
+                             gp_Pnt& aP);
+
 
 //=======================================================================
 //function : CheckCoincidence
 //purpose  :
 //=======================================================================
 Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
-                                                       const TopoDS_Shape& aS2)
+                                                      const TopoDS_Shape& aS2)
 {
   Standard_Boolean bOk;
   Standard_Integer iErr;
@@ -150,22 +150,18 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
     //
     const TopoDS_Edge& aE1=*((TopoDS_Edge*)&aS1);
     //
-#if OCC_VERSION_LARGE > 0x06050200
     GeomAPI_ProjectPointOnCurve& aPPC=myContext->ProjPC(aE1);
-#else
-    GeomAPI_ProjectPointOnCurve& aPPC=myContext.ProjPC(aE1);
-#endif
     aPPC.Perform(aP2);
     aNbPoints=aPPC.NbPoints();
     if (aNbPoints) {
       aDmin=aPPC.LowerDistance();
       aT=aPPC.LowerDistanceParameter();
       if (aDmin < myTolerance) {
-        dT=1.e-12;
-        BRep_Tool::Curve(aE1, aT1, aT2);
+       dT=1.e-12;
+       BRep_Tool::Curve(aE1, aT1, aT2);
         if(aT > (aT1-dT) && aT < (aT2+dT)) {
-          bOk=Standard_True;
-        }
+         bOk=Standard_True;
+       }
       }
     }
     //else {
@@ -176,21 +172,13 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
   else if (aType1==TopAbs_FACE) {
     const TopoDS_Face& aF1=*((TopoDS_Face*)&aS1);
     //
-#if OCC_VERSION_LARGE > 0x06050200
     bOk=myContext->IsValidPointForFace(aP2, aF1, myTolerance);
-#else
-    bOk=myContext.IsValidPointForFace(aP2, aF1, myTolerance);
-#endif
   }
   //
   else if (aType1==TopAbs_SOLID) {
     const TopoDS_Solid& aZ1=*((TopoDS_Solid*)&aS1);
     //
-#if OCC_VERSION_LARGE > 0x06050200
     BRepClass3d_SolidClassifier& aSC=myContext->SolidClassifier(aZ1);
-#else
-    BRepClass3d_SolidClassifier& aSC=myContext.SolidClassifier(aZ1);
-#endif
     aSC.Perform(aP2, myTolerance);
     aState=aSC.State();
     bOk=(aState==TopAbs_IN);
@@ -209,7 +197,8 @@ Standard_Boolean GEOMAlgo_GetInPlace::CheckCoincidence(const TopoDS_Shape& aS1,
 //purpose  :
 //=======================================================================
 Standard_Integer PntInEdge(const TopoDS_Edge& aE,
-                           gp_Pnt& aP)
+                          gp_Pnt& aP)
+
 {
   Standard_Integer iErr;
   Standard_Real aT;
@@ -223,8 +212,8 @@ Standard_Integer PntInEdge(const TopoDS_Edge& aE,
 //purpose  :
 //=======================================================================
 Standard_Integer PntInEdge(const TopoDS_Edge& aE,
-                           gp_Pnt& aP,
-                           Standard_Real& aT)
+                          gp_Pnt& aP,
+                          Standard_Real& aT)
 {
   Standard_Integer iErr;
   Standard_Real aT1, aT2;
@@ -243,8 +232,8 @@ Standard_Integer PntInEdge(const TopoDS_Edge& aE,
 //purpose  :
 //=======================================================================
 Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
-                            const Standard_Real aTol,
-                            gp_Pnt& aP)
+                           const Standard_Real aTol,
+                           gp_Pnt& aP)
 {
   Standard_Integer iErr;
   Standard_Real aUx, aVx, aCoef;
@@ -282,7 +271,7 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
 //purpose  :
 //=======================================================================
 Standard_Integer PntInFace(const TopoDS_Face& aF,
-                           gp_Pnt& aP)
+                          gp_Pnt& aP)
 {
   Standard_Integer iErr;
   //
@@ -297,8 +286,8 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
 //purpose  :
 //=======================================================================
 Standard_Integer PntInFace(const TopoDS_Face& aF,
-                           gp_Pnt& theP,
-                           gp_Pnt2d& theP2D)
+                          gp_Pnt& theP,
+                          gp_Pnt2d& theP2D)
 {
   Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
   Standard_Integer iErr, aIx, aNbDomains, i;
@@ -323,8 +312,8 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
   //
   Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr);
   Geom2dHatch_Hatcher aHatcher(aIntr,
-                               aTolHatch2D, aTolHatch3D,
-                               Standard_True, Standard_False);
+                              aTolHatch2D, aTolHatch3D,
+                              Standard_True, Standard_False);
   //
   iErr=0;
   aEpsT=1.e-12;
@@ -410,3 +399,4 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
   //
   return iErr;
 }
+