From dc167423473ddc53d825a5807f515cee20c6bfa3 Mon Sep 17 00:00:00 2001 From: mpv Date: Fri, 25 Mar 2016 17:02:32 +0300 Subject: [PATCH] Make wires selection on sketch result updated correctly --- src/Model/Model_AttributeSelection.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 1b7f8c6eb..3291d0c1b 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -470,7 +470,7 @@ bool Model_AttributeSelection::update() return setInvalidIfFalse(aSelLab, false); } - if (aShapeType == TopAbs_FACE) { // compound is for the whole sketch selection + if (aShapeType == TopAbs_FACE || aShapeType == TopAbs_WIRE) { // compound is for the whole sketch selection // If this is a wire with plane defined thin it is a sketch-like object if (!aConstructionContext->facesNum()) // no faces, update can not work correctly return setInvalidIfFalse(aSelLab, false); @@ -548,6 +548,13 @@ bool Model_AttributeSelection::update() } } if (aNewSelected) { // store this new selection + if (aShapeType == TopAbs_WIRE) { // just get a wire from face to have wire + TopExp_Explorer aWireExp(aNewSelected->impl(), TopAbs_WIRE); + if (aWireExp.More()) { + aNewSelected.reset(new GeomAPI_Shape); + aNewSelected->setImpl(new TopoDS_Shape(aWireExp.Current())); + } + } selectConstruction(aContext, aNewSelected); owner()->data()->sendAttributeUpdated(this); return setInvalidIfFalse(aSelLab, true); -- 2.39.2