From 363f70c6b79853f37aea293416c9fa972056754a Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 20 Aug 2018 09:22:27 +0300 Subject: [PATCH] Make extrusions features correctly eat as a base a whole sketch feature selection. --- src/Model/Model_AttributeSelection.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Model/Model_AttributeSelection.cpp b/src/Model/Model_AttributeSelection.cpp index 847380c44..9d9fbb97b 100644 --- a/src/Model/Model_AttributeSelection.cpp +++ b/src/Model/Model_AttributeSelection.cpp @@ -353,20 +353,22 @@ std::shared_ptr Model_AttributeSelection::internalValue(CenterTyp if (aConstr->isInfinite()) return aResult; // empty result } - // whole feature - FeaturePtr aFeature = contextFeature(); - if (aFeature.get()) { - std::list allShapes; - std::list::const_iterator aRes = aFeature->results().cbegin(); - for (; aRes != aFeature->results().cend(); aRes++) { - if (aRes->get() && !(*aRes)->isDisabled()) { - GeomShapePtr aShape = (*aRes)->shape(); - if (aShape.get() && !aShape->isNull()) { - allShapes.push_back(aShape); + if (!aConstr.get()) { // for construction context, return empty result as usual even + // the whole feature is selected + FeaturePtr aFeature = contextFeature(); + if (aFeature.get()) { + std::list allShapes; + std::list::const_iterator aRes = aFeature->results().cbegin(); + for (; aRes != aFeature->results().cend(); aRes++) { + if (aRes->get() && !(*aRes)->isDisabled()) { + GeomShapePtr aShape = (*aRes)->shape(); + if (aShape.get() && !aShape->isNull()) { + allShapes.push_back(aShape); + } } } + return GeomAlgoAPI_CompoundBuilder::compound(allShapes); } - return GeomAlgoAPI_CompoundBuilder::compound(allShapes); } Handle(TNaming_NamedShape) aSelection; -- 2.39.2