Salome HOME
Sketch shape in plane selection filter should not be activated while PartSet_WidgetSh...
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetValidator.cpp
index d6c9d9f0fab27518f68ac8aea0811e991cacb3e9..d0b2b5ce17e765aa102f4ee2fc969f4df9c8bed9 100755 (executable)
@@ -1,4 +1,22 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// 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>
+//
 
 #include <ModuleBase_WidgetValidator.h>
 #include <ModuleBase_WidgetSelectorStore.h>
@@ -21,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)
 {
@@ -34,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;