Salome HOME
Updated for PAL14857.
[modules/geom.git] / src / NMTTools / NMTTools_PaveFiller_5.cxx
index 392267f3dbdbf4f25b85d5e89121ee5be3bef8a7..0c6dbab260a9233240bde2cb2dfdcff5980a92a0 100644 (file)
@@ -1,3 +1,22 @@
+// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 
+// 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.
+// 
+// This library is distributed in the hope that it will be useful 
+// but WITHOUT ANY WARRANTY; without even the implied warranty of 
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public  
+// License along with this library; if not, write to the Free Software 
+// 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:       NMTTools_PaveFiller_5.cxx
 // Created:    Mon Dec 15 11:28:33 2003
 // Author:     Peter KURNEV
@@ -59,6 +78,8 @@
 #include <NMTTools_IndexedDataMapOfIndexedMapOfInteger.hxx>
 #include <NMTTools_CommonBlockAPI.hxx>
 #include <NMTTools_ListOfCommonBlock.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopExp.hxx>
 
 static
   void VertexParameter(const IntTools_CommonPrt& aCPart,
@@ -67,7 +88,7 @@ static
   Standard_Boolean IsOnPave(const Standard_Real& aTR,
                            const IntTools_Range& aCPRange,
                            const Standard_Real& aTolerance);
-
+//
 //=======================================================================
 // function: PerformEF
 // purpose: 
@@ -83,7 +104,6 @@ static
   BooleanOperations_IndexedDataMapOfShapeInteger aMapVI;
   BOPTools_IDMapOfPaveBlockIMapOfInteger aMapCB;
   BOPTools_IMapOfPaveBlock aIMPBx;
-  
   //
   BOPTools_CArray1OfESInterference& aEFs=myIntrPool->ESInterferences();
   //
@@ -119,14 +139,32 @@ static
       continue;
     }
     // Edge
-    const TopoDS_Edge& aE=TopoDS::Edge(myDS->GetShape(nE));
+    const TopoDS_Edge aE=TopoDS::Edge(myDS->GetShape(nE));//mpv
     if (BRep_Tool::Degenerated(aE)){
       continue;
     }
-    aTolE=BRep_Tool::Tolerance(aE);
     // Face
-    const TopoDS_Face& aF=TopoDS::Face(myDS->GetShape(nF));
+    const TopoDS_Face aF=TopoDS::Face(myDS->GetShape(nF));//mpv
+    //
+    // Modified 
+    // to avoid intersection between face and edge from that face
+    // Thu Sep 14 14:35:18 2006 
+    // Contribution of Samtech www.samcef.com BEGIN
+    TopTools_IndexedMapOfShape aME;
+    //
+    TopExp::MapShapes(aF, TopAbs_EDGE, aME);
+    if (aME.Contains(aE)) {
+      continue;
+    }
+    // Contribution of Samtech www.samcef.com END
+    //
     aTolF=BRep_Tool::Tolerance(aF);
+    
+    // Modified  Thu Sep 14 14:35:18 2006 
+    // Contribution of Samtech www.samcef.com BEGIN
+    aTolE=BRep_Tool::Tolerance(aE);
+    // Contribution of Samtech www.samcef.com END
+    
     const Bnd_Box& aBBF=myDS->GetBoundingBox(nF); 
     //
     // Process each PaveBlock on edge nE
@@ -473,7 +511,7 @@ static
     aNbEdges=aME.Extent();
     for (j=1; j<=aNbEdges; ++j) {
       nE=aME(j);
-      const TopoDS_Edge& aE=TopoDS::Edge(myDS->Shape(nE));
+      const TopoDS_Edge aE=TopoDS::Edge(myDS->Shape(nE));//mpv
       //
       aFlag=myContext.ComputeVE (aNewVertex, aE, aT);
       //
@@ -556,7 +594,7 @@ static
   aNbV=aMVF.Extent();
   for (i=1; i<=aNbV; ++i) {
     nVF=aMVF(i);
-    const TopoDS_Vertex& aVF=TopoDS::Vertex(myDS->Shape(nVF));
+    const TopoDS_Vertex aVF=TopoDS::Vertex(myDS->Shape(nVF));//mpv
     iFlag=IntTools_Tools::ComputeVV(aNewVertex, aVF);
     if (!iFlag) {
       return nVF;