Salome HOME
Merge V8_4_BR branch.
[modules/geom.git] / src / BlockFix / BlockFix_UnionFaces.cxx
index c1788bbb157405226f08706b4e6188fd4da50760..9a42dde438bf06ce2564a6677921f0583ed78f5d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  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
@@ -26,8 +26,6 @@
 
 #include <BlockFix_UnionFaces.hxx>
 
-#include <Basics_OCCTVersion.hxx>
-
 #include <ShapeAnalysis_WireOrder.hxx>
 #include <ShapeAnalysis_Edge.hxx>
 
@@ -127,7 +125,7 @@ Standard_Integer& BlockFix_UnionFaces::GetOptimumNbFaces()
 
 //=======================================================================
 //function : AddOrdinaryEdges
-//purpose  : auxilary
+//purpose  : auxiliary
 //           adds edges from the shape to the sequence
 //           seams and equal edges are dropped
 //           Returns true if one of original edges dropped
@@ -179,7 +177,7 @@ static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges,
 
 //=======================================================================
 //function : ClearRts
-//purpose  : auxilary
+//purpose  : auxiliary
 //=======================================================================
 static Handle(Geom_Surface) ClearRts(const Handle(Geom_Surface)& aSurface)
 {
@@ -193,7 +191,7 @@ static Handle(Geom_Surface) ClearRts(const Handle(Geom_Surface)& aSurface)
 
 //=======================================================================
 //function : IsFacesOfSameSolids
-//purpose  : auxilary
+//purpose  : auxiliary
 //=======================================================================
 static Standard_Boolean IsFacesOfSameSolids
        (const TopoDS_Face                               &theFace1,
@@ -593,10 +591,13 @@ TopoDS_Shape BlockFix_UnionFaces::Perform(const TopoDS_Shape& Shape)
       sfw->SetMaxTolerance(Max(1.,myTolerance*1000.));
       sfw->SetFace(aFace);
       for (TopoDS_Iterator iter (aFace,Standard_False); iter.More(); iter.Next()) {
-        TopoDS_Wire wire = TopoDS::Wire(iter.Value());
-        sfw->Load(wire);
-        sfw->FixReorder();
-        sfw->FixShifted();
+        TopoDS_Shape aFaceCont = iter.Value();
+        if (!aFaceCont.IsNull() && aFaceCont.ShapeType() == TopAbs_WIRE) {
+          TopoDS_Wire wire = TopoDS::Wire(iter.Value());
+          sfw->Load(wire);
+          sfw->FixReorder();
+          sfw->FixShifted();
+        }
       }
     }
   } // end processing each solid