1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0028782: Shape sewing behavior not consistent for the same CAD file

Get rid of iterations on maps with shape key by replacing simple maps with indexed maps. So iteration is done on integer key.

The map containers have been updated to insert into them type definitions of key and value.

The new methods RemoveKey() and RemoveFromIndex() have been added to indexed [data] map to be able to remove an arbitrary key from the map.

All the code in OCCT has been updated where RemoveLast() and Substitute() methods were used to remove a key from indexed [data] map.
This commit is contained in:
msv
2017-05-25 17:02:07 +03:00
committed by bugmaster
parent 58e5d30edc
commit 3f5aa017e7
16 changed files with 268 additions and 321 deletions

View File

@@ -186,14 +186,7 @@ static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges,
for(TopExp_Explorer exp(aShape,TopAbs_EDGE); exp.More(); exp.Next()) {
TopoDS_Shape edge = exp.Current();
if(aNewEdges.Contains(edge))
{
//aNewEdges.Remove(edge);
TopoDS_Shape LastEdge = aNewEdges(aNewEdges.Extent());
aNewEdges.RemoveLast();
if (aNewEdges.FindIndex(edge) != 0)
aNewEdges.Substitute(aNewEdges.FindIndex(edge), LastEdge);
/////////////////////////
}
aNewEdges.RemoveKey(edge);
else
aNewEdges.Add(edge);
}
@@ -205,12 +198,7 @@ static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges,
TopoDS_Shape current = edges(i);
if(aNewEdges.Contains(current)) {
//aNewEdges.Remove(current);
TopoDS_Shape LastEdge = aNewEdges(aNewEdges.Extent());
aNewEdges.RemoveLast();
if (aNewEdges.FindIndex(current) != 0)
aNewEdges.Substitute(aNewEdges.FindIndex(current), LastEdge);
/////////////////////////
aNewEdges.RemoveKey(current);
edges.Remove(i);
i--;