From d98c9ab081eb1d1c4e8865584d51fce6b6293a06 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 17 Nov 2015 08:20:00 +0300 Subject: [PATCH] Bug: sketch, closed controur, group, selection of edge. The result is that all edges on the sketch are selected. Reason: sketch manager is performed for the Group feature. --- src/PartSet/PartSet_SketcherMgr.cpp | 13 +++++++++++-- src/PartSet/PartSet_SketcherMgr.h | 5 +++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index 5accebfb8..dcdd6ecc6 100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -271,7 +271,8 @@ void PartSet_SketcherMgr::onLeaveViewPort() void PartSet_SketcherMgr::onBeforeValuesChangedInPropertyPanel() { - if (isNestedCreateOperation(getCurrentOperation())) + if (!isNestedEditOperation(getCurrentOperation()) || + myModule->sketchReentranceMgr()->isInternalEditActive()) return; // it is necessary to save current selection in order to restore it after the values are modifed storeSelection(); @@ -284,7 +285,8 @@ void PartSet_SketcherMgr::onBeforeValuesChangedInPropertyPanel() void PartSet_SketcherMgr::onAfterValuesChangedInPropertyPanel() { - if (isNestedCreateOperation(getCurrentOperation())) + if (!isNestedEditOperation(getCurrentOperation()) || + myModule->sketchReentranceMgr()->isInternalEditActive()) return; // it is necessary to restore current selection in order to restore it after the values are modified restoreSelection(); @@ -767,6 +769,13 @@ bool PartSet_SketcherMgr::isNestedCreateOperation(ModuleBase_Operation* theOpera return aFOperation && !aFOperation->isEditOperation() && isNestedSketchOperation(aFOperation); } +bool PartSet_SketcherMgr::isNestedEditOperation(ModuleBase_Operation* theOperation) +{ + ModuleBase_OperationFeature* aFOperation = dynamic_cast + (theOperation); + return aFOperation && aFOperation->isEditOperation() && isNestedSketchOperation(aFOperation); +} + bool PartSet_SketcherMgr::isEntity(const std::string& theId) { return (theId == SketchPlugin_Line::ID()) || diff --git a/src/PartSet/PartSet_SketcherMgr.h b/src/PartSet/PartSet_SketcherMgr.h index 3b3280152..284d2b316 100644 --- a/src/PartSet/PartSet_SketcherMgr.h +++ b/src/PartSet/PartSet_SketcherMgr.h @@ -94,6 +94,11 @@ public: //// \return boolean value static bool isNestedCreateOperation(ModuleBase_Operation* theOperation); + /// Returns true if the operation is an edit nested feature one + /// \param theOperation a checked operation + //// \return boolean value + static bool isNestedEditOperation(ModuleBase_Operation* theOperation); + /// Returns whether the current operation is a sketch entity - line, point, arc or circle /// \param theId is an id of object /// \return a boolean value -- 2.39.2