+ if (theFeature->getKind() == BuildPlugin_Face::ID()) {
+ /// remove objects of sub-type if ojects of correct type is in List, in some cases :
+ /// - Face builder: edges, faces and wires selected
+ /// --> remove edges and wires
+ std::set<int> aRemove;
+ for (int anIndex = 0; anIndex < aSelectionList->size(); ++anIndex) {
+ AttributeSelectionPtr aSelection = aSelectionList->value(anIndex);
+ GeomShapePtr aShape = aSelection->value();
+ if (aShape.get()) {
+ GeomAPI_Shape::ShapeType aType = aShape->shapeType();
+ if (aType == GeomAPI_Shape::FACE) {
+ // Check for wires
+ GeomAPI_ShapeExplorer anWireExp(aShape, GeomAPI_Shape::WIRE);
+ for (; anWireExp.more(); anWireExp.next()) {
+ GeomShapePtr aWire = anWireExp.current();
+ for (int i = 0; i < aSelectionList->size(); ++i) {
+ AttributeSelectionPtr aSel = aSelectionList->value(i);
+ GeomShapePtr aShp = aSel->value();
+ if (aShp.get()) {
+ if (aShp->shapeType() == GeomAPI_Shape::WIRE) {
+ if (aShp->isEqual(aWire) || aShp->isSameGeometry(aWire))
+ aRemove.insert(i);
+ }
+ }
+ else {
+ aRemove.insert(anIndex);
+ }
+ }
+ }
+
+ // check for edges
+ GeomAPI_ShapeExplorer anEdgeExp(aShape, GeomAPI_Shape::EDGE);
+ for (; anEdgeExp.more(); anEdgeExp.next()) {
+ GeomShapePtr aEdge = anEdgeExp.current();
+ for (int i = 0; i < aSelectionList->size(); ++i) {
+ AttributeSelectionPtr aSel = aSelectionList->value(i);
+ GeomShapePtr aShp = aSel->value();
+ if (aShp.get()) {
+ if (aShp->shapeType() == GeomAPI_Shape::EDGE) {
+ if (aShp->isEqual(aEdge) || aShp->isSameGeometry(aEdge))
+ aRemove.insert(i);
+ }
+ }
+ else {
+ aRemove.insert(anIndex);
+ }
+ }
+ }
+ }
+ }
+ }
+ if (aRemove.size() > 0)
+ aSelectionList->remove(aRemove);
+ }