int aNbSel = aSelList->size();
for (int ind = 0; ind < aNbSel; ++ind) {
AttributeSelectionPtr aCurSel = aSelList->value(ind);
- GeomShapePtr aWire = aCurSel->context()->shape();
+ GeomShapePtr aWire = aCurSel->value();
+ if (!aWire.get() && aCurSel->context().get())
+ aWire = aCurSel->context()->shape();
if (aProcessedWires.find(aWire) != aProcessedWires.end())
continue;
return false;
}
-
// keep the sequence of wires and fillet vertices stable
theWires.push_back(aWire);
for (GeomAPI_WireExplorer anExp(aWire->wire()); anExp.more(); anExp.next()) {
// LCOV_EXCL_STOP
}
+ // Validate wires selection
+ if (!theArguments.empty() &&
+ theArguments.front() == "wire") {
+ for (int ind = 0; ind < anAttrSelectionList->size(); ++ind) {
+ AttributeSelectionPtr aCurSel = anAttrSelectionList->value(ind);
+ //GeomShapePtr aContext = aCurSel->context()->shape();
+ GeomShapePtr aWire = aCurSel->value();
+ if (aWire->shapeType() != GeomAPI_Shape::WIRE) {
+ theError = "Selected shape is not a wire";
+ return false;
+ }
+ }
+ return true;
+ }
+
// check each selected vertex is a sharp corner between adjacent edges,
// and these edges are in the same plane
std::map<GeomShapePtr, MapShapeToShapes> aWireSubshapes;