Salome HOME
Issue #3236: Provide icons for extrusions
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetValidated.h
index 15583f9f0e6b435141ba02e08cfa4ea8b5ea41c8..ce6752b724950423a3006bf4fa955c058194cd94 100644 (file)
@@ -1,9 +1,21 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        ModuleBase_WidgetValidated.h
-// Created:     12 Mar 2015
-// Author:      Natalia ERMOLAEVA
-
+// Copyright (C) 2014-2019  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
+//
 
 #ifndef MODULEBASE_WIDGETVALIDATED_H_
 #define MODULEBASE_WIDGETVALIDATED_H_
 #include <GeomAPI_AISObject.h>
 #include <ModelAPI_Object.h>
 #include <ModelAPI_Attribute.h>
+#include <ModelAPI_ResultBody.h>
 
 #include <SelectMgr_ListOfFilter.hxx>
 #include <NCollection_DataMap.hxx>
 #include <TopoDS_Shape.hxx>
+#include <AIS_NListOfEntityOwner.hxx>
 
 #include <QList>
 #include <QMap>
@@ -60,6 +74,9 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidated : public ModuleBase_ModelWidg
   //! Returns data object by AIS
   ObjectPtr findPresentedObject(const AISObjectPtr& theAIS) const;
 
+  /// The method called when widget is deactivated
+  virtual void deactivate();
+
   //! Clear all validated cash in the widget
   void clearValidatedCash();
 
@@ -67,6 +84,12 @@ class MODULEBASE_EXPORT ModuleBase_WidgetValidated : public ModuleBase_ModelWidg
   /// \return boolean value
   bool isFilterActivated() const;
 
+  /// Appends into container of workshop selection filters
+  /// \param [out] theModuleSelectionFilters module additional modes, -1 means all default modes
+  /// \param [out] selection filters
+  virtual void selectionFilters(QIntList& theModuleSelectionFilters,
+                                SelectMgr_ListOfFilter& theSelectionFilters);
+
   /// Block the model flush of update and intialization of attribute
   /// \param theAttribute an attribute of blocking
   /// \param theFeature a feature
@@ -135,11 +158,6 @@ protected:
   /// \return a list of presentations
   QList<std::shared_ptr<ModuleBase_ViewerPrs>> getFilteredSelected();
 
-  /// It obtains selection filters from the workshop and activates them in the active viewer
-  /// \param toActivate a flag about activation or deactivation the filters
-  /// \return true if the selection filter of the widget is activated in viewer context
-  bool activateFilters(const bool toActivate);
-
   /// Block the model flush of update and intialization of attribute
   /// \param theAttribute an attribute of blocking
   /// \param theToBlock flag whether the model is blocked or unblocked
@@ -174,6 +192,8 @@ private:
   /// \param theValues a list of presentations.
   void filterCompSolids(QList<std::shared_ptr<ModuleBase_ViewerPrs>>& theValues);
 
+  void collectSubBodies(const ResultBodyPtr& theBody, AIS_NListOfEntityOwner& theList);
+
 protected:
   /// Reference to workshop
   ModuleBase_IWorkshop* myWorkshop;