-// 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
#include <BlockFix_UnionFaces.hxx>
-#include <Basics_OCCTVersion.hxx>
-
#include <ShapeAnalysis_WireOrder.hxx>
#include <ShapeAnalysis_Edge.hxx>
//=======================================================================
//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
{
//map of edges
TopTools_MapOfShape aNewEdges;
+ TopExp_Explorer exp(aShape,TopAbs_EDGE);
//add edges without seams
- for(TopExp_Explorer exp(aShape,TopAbs_EDGE); exp.More(); exp.Next()) {
+ for(; exp.More(); exp.Next()) {
TopoDS_Shape edge = exp.Current();
if(aNewEdges.Contains(edge))
aNewEdges.Remove(edge);
}
}
- //add edges to the sequemce
- for(TopTools_MapIteratorOfMapOfShape anIter(aNewEdges); anIter.More(); anIter.Next())
- edges.Append(anIter.Key());
+ //add edges to the sequence
+ for(exp.ReInit(); exp.More(); exp.Next()) {
+ const TopoDS_Shape &anEdge = exp.Current();
+
+ if (aNewEdges.Contains(anEdge)) {
+ edges.Append(anEdge);
+ }
+ }
return isDropped;
}
//=======================================================================
//function : ClearRts
-//purpose : auxilary
+//purpose : auxiliary
//=======================================================================
static Handle(Geom_Surface) ClearRts(const Handle(Geom_Surface)& aSurface)
{
//=======================================================================
//function : IsFacesOfSameSolids
-//purpose : auxilary
+//purpose : auxiliary
//=======================================================================
static Standard_Boolean IsFacesOfSameSolids
(const TopoDS_Face &theFace1,
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