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:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user