Salome HOME
Issue #1015: The validate icon must be greyed and inactive instead of red and active
[modules/shaper.git] / src / ModuleBase / ModuleBase_Filter.h
index c18a6a56725b989e1a7ddd9e95e4e3f01f11217d..e7a1a639bf486472b99f4dca491f80599c9084e7 100644 (file)
 
 #include <SelectMgr_Filter.hxx>
 
+#include <list>
+
 /**
+ * \ingroup GUI
  * This object is assigned by the name
  * in the XML file to the specific attribute or to the whole feature.
  * If isOK method of the filter returns "false", it is signalized in user interface
  * Filterss must be registered in the filters factory to be
  * correctly identified by the XML string-ID.
  */
-DEFINE_STANDARD_HANDLE(ModuleBase_Filter, SelectMgr_Filter);
-class ModuleBase_Filter: public SelectMgr_Filter
+class ModuleBase_Filter
 {
 public:
-  Standard_EXPORT ModuleBase_Filter(): SelectMgr_Filter() {}
-
-  Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
-
-  DEFINE_STANDARD_RTTI(ModuleBase_Filter)
+  /// Constructor
+  MODULEBASE_EXPORT ModuleBase_Filter() {}
+
+  /**
+   * Returns an OCC selection filter. It can be appended into the context of a viewer
+   * It creates a filter if it has not be created yet.
+   * \return the selection filter
+   */
+  MODULEBASE_EXPORT Handle(SelectMgr_Filter) getFilter();
+
+  /**
+   * Sets the arguments to the filter.
+   * \param theArguments a list of arguments
+   */
+  MODULEBASE_EXPORT virtual void setArguments(const std::list<std::string>& theArguments) = 0;
+protected:
+  /**
+   * It creates an internal instance of the OCC filter
+   */
+  virtual void createFilter() = 0;
+
+protected:
+  /// current instance of the OCC selection filter
+  Handle(SelectMgr_Filter) myFilter; 
 };
 
 #endif //ModuleBase_Filter