]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #231 Deletion of a feature
authornds <natalia.donis@opencascade.com>
Wed, 14 Jan 2015 12:00:24 +0000 (15:00 +0300)
committersbh <sergey.belash@opencascade.com>
Fri, 30 Jan 2015 08:22:25 +0000 (11:22 +0300)
src/XGUI/XGUI_ContextMenuMgr.cpp

index dcde2a6b592a2bc710f42505b8e96983b26fd3d7..8a794d7810522816e25eb11140ccafa87fe4a25b 100644 (file)
@@ -243,6 +243,24 @@ void XGUI_ContextMenuMgr::addViewerItems(QMenu* theMenu) const
       aSubMenu->addActions(aMDI->actions());
     }
   }
+
+  aObjects.clear();
+  aObjects = aSelMgr->selection()->selectedPresentations();
+  if (aObjects.size() > 0) {
+    bool hasFeature = true;//false;
+    foreach(ObjectPtr aObject, aObjects)
+    {
+      ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObject);
+      if (aRes) {
+        hasFeature = true;
+      }
+      //FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObject);
+      //if (aFeature)
+      //  hasFeature = true;
+    }
+    if (hasFeature)
+      theMenu->addAction(action("DELETE_CMD"));
+  }
 }
 
 void XGUI_ContextMenuMgr::connectObjectBrowser() const