From 4a056c17b0d629e17c0825c38014255dedec5c3c Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 31 Oct 2018 09:28:08 +0300 Subject: [PATCH] Redisplay sketch features only for the active sketch (on appearance of the "Fully constrained" or the "Under constrained" messages) --- src/PartSet/PartSet_OverconstraintListener.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/PartSet/PartSet_OverconstraintListener.cpp b/src/PartSet/PartSet_OverconstraintListener.cpp index f532eab04..a7480b35a 100755 --- a/src/PartSet/PartSet_OverconstraintListener.cpp +++ b/src/PartSet/PartSet_OverconstraintListener.cpp @@ -161,6 +161,18 @@ void PartSet_OverconstraintListener::processEvent( std::set aModifiedObjects; PartSet_Module* aModule = dynamic_cast(myWorkshop->module()); CompositeFeaturePtr aSketch = aModule->sketchMgr()->activeSketch(); + + // check the sketch in the message and the active sketch are the same + std::shared_ptr anErrorMsg = + std::dynamic_pointer_cast(theMessage); + if (aSketch && anErrorMsg && !anErrorMsg->objects().empty()) { + ObjectPtr anObject = *anErrorMsg->objects().begin(); + CompositeFeaturePtr aSketchFromMsg = + std::dynamic_pointer_cast(anObject); + if (!aSketchFromMsg || aSketchFromMsg != aSketch) + aSketch = CompositeFeaturePtr(); + } + if (aSketch.get()) { int aNumberOfSubs = aSketch->numberOfSubs(); for (int i = 0; i < aNumberOfSubs; i++) { -- 2.39.2