Salome HOME
Fix the Linux compilation problem
[modules/shaper.git] / src / PartSet / PartSet_Module.cpp
index 6a7977835fd2c195ecaf4046baaccb8246ed5b13..9b380a839de031128e1b0311af90b67a7373f389 100755 (executable)
@@ -18,6 +18,7 @@
 #include "PartSet_MenuMgr.h"
 #include "PartSet_CustomPrs.h"
 #include "PartSet_IconFactory.h"
+#include "PartSet_WidgetChoice.h"
 
 #include "PartSet_Filters.h"
 #include "PartSet_FilterInfinite.h"
@@ -36,7 +37,6 @@
 #include <ModuleBase_FilterFactory.h>
 #include <ModuleBase_Tools.h>
 #include <ModuleBase_OperationFeature.h>
-#include <ModuleBase_WidgetTable.h>
 
 #include <ModelAPI_Object.h>
 #include <ModelAPI_Events.h>
@@ -374,11 +374,11 @@ void PartSet_Module::updateViewerMenu(const QMap<QString, QAction*>& theStdActio
   myMenuMgr->updateViewerMenu(theStdActions);
 }
 
-QString PartSet_Module::getFeatureError(const FeaturePtr& theFeature, const bool isCheckGUI)
+QString PartSet_Module::getFeatureError(const FeaturePtr& theFeature)
 {
-  QString anError = ModuleBase_IModule::getFeatureError(theFeature, isCheckGUI);
+  QString anError = ModuleBase_IModule::getFeatureError(theFeature);
   if (anError.isEmpty())
-    anError = sketchMgr()->getFeatureError(theFeature, isCheckGUI);
+    anError = sketchMgr()->getFeatureError(theFeature);
 
   return anError;
 }
@@ -512,10 +512,7 @@ ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& th
     aPointWgt->setSketch(mySketchMgr->activeSketch());
     connect(aPointWgt, SIGNAL(vertexSelected()), sketchReentranceMgr(), SLOT(onVertexSelected()));
     aWgt = aPointWgt;
-  }
-  else if (theType == "tablevalue") {
-    aWgt = new ModuleBase_WidgetTable(theParent, theWidgetApi, theParentId);
-  }else if (theType == "sketch-2dpoint_flyout_selector") {
+  } else if (theType == "sketch-2dpoint_flyout_selector") {
     PartSet_WidgetPoint2DFlyout* aPointWgt = new PartSet_WidgetPoint2DFlyout(theParent, aWorkshop,
                                                                  theWidgetApi, theParentId);
     aPointWgt->setSketch(mySketchMgr->activeSketch());
@@ -547,6 +544,9 @@ ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& th
     aWgt = new PartSet_WidgetFileSelector(theParent, aWorkshop, theWidgetApi, theParentId);
   } else if (theType == "sketch_launcher") {
     aWgt = new PartSet_WidgetSketchCreator(theParent, this, theWidgetApi, theParentId);
+  } else if (theType == "module_choice") {
+    aWgt = new PartSet_WidgetChoice(theParent, theWidgetApi, theParentId);
+    connect(aWgt, SIGNAL(itemSelected(int)), SLOT(onBooleanOperationChange(int)));
   }
   return aWgt;
 }
@@ -1023,3 +1023,24 @@ bool PartSet_Module::processEnter(const std::string& thePreviousAttributeID)
 {
   return mySketchReentrantMgr->processEnter(thePreviousAttributeID);
 }
+
+
+//******************************************************
+void PartSet_Module::onBooleanOperationChange(int theOperation)
+{
+  ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
+  if (!aOperation)
+    return;
+  ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
+  switch (theOperation) {
+  case 0:
+    aPanel->setWindowTitle(tr("Cut"));
+    break;
+  case 1:
+    aPanel->setWindowTitle(tr("Fuse"));
+    break;
+  case 2:
+    aPanel->setWindowTitle(tr("Common"));
+    break;
+  }
+}