]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Merge remote-tracking branch 'remotes/origin/master' into SolveSpace
authorazv <azv@opencascade.com>
Thu, 22 May 2014 07:34:31 +0000 (11:34 +0400)
committerazv <azv@opencascade.com>
Thu, 22 May 2014 07:34:31 +0000 (11:34 +0400)
1  2 
src/Model/Model_Document.cpp
src/PartSet/PartSet_OperationSketchBase.cpp
src/XGUI/XGUI_Workshop.cpp

Simple merge
index a417021195f3fe1cb73f514dc413c536ecef6d42,8504e153177b2c6a40890ef8c50fe3344712619f..d095b1cb4c35a3dfb97e05a8191b3a0f7a55b7d8
@@@ -716,17 -747,25 +747,25 @@@ void XGUI_Workshop::activatePart(Featur
  }
  
  //**************************************************************
- void XGUI_Workshop::activatePart(bool toActivate)
+ void XGUI_Workshop::activateLastPart()
  {
-   if (toActivate) {
-     QFeatureList aFeatures = mySelector->selectedFeatures();
-     if (aFeatures.size() > 0) {
-       changeCurrentDocument(aFeatures.first());
-       myObjectBrowser->activateCurrentPart(true);
+   PluginManagerPtr aMgr = ModelAPI_PluginManager::get();
+   DocumentPtr aDoc = aMgr->rootDocument();
+   FeaturePtr aLastPart = aDoc->feature(PARTS_GROUP, aDoc->size(PARTS_GROUP) - 1, true);
+   activatePart(aLastPart);
+ }
+ //**************************************************************
+ void XGUI_Workshop::deleteFeatures(QFeatureList theList)
+ {
+   QMainWindow* aDesktop = isSalomeMode()? salomeConnector()->desktop() : myMainWindow;
+   QMessageBox::StandardButton aRes = QMessageBox::warning(aDesktop, tr("Delete features"), 
+                                                           tr("Seleted features will be deleted. Continue?"), 
+                                                           QMessageBox::No | QMessageBox::Yes, QMessageBox::No);
+   if (aRes == QMessageBox::Yes) {
+     foreach (FeaturePtr aFeature, theList) {
+       DocumentPtr aDoc = aFeature->data()->docRef("PartDocument")->value();
+       aDoc->removeFeature(aFeature);
      }
-   } else {
-     changeCurrentDocument(FeaturePtr());
-     myObjectBrowser->activateCurrentPart(false);
    }
 -}
 +}