]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Activation objects redesign : widgetActivated should not be processed in ReentrantMan...
authornds <nds@opencascade.com>
Wed, 13 Dec 2017 06:24:45 +0000 (09:24 +0300)
committernds <nds@opencascade.com>
Wed, 13 Dec 2017 06:24:45 +0000 (09:24 +0300)
src/ModuleBase/ModuleBase_IPropertyPanel.h
src/PartSet/PartSet_SketcherMgr.cpp
src/PartSet/PartSet_SketcherReentrantMgr.cpp
src/PartSet/PartSet_SketcherReentrantMgr.h
src/XGUI/XGUI_PropertyPanel.cpp
src/XGUI/XGUI_PropertyPanel.h
src/XGUI/XGUI_SelectionActivate.cpp
src/XGUI/XGUI_SelectionActivate.h

index e2b1010ac167448905bd116c3c781c33b6ba9a70..446e0e59bb44c35bdfa67c983e6d51060787cc86 100644 (file)
@@ -100,7 +100,7 @@ signals:
 
   /// The signal about the widget activation
   /// \param theWidget the activated widget
-  void widgetActivated(ModuleBase_ModelWidget* theWidget);
+  //void widgetActivated(ModuleBase_ModelWidget* theWidget);
 
   /// Emited when there is no next widget
   /// \param thePreviousAttributeID an attribute key of the previous active widget
@@ -117,7 +117,6 @@ public slots:
   /**
   * Makes the given widget active, highlights it and removes
   * highlighting from the previous active widget
-  * emits widgetActivated(theWidget) signal
   * \param theWidget which has to be activated
   * \param theEmitSignal a flag to prohibit signal emit
   */
index 01ec24d19aba31007f3996985eb26db022d1e0a6..657d140755222f37198db290330151bc396f7a8f 100755 (executable)
@@ -673,8 +673,8 @@ void PartSet_SketcherMgr::onApplicationStarted()
 
     connect(aPropertyPanel, SIGNAL(noMoreWidgets(const std::string&)),
             aReentranceMgr, SLOT(onNoMoreWidgets(const std::string&)));
-    connect(aPropertyPanel, SIGNAL(widgetActivated(ModuleBase_ModelWidget*)),
-            aReentranceMgr, SLOT(onWidgetActivated()));
+    //connect(aPropertyPanel, SIGNAL(widgetActivated(ModuleBase_ModelWidget*)),
+    //        aReentranceMgr, SLOT(onWidgetActivated()));
   }
 
   XGUI_ViewerProxy* aViewerProxy = aWorkshop->viewer();
index 95ca672cd15e04c0edbc247859c22990dca23828..0e4aebf79659148efb77fa162fe1e4e4f941771d 100644 (file)
@@ -322,23 +322,23 @@ void PartSet_SketcherReentrantMgr::setReentrantPreSelection(
   aReentrantMessage->setClickedPoint(myClickedSketchPoint);
 }
 
-void PartSet_SketcherReentrantMgr::onWidgetActivated()
-{
-  if (!isActiveMgr())
-    return;
-  if (!myIsInternalEditOperation)
-    return;
-
-  PartSet_Module* aModule = module();
-  ModuleBase_ModelWidget* aFirstWidget = aModule->activeWidget();
-  ModuleBase_IPropertyPanel* aPanel = aModule->currentOperation()->propertyPanel();
-  if (aFirstWidget != aPanel->activeWidget()) {
-    ModuleBase_WidgetSelector* aWSelector = dynamic_cast<ModuleBase_WidgetSelector*>(aFirstWidget);
-    if (aWSelector) {
-      myWorkshop->selectionActivate()->activateSelectionAndFilters(aWSelector);
-    }
-  }
-}
+//void PartSet_SketcherReentrantMgr::onWidgetActivated()
+//{
+//  if (!isActiveMgr())
+//    return;
+//  if (!myIsInternalEditOperation)
+//    return;
+//
+//  PartSet_Module* aModule = module();
+//  ModuleBase_ModelWidget* aFirstWidget = aModule->activeWidget();
+//  ModuleBase_IPropertyPanel* aPanel = aModule->currentOperation()->propertyPanel();
+//  if (aFirstWidget != aPanel->activeWidget()) {
+//    ModuleBase_WidgetSelector* aWSelector = dynamic_cast<ModuleBase_WidgetSelector*>(aFirstWidget);
+//    if (aWSelector) {
+//      myWorkshop->selectionActivate()->activateSelectionAndFilters(aWSelector);
+//    }
+//  }
+//}
 
 void PartSet_SketcherReentrantMgr::onNoMoreWidgets(const std::string& thePreviousAttributeID)
 {
@@ -504,7 +504,7 @@ bool PartSet_SketcherReentrantMgr::startInternalEdit(const std::string& thePrevi
     connect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped()));
 
     // activate selection filters of the first widget in the viewer
