Salome HOME
Porting to SALOME_8.2.0
[modules/shaper.git] / src / ModuleBase / ModuleBase_FilterValidated.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_FilterValidated.h
4 // Created:     17 Mar 2015
5 // Author:      Natalia ERMOLAEVA
6
7
8 #ifndef ModuleBase_FilterValidated_H
9 #define ModuleBase_FilterValidated_H
10
11 #include <SelectMgr_Filter.hxx>
12 #include <SelectMgr_EntityOwner.hxx>
13
14 class ModuleBase_IWorkshop;
15
16 //#define DEBUG_FILTERS
17
18 /**
19 * \ingroup GUI
20 * \class ModuleBase_FilterValidated
21 * A filter which provides filtering of selection in 3d viewer.
22 * Installing of this filter lets to select objects which belong to 
23 * currently active document or to global document
24 */
25 DEFINE_STANDARD_HANDLE(ModuleBase_FilterValidated, SelectMgr_Filter);
26 class ModuleBase_FilterValidated: public SelectMgr_Filter
27 {
28 public:
29   /// Constructor
30   /// \param theWorkshop instance of workshop interface
31   Standard_EXPORT ModuleBase_FilterValidated(ModuleBase_IWorkshop* theWorkshop):
32       SelectMgr_Filter(), myWorkshop(theWorkshop) {}
33
34   /**
35    * Returns true if the owner is computed from decomposition
36    * (it is global selection, not the sub-shapes)
37    * of if the selected result is a construction and the result 
38    * feature is composite and has sub-elements.
39    * \param theOwner the result of selection
40    * \return whether the owner is selectable in the viewer
41   */
42   Standard_EXPORT virtual
43     Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
44
45   DEFINE_STANDARD_RTTIEXT(ModuleBase_FilterValidated, SelectMgr_Filter)
46 protected:
47   /// Instance of workshop interface
48   ModuleBase_IWorkshop* myWorkshop;
49 };
50
51 #endif