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

0028710: Implement 'BRepTools_History' history for algorithm 'ShapeUpgrade_UnifySameDomain'

'BRepTools_History' history was implemented for algorithm
'ShapeUpgrade_UnifySameDomain'.

The history of the changing of the initial shape was corrected to consider all
shapes created by the algorithm as modified shapes instead of generated ones.

The old history interface was replaced by the new one:
- to get the modified shapes use: History()->Modified();
- to check if the shapes has been deleted use: History()->IsRemoved().
This commit is contained in:
abk
2017-04-25 15:27:33 +03:00
committed by bugmaster
parent 98ffe9dfdf
commit 654c48b2b9
9 changed files with 123 additions and 238 deletions

View File

@@ -270,11 +270,10 @@ static TopoDS_Wire GetUnifiedWire(const TopoDS_Wire& theWire,
for (; wexp.More(); wexp.Next())
{
TopoDS_Shape anEdge = wexp.Current();
const TopTools_ListOfShape& aLSG = theUnifier.Generated(anEdge);
// take care of processing the result of Generated() before getting Modified()
Standard_Boolean isEmpty = aLSG.IsEmpty();
if (!isEmpty) {
TopTools_ListIteratorOfListOfShape anIt(aLSG);
const TopTools_ListOfShape& aLS = theUnifier.History()->Modified(anEdge);
if (!aLS.IsEmpty())
{
TopTools_ListIteratorOfListOfShape anIt(aLS);
for (; anIt.More(); anIt.Next()) {
const TopoDS_Shape& aShape = anIt.Value();
//wire shouldn't contain duplicated generated edges
@@ -282,12 +281,11 @@ static TopoDS_Wire GetUnifiedWire(const TopoDS_Wire& theWire,
aWMaker.Add(TopoDS::Edge(aShape));
}
}
const TopTools_ListOfShape& aLSM = theUnifier.Modified(anEdge);
if (!aLSM.IsEmpty())
aWMaker.Add(aLSM);
else if (isEmpty)
else
{
// no change, put original edge
aWMaker.Add(TopoDS::Edge(anEdge));
}
}
return aWMaker.Wire();
}