-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2022 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
}
//==================================================================================================
+#include <GeomAPI_ShapeIterator.h>
+
void GeomAlgoAPI_Sewing::modified(const std::shared_ptr<GeomAPI_Shape> theShape,
ListOfShape& theHistory)
{
- static int anIndex = 0;
if(!theShape.get()) {
return;
}
aGeomShape->setImpl(new TopoDS_Shape(anExp.Current()));
theHistory.push_back(aGeomShape);
}
+
+ if (theShape->shapeType() < GeomAPI_Shape::FACE) {
+ ListOfShape aNewShapes;
+ // collect faces and parent shapes, if it is not done yet
+ if (!isNewShapesCollected(theShape, GeomAPI_Shape::FACE))
+ collectNewShapes(theShape, GeomAPI_Shape::FACE);
+
+ for (GeomAPI_ShapeIterator anIt(shape()); anIt.more(); anIt.next()) {
+ GeomShapePtr anOldShapesCompound =
+ oldShapesForNew(theShape, anIt.current(), GeomAPI_Shape::FACE);
+ if (!anOldShapesCompound->isNull())
+ aNewShapes.push_back(anIt.current());
+ }
+
+ if (!aNewShapes.empty())
+ theHistory = aNewShapes;
+ }
}