Salome HOME
Issue #1368: Creation of a Qt panel. Widget creator interface correction to manage...
[modules/shaper.git] / src / ModuleBase / ModuleBase_Filter.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_Filter.h
4 // Created:     10 Dec 2014
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef ModuleBase_Filter_H
8 #define ModuleBase_Filter_H
9
10 #include "ModuleBase.h"
11
12 #include <SelectMgr_Filter.hxx>
13
14 #include <list>
15
16 /**
17  * \ingroup GUI
18  * This object is assigned by the name
19  * in the XML file to the specific attribute or to the whole feature.
20  * If isOK method of the filter returns "false", it is signalized in user interface
21  * that the processed entity should not be selected.
22  * Filterss must be registered in the filters factory to be
23  * correctly identified by the XML string-ID.
24  */
25 class ModuleBase_Filter
26 {
27 public:
28   /// Constructor
29   MODULEBASE_EXPORT ModuleBase_Filter() {}
30
31   /**
32    * Returns an OCC selection filter. It can be appended into the context of a viewer
33    * It creates a filter if it has not be created yet.
34    * \return the selection filter
35    */
36   MODULEBASE_EXPORT Handle(SelectMgr_Filter) getFilter();
37
38   /**
39    * Sets the arguments to the filter.
40    * \param theArguments a list of arguments
41    */
42   MODULEBASE_EXPORT virtual void setArguments(const std::list<std::string>& theArguments) = 0;
43 protected:
44   /**
45    * It creates an internal instance of the OCC filter
46    */
47   virtual void createFilter() = 0;
48
49 protected:
50   /// current instance of the OCC selection filter
51   Handle(SelectMgr_Filter) myFilter; 
52 };
53
54 #endif //ModuleBase_Filter