1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +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:
mpa
2017-03-03 13:57:36 +03:00
committed by mkv
parent 4d597f3e2f
commit f1191d3099
13 changed files with 93 additions and 241 deletions

View File

@@ -1134,11 +1134,7 @@ static void CheckSharedVertices(const TopTools_SequenceOfShape& theSeqEdges,
for (Standard_Integer k = 1; k <= SeqVertexes.Length()/* && !IsSharedVertexPresent*/; k++ )
{
const TopTools_ListOfShape& ListEdgesV1 = theMapEdgesVertex.FindFromKey(SeqVertexes(k));
TopTools_MapOfShape aMapOfEdges;
TopTools_ListIteratorOfListOfShape iter(ListEdgesV1);
for (; iter.More(); iter.Next())
aMapOfEdges.Add(iter.Value());
if (aMapOfEdges.Extent() > 2 || theMapKeepShape.Contains(SeqVertexes(k)))
if (ListEdgesV1.Extent() > 2 || theMapKeepShape.Contains(SeqVertexes(k)))
theShareVertMap.Add(SeqVertexes(k));
}
//return theShareVertMap.IsEmpty() ? false : true;
@@ -1832,7 +1828,7 @@ void ShapeUpgrade_UnifySameDomain::UnifyEdges()
// creating map of vertex edges
TopTools_IndexedDataMapOfShapeListOfShape aMapEdgesVertex;
TopExp::MapShapesAndAncestors(myShape, TopAbs_VERTEX, TopAbs_EDGE, aMapEdgesVertex);
TopExp::MapShapesAndUniqueAncestors(myShape, TopAbs_VERTEX, TopAbs_EDGE, aMapEdgesVertex);
//Handle(ShapeBuild_ReShape) aContext = new ShapeBuild_ReShape;
TopoDS_Shape aRes = myShape;