1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +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

@@ -203,31 +203,6 @@ static TopoDS_Vertex UpdateClosedEdge(const TopoDS_Edge& E,
return VRes;
}
//=======================================================================
//function : RemoveFromMVE
//purpose :
//=======================================================================
static void RemoveFromMVE(TopTools_IndexedDataMapOfShapeListOfShape& MVE,
const TopoDS_Shape& theVertex)
{
// remove from the indexed data map by substituting last item instead of removed
Standard_Integer iV = MVE.FindIndex(theVertex);
if (iV > 0)
{
Standard_Integer iLast = MVE.Extent();
if (iV == iLast)
MVE.RemoveLast();
else
{
TopoDS_Shape aVertex = MVE.FindKey(iLast);
TopTools_ListOfShape anEdges = MVE(iLast);
MVE.RemoveLast();
MVE.Substitute(iV, aVertex, anEdges);
}
}
}
//=======================================================================
//function : RemovePendingEdges
//purpose :
@@ -267,7 +242,7 @@ static void RemovePendingEdges(TopTools_IndexedDataMapOfShapeListOfShape& MVE)
if (!VToRemove.IsEmpty()) {
YaSupress = Standard_True;
for (itl.Initialize(VToRemove); itl.More(); itl.Next()) {
RemoveFromMVE(MVE, itl.Value());
MVE.RemoveKey(itl.Value());
}
if (!EToRemove.IsEmpty()) {
for (Standard_Integer iV = 1; iV <= MVE.Extent(); iV++) {
@@ -667,7 +642,7 @@ void BRepAlgo_Loop::Perform()
if (!End) {
CE = NE;
if (MVE.FindFromKey(CV).IsEmpty())
RemoveFromMVE(MVE, CV);
MVE.RemoveKey(CV);
}
}
}