]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #249 : hide sketcher on Apply of extrusion based on it
authormpv <mikhail.ponikarov@opencascade.com>
Tue, 11 Nov 2014 12:51:36 +0000 (15:51 +0300)
committermpv <mikhail.ponikarov@opencascade.com>
Tue, 11 Nov 2014 12:51:36 +0000 (15:51 +0300)
src/Model/Model_Update.cpp

index cb511c8e3773c1c75ca25310bc84f2ac6e60fdf4..910527bb2702fdc4d93185b0fb557870d5c76b17 100644 (file)
@@ -91,6 +91,23 @@ void Model_Update::processEvent(const boost::shared_ptr<Events_Message>& theMess
       isAutomaticChanged = true;
       isAutomatic = true;
     }
+    // the hardcode (DBC asked): hide the sketch referenced by extrusion on apply
+    if (theMessage->eventID() == kOpFinishEvent) {
+      std::set<boost::shared_ptr<ModelAPI_Object> >::iterator aFIter;
+      for(aFIter = myJustCreatedOrUpdated.begin(); aFIter != myJustCreatedOrUpdated.end(); aFIter++)
+      {
+        FeaturePtr aF = boost::dynamic_pointer_cast<ModelAPI_Feature>(*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)