From 87fdf957d34be6d26791d8d8096f25d7e6d0990b Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 11 Nov 2014 15:51:36 +0300 Subject: [PATCH] Issue #249 : hide sketcher on Apply of extrusion based on it --- src/Model/Model_Update.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Model/Model_Update.cpp b/src/Model/Model_Update.cpp index cb511c8e3..910527bb2 100644 --- a/src/Model/Model_Update.cpp +++ b/src/Model/Model_Update.cpp @@ -91,6 +91,23 @@ void Model_Update::processEvent(const boost::shared_ptr& theMess isAutomaticChanged = true; isAutomatic = true; } + // the hardcode (DBC asked): hide the sketch referenced by extrusion on apply + if (theMessage->eventID() == kOpFinishEvent) { + std::set >::iterator aFIter; + for(aFIter = myJustCreatedOrUpdated.begin(); aFIter != myJustCreatedOrUpdated.end(); aFIter++) + { + FeaturePtr aF = boost::dynamic_pointer_cast(*aFIter); + if (aF && aF->getKind() == "Extrusion") { + if (aF->selection("extrusion_face")) { + ResultPtr aSketchRes = aF->selection("extrusion_face")->context(); + if (aSketchRes) { + static Events_ID HIDE_DISP = Events_Loop::loop()->eventByName(EVENT_OBJECT_TOHIDE); + ModelAPI_EventCreator::get()->sendUpdated(aSketchRes, HIDE_DISP); + } + } + } + } + } } if (isExecuted) -- 2.39.2