Salome HOME
Mantis issue 0021541: EDF 2213 GEOM: Filling accuracy
[modules/geom.git] / src / GEOMAlgo / GEOMAlgo_Tools.cxx
index 414dfa09af1fd7afbbb961913feb7b0307592bea..8ae8a8e8fdb856998f8f620e868b90700306e94f 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_Tools.cxx
 // Created:     Mon Dec  6 11:35:29 2004
 // Author:      Peter KURNEV
 
-#include <GEOMAlgo_Tools.ixx>
+#include <GEOMAlgo_Tools.hxx>
 
 #include <gp.hxx>
 #include <gp_Pnt.hxx>
@@ -117,7 +118,7 @@ void GetCount(const TopoDS_Shape& aS,
 //=======================================================================
   Standard_Integer GEOMAlgo_Tools::RefineSDShapes(GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape& aMPKLE,
                                                   const Standard_Real aTol,
-                                                  IntTools_Context& aCtx)
+                                                  const Handle(IntTools_Context)& aCtx)
 {
   Standard_Integer i, aNbE, iErr, j, aNbEE, aNbToAdd;
   TopTools_IndexedDataMapOfShapeListOfShape aMEE, aMSDE, aMEToAdd;
@@ -180,7 +181,7 @@ void GetCount(const TopoDS_Shape& aS,
 Standard_Integer GEOMAlgo_Tools::FindSDShapes(const TopTools_ListOfShape& aLE,
                                               const Standard_Real aTol,
                                               TopTools_IndexedDataMapOfShapeListOfShape& aMEE,
-                                              IntTools_Context& aCtx)
+                                              const Handle(IntTools_Context)& aCtx)
 {
   Standard_Integer aNbE, aNbEProcessed, aNbESD, iErr;
   TopTools_ListOfShape aLESD;
@@ -253,7 +254,7 @@ Standard_Integer GEOMAlgo_Tools::FindSDShapes(const TopoDS_Shape& aE1,
                                               const TopTools_ListOfShape& aLE,
                                               const Standard_Real aTol,
                                               TopTools_ListOfShape& aLESD,
-                                              IntTools_Context& aCtx)
+                                              const Handle(IntTools_Context)& aCtx)
 {
   Standard_Boolean bIsDone;
   Standard_Real aTol2, aD2;
@@ -291,7 +292,7 @@ Standard_Integer GEOMAlgo_Tools::FindSDShapes(const TopoDS_Shape& aE1,
 Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1,
                                                      const TopoDS_Shape& aS,
                                                      gp_Pnt& aP2,
-                                                     IntTools_Context& aCtx)
+                                                     const Handle(IntTools_Context)& aCtx)
 {
   Standard_Boolean bIsDone = Standard_False;
   Standard_Real aT2;
@@ -313,7 +314,7 @@ Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1,
           if (aC3D.IsNull()) {
             return Standard_True;
           }
-          bIsDone = aCtx.ProjectPointOnEdge(aP1, aE2, aT2);
+          bIsDone = aCtx->ProjectPointOnEdge(aP1, aE2, aT2);
         }
         if (!bIsDone) {
           return bIsDone;
@@ -326,7 +327,7 @@ Standard_Boolean GEOMAlgo_Tools::ProjectPointOnShape(const gp_Pnt& aP1,
     case TopAbs_FACE:
       {
         const TopoDS_Face& aF2 = TopoDS::Face(aS);
-        GeomAPI_ProjectPointOnSurf& aProj = aCtx.ProjPS(aF2);
+        GeomAPI_ProjectPointOnSurf& aProj = aCtx->ProjPS(aF2);
         //
         aProj.Perform(aP1);
         bIsDone = aProj.IsDone();
@@ -488,7 +489,7 @@ Standard_Integer
   GEOMAlgo_Tools::BuildPCurveForEdgeOnFace(const TopoDS_Edge& aEold,
                                            const TopoDS_Edge& aEnew,
                                            const TopoDS_Face& aF,
-                                           IntTools_Context& aCtx)
+                                           const Handle(IntTools_Context)& aCtx)
 {
   Standard_Boolean bIsClosed, bUClosed, bHasOld;
   Standard_Integer iRet, aNbPoints;
@@ -553,7 +554,7 @@ Standard_Integer
   aS=BRep_Tool::Surface(aF);
   aS->D0(aUS1, aVS1, aP);
   //
-  GeomAPI_ProjectPointOnCurve& aProjPC=aCtx.ProjPC(aEnew);
+  GeomAPI_ProjectPointOnCurve& aProjPC=aCtx->ProjPC(aEnew);
   //
   aProjPC.Perform(aP);
   aNbPoints=aProjPC.NbPoints();