mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0026682: TopExp::MapShapesAndAncestors() will build map with duplicated ancestors.
The new method TopExp::MapShapesAndUniqueAncestors has been implemented, which excludes duplication of ancestors in the list items. The optional Boolean argument 'useOrientation' of this method points whether two same shapes with different orientation will be considered equal. OCCT code has been inspected and MapShapesAndAncestors has been replaced with MapShapesAndUniqueAncestors where it is necessary.
This commit is contained in:
@@ -192,8 +192,8 @@ void ReduceVertexTolerance (const TopoDS_Shape& aS)
|
||||
Standard_Integer i, aNbV;
|
||||
TopTools_IndexedDataMapOfShapeListOfShape aVEMap, aVFMap;
|
||||
|
||||
TopExp::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_EDGE, aVEMap);
|
||||
TopExp::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_FACE, aVFMap);
|
||||
TopExp::MapShapesAndUniqueAncestors(aS, TopAbs_VERTEX, TopAbs_EDGE, aVEMap);
|
||||
TopExp::MapShapesAndUniqueAncestors(aS, TopAbs_VERTEX, TopAbs_FACE, aVFMap);
|
||||
|
||||
aNbV=aVEMap.Extent();
|
||||
for (i=1; i<=aNbV; i++) {
|
||||
@@ -299,7 +299,6 @@ void ProcessVertex(const TopoDS_Vertex& aV,
|
||||
TopAbs_Orientation anOrV;
|
||||
|
||||
TopTools_ListIteratorOfListOfShape anIt;
|
||||
TopTools_MapOfShape aProcessedEdges;
|
||||
TopExp_Explorer aVExp;
|
||||
|
||||
BRep_ListIteratorOfListOfCurveRepresentation itcr;
|
||||
@@ -314,11 +313,6 @@ void ProcessVertex(const TopoDS_Vertex& aV,
|
||||
for (; anIt.More(); anIt.Next()) {
|
||||
const TopoDS_Edge& aE=TopoDS::Edge(anIt.Value());
|
||||
//
|
||||
if (aProcessedEdges.Contains(aE)) {
|
||||
continue;
|
||||
}
|
||||
aProcessedEdges.Add(aE);
|
||||
//
|
||||
Handle(BRep_TEdge)& TE = *((Handle(BRep_TEdge)*)&aE.TShape());
|
||||
const TopLoc_Location& Eloc = aE.Location();
|
||||
//
|
||||
@@ -395,32 +389,20 @@ void ProcessVertex(const TopoDS_Vertex& aV,
|
||||
return;
|
||||
}
|
||||
//
|
||||
aProcessedEdges.Clear();
|
||||
anIt.Initialize(aLE);
|
||||
for (; anIt.More(); anIt.Next()) {
|
||||
const TopoDS_Edge& aE=TopoDS::Edge(anIt.Value());
|
||||
|
||||
if (aProcessedEdges.Contains(aE)) {
|
||||
continue;
|
||||
}
|
||||
aProcessedEdges.Add(aE);
|
||||
|
||||
aTolE =BRep_Tool::Tolerance(aE);
|
||||
if (aTolMax2 < aTolE) {
|
||||
aTolMax2=aTolE;
|
||||
}
|
||||
}
|
||||
//
|
||||
aProcessedEdges.Clear();
|
||||
anIt.Initialize(aLF);
|
||||
for (; anIt.More(); anIt.Next()) {
|
||||
const TopoDS_Face& aF=TopoDS::Face(anIt.Value());
|
||||
|
||||
if (aProcessedEdges.Contains(aF)) {
|
||||
continue;
|
||||
}
|
||||
aProcessedEdges.Add(aF);
|
||||
|
||||
aTolE =BRep_Tool::Tolerance(aF);
|
||||
if (aTolMax2 < aTolE) {
|
||||
aTolMax2=aTolE;
|
||||
|
Reference in New Issue
Block a user