]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/PartSet/PartSet_Module.cpp
Salome HOME
Issue #2206 Avoid the ability to cancel the current sketch when saving,
[modules/shaper.git] / src / PartSet / PartSet_Module.cpp
index 5dc11364e32d6cd5496a910e7d54dbd0ecd92df3..078b18236f5a8c41be1d78d75f7890ca4e176f0d 100755 (executable)
@@ -37,7 +37,6 @@
 #include "PartSet_MenuMgr.h"
 #include "PartSet_CustomPrs.h"
 #include "PartSet_IconFactory.h"
-#include "PartSet_WidgetChoice.h"
 #include "PartSet_OverconstraintListener.h"
 
 #include "PartSet_Filters.h"
@@ -52,6 +51,7 @@
 #include <ModuleBase_IViewer.h>
 #include <ModuleBase_IViewWindow.h>
 #include <ModuleBase_IPropertyPanel.h>
+#include <ModuleBase_WidgetChoice.h>
 #include <ModuleBase_WidgetEditor.h>
 #include <ModuleBase_WidgetValidated.h>
 #include <ModuleBase_Tools.h>
@@ -185,6 +185,9 @@ PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
   Config_PropManager::registerProp("Visualization", "operation_remove_feature_color",
                           "Color of removed feature in operation", Config_Prop::Color,
                           PartSet_CustomPrs::OPERATION_REMOVE_FEATURE_COLOR());
+  Config_PropManager::registerProp("Visualization", "sketch_preview_plane",
+                          "Color of sketch plane", Config_Prop::Color,
+                          PartSet_CustomPrs::OPERATION_SKETCH_PLANE());
 }
 
 PartSet_Module::~PartSet_Module()
@@ -547,6 +550,12 @@ void PartSet_Module::updateViewerMenu(const QMap<QString, QAction*>& theStdActio
   myMenuMgr->updateViewerMenu(theStdActions);
 }
 
+void PartSet_Module::updateOperationByUndoRedo()
+{
+  PartSet_SketcherMgr* aSketchMgr = sketchMgr();
+  aSketchMgr->previewSketchPlane()->updatePlaneSize(aSketchMgr->activeSketch(), workshop());
+}
+
 bool PartSet_Module::isActionEnableStateFixed(const int theActionId) const
 {
   bool isEnabledFixed = false;
@@ -789,7 +798,7 @@ ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& th
   } else if (theType == "sketch_launcher") {
     aWgt = new PartSet_WidgetSketchCreator(theParent, this, theWidgetApi);
   } else if (theType == "module_choice") {
-    aWgt = new PartSet_WidgetChoice(theParent, theWidgetApi);
+    aWgt = new ModuleBase_WidgetChoice(theParent, theWidgetApi);
     connect(aWgt, SIGNAL(itemSelected(ModuleBase_ModelWidget*, int)),
             this, SLOT(onChoiceChanged(ModuleBase_ModelWidget*, int)));
   }
@@ -1472,7 +1481,7 @@ void PartSet_Module::setReentrantPreSelection(const std::shared_ptr<Events_Messa
 void PartSet_Module::onChoiceChanged(ModuleBase_ModelWidget* theWidget,
                                      int theIndex)
 {
-  PartSet_WidgetChoice* aChoiceWidget = dynamic_cast<PartSet_WidgetChoice*>(theWidget);
+  ModuleBase_WidgetChoice* aChoiceWidget = dynamic_cast<ModuleBase_WidgetChoice*>(theWidget);
   if (!aChoiceWidget)
     return;