Salome HOME
projects
/
modules
/
geom.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge V8_4_BR branch.
[modules/geom.git]
/
src
/
BlockFix
/
BlockFix_UnionFaces.cxx
diff --git
a/src/BlockFix/BlockFix_UnionFaces.cxx
b/src/BlockFix/BlockFix_UnionFaces.cxx
index 838b8a8ee946efd99707e6e76139c8769c667a43..9a42dde438bf06ce2564a6677921f0583ed78f5d 100644
(file)
--- a/
src/BlockFix/BlockFix_UnionFaces.cxx
+++ b/
src/BlockFix/BlockFix_UnionFaces.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
4
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
6
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
//
// 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 <BlockFix_UnionFaces.hxx>
-#include <Basics_OCCTVersion.hxx>
-
#include <ShapeAnalysis_WireOrder.hxx>
#include <ShapeAnalysis_Edge.hxx>
#include <ShapeAnalysis_WireOrder.hxx>
#include <ShapeAnalysis_Edge.hxx>
@@
-44,11
+42,7
@@
#include <ShapeFix_Wire.hxx>
#include <ShapeFix_Edge.hxx>
#include <ShapeFix_Wire.hxx>
#include <ShapeFix_Edge.hxx>
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
#include <IntPatch_ImpImpIntersection.hxx>
#include <IntPatch_ImpImpIntersection.hxx>
-#else
-#include <IntPatch_TheIIIntOfIntersection.hxx>
-#endif
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRep_Builder.hxx>
@@
-131,7
+125,7
@@
Standard_Integer& BlockFix_UnionFaces::GetOptimumNbFaces()
//=======================================================================
//function : AddOrdinaryEdges
//=======================================================================
//function : AddOrdinaryEdges
-//purpose : auxilary
+//purpose : auxil
i
ary
// adds edges from the shape to the sequence
// seams and equal edges are dropped
// Returns true if one of original edges dropped
// adds edges from the shape to the sequence
// seams and equal edges are dropped
// Returns true if one of original edges dropped
@@
-142,8
+136,9
@@
static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges,
{
//map of edges
TopTools_MapOfShape aNewEdges;
{
//map of edges
TopTools_MapOfShape aNewEdges;
+ TopExp_Explorer exp(aShape,TopAbs_EDGE);
//add edges without seams
//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);
TopoDS_Shape edge = exp.Current();
if(aNewEdges.Contains(edge))
aNewEdges.Remove(edge);
@@
-168,16
+163,21
@@
static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges,
}
}
}
}
- //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
return isDropped;
}
//=======================================================================
//function : ClearRts
-//purpose : auxilary
+//purpose : auxil
i
ary
//=======================================================================
static Handle(Geom_Surface) ClearRts(const Handle(Geom_Surface)& aSurface)
{
//=======================================================================
static Handle(Geom_Surface) ClearRts(const Handle(Geom_Surface)& aSurface)
{
@@
-191,7
+191,7
@@
static Handle(Geom_Surface) ClearRts(const Handle(Geom_Surface)& aSurface)
//=======================================================================
//function : IsFacesOfSameSolids
//=======================================================================
//function : IsFacesOfSameSolids
-//purpose : auxilary
+//purpose : auxil
i
ary
//=======================================================================
static Standard_Boolean IsFacesOfSameSolids
(const TopoDS_Face &theFace1,
//=======================================================================
static Standard_Boolean IsFacesOfSameSolids
(const TopoDS_Face &theFace1,
@@
-591,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()) {
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
}
}
} // end processing each solid
@@
-703,15
+706,10
@@
Standard_Boolean BlockFix_UnionFaces::IsSameDomain(const TopoDS_Face& aFace,
Handle(BRepTopAdaptor_TopolTool) aTT2 = new BRepTopAdaptor_TopolTool();
try {
Handle(BRepTopAdaptor_TopolTool) aTT2 = new BRepTopAdaptor_TopolTool();
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
OCC_CATCH_SIGNALS;
-#endif
-#if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
IntPatch_ImpImpIntersection anIIInt (aGA1, aTT1, aGA2, aTT2, aPrec, aPrec);
IntPatch_ImpImpIntersection anIIInt (aGA1, aTT1, aGA2, aTT2, aPrec, aPrec);
-#else
- IntPatch_TheIIIntOfIntersection anIIInt (aGA1, aTT1, aGA2, aTT2, aPrec, aPrec);
-#endif
+
if (!anIIInt.IsDone() || anIIInt.IsEmpty())
return false;
if (!anIIInt.IsDone() || anIIInt.IsEmpty())
return false;