Salome HOME
Sketch shape in plane selection filter should not be activated while PartSet_WidgetSh...
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetValidator.cpp
index 745d0787a1db034cef7650819b9b9783e5153cbf..d0b2b5ce17e765aa102f4ee2fc969f4df9c8bed9 100755 (executable)
@@ -14,7 +14,8 @@
 // License along with this library; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or
+// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
 //
 
 #include <ModuleBase_WidgetValidator.h>
@@ -38,6 +39,14 @@ ModuleBase_WidgetValidator::~ModuleBase_WidgetValidator()
   delete myAttributeStore;
 }
 
+//********************************************************************
+void ModuleBase_WidgetValidator::selectionFilters(int& theModuleSelectionFilters,
+                                                  SelectMgr_ListOfFilter& theSelectionFilters)
+{
+  theModuleSelectionFilters = -1;
+  theSelectionFilters.Append(myWorkshop->validatorFilter());
+}
+
 //********************************************************************
 bool ModuleBase_WidgetValidator::isValidSelection(const ModuleBase_ViewerPrsPtr& theValue)
 {
@@ -51,23 +60,6 @@ bool ModuleBase_WidgetValidator::isValidSelection(const ModuleBase_ViewerPrsPtr&
   return aValid;
 }
 
-bool ModuleBase_WidgetValidator::activateFilters(const bool toActivate)
-{
-  ModuleBase_IViewer* aViewer = myWorkshop->viewer();
-
-  Handle(SelectMgr_Filter) aSelFilter = myWorkshop->validatorFilter();
-  bool aHasSelectionFilter = aViewer->hasSelectionFilter(aSelFilter);
-
-  if (toActivate)
-    aViewer->addSelectionFilter(aSelFilter);
-  else {
-    aViewer->removeSelectionFilter(aSelFilter);
-    clearValidatedCash();
-  }
-
-  return aHasSelectionFilter;
-}
-
 void ModuleBase_WidgetValidator::storeAttributeValue(const AttributePtr& theAttribute)
 {
   myIsInValidate = true;