for(anIndex = 0; anIndex < aSubsToKeepNb; ++anIndex) {
AttributeSelectionPtr anAttrSelectionInList = aSubShapesToKeepAttrList->value(anIndex);
GeomShapePtr aSubShapeToKeep = anAttrSelectionInList->value();
- if (aSubShapeToKeep.get() &&
- (aSubShapeToKeep->isEqual(aSubShape) || aSubShapeToKeep->isSubShape(aSubShape))) {
+ if (aSubShapeToKeep.get() && aSubShapeToKeep->isEqual(aSubShape)) {
break;
}
}
for(anIndex = 0; anIndex < aSubsToRemoveNb; ++anIndex) {
AttributeSelectionPtr anAttrSelectionInList = aSubShapesToRemoveAttrList->value(anIndex);
GeomShapePtr aSubShapeToRemove = anAttrSelectionInList->value();
- if (aSubShapeToRemove.get() &&
- (aSubShapeToRemove->isEqual(aSubShape) || aSubShapeToRemove->isSubShape(aSubShape))) {
+ if (aSubShapeToRemove.get() && aSubShapeToRemove->isEqual(aSubShape)) {
break;
}
}
aResultShape = anAttrSelectionInList->value();
}
// deleted and copied must be jointed to one list which keeps all the history
- GeomAlgoAPI_MakeShapeList aMakeShapeList;
+ std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList());
// find all removed shapes
std::shared_ptr<GeomAlgoAPI_MakeShapeCustom> aDeletedSubs(new GeomAlgoAPI_MakeShapeCustom);
}
}
}
- aMakeShapeList.appendAlgo(aDeletedSubs);
+ aMakeShapeList->appendAlgo(aDeletedSubs);
std::shared_ptr<GeomAlgoAPI_Copy> aCopy(new GeomAlgoAPI_Copy(aResultShape));
aResultShape = aCopy->shape();
- aMakeShapeList.appendAlgo(aCopy);
+ aMakeShapeList->appendAlgo(aCopy);
if (aResultShape->shapeType() == GeomAPI_Shape::COMPOUND) {
aResultShape = GeomAlgoAPI_ShapeTools::groupSharedTopology(aResultShape);
// Store result.
ResultBodyPtr aResultBody = document()->createBody(data());
- aResultBody->storeModified(aBaseShape, aResultShape, 1);
- std::set<GeomAPI_Shape::ShapeType>::iterator aTypeIter = aTypes.begin();
- for(; aTypeIter != aTypes.end(); aTypeIter++)
- aResultBody->loadDeletedShapes(&aMakeShapeList, aBaseShape, *aTypeIter, 1);
- aResultBody->loadAndOrientModifiedShapes(&aMakeShapeList, aBaseShape, GeomAPI_Shape::FACE,
- 2, "Modified_Face", *aMakeShapeList.mapOfSubShapes().get(), true, false, true);
- aResultBody->loadAndOrientModifiedShapes(&aMakeShapeList, aBaseShape, GeomAPI_Shape::EDGE,
- 3, "Modified_Edge", *aMakeShapeList.mapOfSubShapes().get(), false, false, true);
- aResultBody->loadAndOrientModifiedShapes(&aMakeShapeList, aBaseShape, GeomAPI_Shape::VERTEX,
- 4, "Modified_Vertex", *aMakeShapeList.mapOfSubShapes().get());
+ aResultBody->storeModified(aBaseShape, aResultShape);
+ for (std::set<GeomAPI_Shape::ShapeType>::iterator aTypeIter = aTypes.begin();
+ aTypeIter != aTypes.end();
+ ++aTypeIter)
+ {
+ aResultBody->loadDeletedShapes(aMakeShapeList, aBaseShape, *aTypeIter);
+ }
+
+ aResultBody->loadModifiedShapes(aMakeShapeList,
+ aBaseShape,
+ GeomAPI_Shape::FACE);
+ aResultBody->loadModifiedShapes(aMakeShapeList,
+ aBaseShape,
+ GeomAPI_Shape::EDGE);
+ aResultBody->loadModifiedShapes(aMakeShapeList,
+ aBaseShape,
+ GeomAPI_Shape::VERTEX);
setResult(aResultBody);
}