-    onWidgetActivated();
+    //onWidgetActivated();
 
     // activate the last active widget in the Property Panel
     if (!thePreviousAttributeID.empty()) {
index 7a7b26c46a901190d92337775160258b89a3dfe9..073b534e8437138f85acb0033f3ee1a4ca9ed9da 100644 (file)
@@ -139,7 +139,7 @@ public:
 private slots:
   /// SLOT, that is called by a widget activating in the property panel
   /// If the 'internal' edit operation is started, it activates the first widget selection
-  void onWidgetActivated();
+  //void onWidgetActivated();
 
   /// SLOT, that is called by no more widget signal emitted by property panel
   /// Start an internal edit operation or, if the internal flag is forbided, commits
index f2531ef37c684dde33ecd43e2e710594bd759ad8..e46ab2d5b6635ff276adab1a34ffc73cea16dd35 100755 (executable)
@@ -494,7 +494,7 @@ bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget, cons
   Events_Loop::loop()->flush(anEvent);
 
   if (isEmitSignal) {
-    emit widgetActivated(myActiveWidget);
+    //emit widgetActivated(myActiveWidget);
     if (!myActiveWidget && !isEditingMode()) {
       emit noMoreWidgets(aPreviosAttributeID);
     }
index fe16ed11529cb4ac619a22bc50cf8410bb1fa3ab..e8b7082c9e81b2a5f54b81b9479a2d3a390d53ec 100644 (file)
@@ -143,7 +143,6 @@ public slots:
   /**
   * Makes the given widget active, highlights it and removes
   * highlighting from the previous active widget
-  * emits widgetActivated(theWidget) signal
   * \param theWidget which has to be activated
   * \param theEmitSignal a flag to prohibit signal emit
   */
index 13a67569d46e704b05152135725db7f48069bdfb..9b8d2a5d579a5b7dcb8e5df8bd9c32738b4ae317 100644 (file)
@@ -120,20 +120,6 @@ void XGUI_SelectionActivate::updateSelectionFilters()
   activateSelectionFilters(aSelectionFilters);
 }
 
-//**************************************************************
-void XGUI_SelectionActivate::activateSelectionAndFilters(ModuleBase_ModelWidget* theWidget)
-{
-  // activate selection modes
-  QIntList aModes;
-  getSelectionModes(theWidget, aModes);
-  activateObjects(aModes, getDisplayer()->displayedObjects(), true);
-
-  // activate selection filters
-  SelectMgr_ListOfFilter aSelectionFilters;
-  getSelectionFilters(theWidget, aSelectionFilters);
-  activateSelectionFilters(aSelectionFilters);
-}
-
 //**************************************************************
 void XGUI_SelectionActivate::activateSelectionFilters
   (const SelectMgr_ListOfFilter& theSelectionFilters)
@@ -150,6 +136,20 @@ void XGUI_SelectionActivate::activateSelectionFilters
   }
 }
 
+//**************************************************************
+void XGUI_SelectionActivate::activateSelectionAndFilters(ModuleBase_ModelWidget* theWidget)
+{
+  // activate selection modes
+  QIntList aModes;
+  getSelectionModes(theWidget, aModes);
+  activateObjects(aModes, getDisplayer()->displayedObjects(), true);
+
+  // activate selection filters
+  SelectMgr_ListOfFilter aSelectionFilters;
+  getSelectionFilters(theWidget, aSelectionFilters);
+  activateSelectionFilters(aSelectionFilters);
+}
+
 //**************************************************************
 void XGUI_SelectionActivate::getSelectionModes(ModuleBase_ModelWidget* theWidget,
                                                QIntList& theModes)
index 1c149f8167761eaeee99dfd775f90e93517e2445..9795c48d902a7cc5fcc07ae9cc42c3d05d87655f 100644 (file)
@@ -67,10 +67,6 @@ public:
   XGUI_EXPORT virtual void activateSelectionFilters
     (const SelectMgr_ListOfFilter& theSelectionFilters);
 
-  /// Activate or deactivate selection and selection filters like the widget is active
-  /// \param theWidget a source widget of selection modes/filters
-  XGUI_EXPORT virtual void activateSelectionAndFilters(ModuleBase_ModelWidget* theWidget);
-
   /// Returns list of currently active selection modes
   /// Selection modes will be returned according to TopAbs_ShapeEnum
   XGUI_EXPORT QIntList activeSelectionModes() const;
@@ -137,6 +133,10 @@ public:
   XGUI_EXPORT void deactivateTrihedronInSelectionModes();
 
 protected:
+  /// Activate or deactivate selection and selection filters like the widget is active
+  /// \param theWidget a source widget of selection modes/filters
+  virtual void activateSelectionAndFilters(ModuleBase_ModelWidget* theWidget);
+
   /// Returns selection modes of the widget
   /// \param theWidget model widget
   /// \param theModes selection modes