Salome HOME
Update behavior of calculation of Multi-Rotation constraint
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetSelector.cpp
index e8acbcbfc750022fbd07bed0cbf5a7850bb42f05..e2233ab7c96229ed3866d3d88f9117bd93a94184 100755 (executable)
@@ -1,6 +1,6 @@
 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 
-// File:        ModuleBase_WidgetSelector.h
+// File:        ModuleBase_WidgetSelector.cpp
 // Created:     19 June 2015
 // Author:      Natalia ERMOLAEVA
 
 
 #include <ModelAPI_ResultConstruction.h>
 
+#include <TopoDS_Iterator.hxx>
+
 ModuleBase_WidgetSelector::ModuleBase_WidgetSelector(QWidget* theParent,
                                                      ModuleBase_IWorkshop* theWorkshop,
                                                      const Config_WidgetAPI* theData,
                                                      const std::string& theParentId)
- : ModuleBase_WidgetValidated(theParent, theData, theParentId),
-   myWorkshop(theWorkshop)
+ : ModuleBase_WidgetValidated(theParent, theWorkshop, theData, theParentId)
 {
 }
 
@@ -46,10 +47,9 @@ void ModuleBase_WidgetSelector::onSelectionChanged()
 {
   clearAttribute();
 
-  QList<ModuleBase_ViewerPrs> aSelected = myWorkshop->selection()->getSelected(
-                                                              ModuleBase_ISelection::AllControls);
-  bool isDone = setSelection(aSelected);
+  QList<ModuleBase_ViewerPrs> aSelected = getFilteredSelected();
 
+  bool isDone = setSelection(aSelected, false);
   emit valuesChanged();
   // the updateObject method should be called to flush the updated sigal. The workshop listens it,
   // calls validators for the feature and, as a result, updates the Apply button state.
@@ -59,8 +59,6 @@ void ModuleBase_WidgetSelector::onSelectionChanged()
     updateFocus();
 }
 
-#include <TopoDS_Iterator.hxx>
-
 //********************************************************************
 bool ModuleBase_WidgetSelector::acceptSubShape(const GeomShapePtr& theShape,
                                                const ResultPtr& theResult) const
@@ -138,7 +136,7 @@ void ModuleBase_WidgetSelector::activateCustom()
   // Restore selection in the viewer by the attribute selection list
   myWorkshop->setSelected(getAttributeSelection());
 
-  activateFilters(myWorkshop, true);
+  activateFilters(true);
 }
 
 //********************************************************************
@@ -173,5 +171,6 @@ void ModuleBase_WidgetSelector::deactivate()
 {
   disconnect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
   activateSelection(false);
-  activateFilters(myWorkshop, false);
+  activateFilters(false);
 }
+