Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.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 /**
17 * \ingroup GUI
18 * \class ModuleBase_FilterValidated
19 * A filter which provides filtering of selection in 3d viewer.
20 * Installing of this filter lets to select objects which belong to 
21 * currently active document or to global document
22 */
23 DEFINE_STANDARD_HANDLE(ModuleBase_FilterValidated, SelectMgr_Filter);
24 class ModuleBase_FilterValidated: public SelectMgr_Filter
25 {
26 public:
27   /// Constructor
28   /// \param theWorkshop instance of workshop interface
29   Standard_EXPORT ModuleBase_FilterValidated(ModuleBase_IWorkshop* theWorkshop):
30       SelectMgr_Filter(), myWorkshop(theWorkshop) {}
31
32   /**
33    * Returns true if the owner is computed from decomposition(it is global selection, not the sub-shapes)
34    * of if the selected result is a construction and the result feature is composite and has sub-elements.
35    * \param theOwner the result of selection
36    * \return whether the owner is selectable in the viewer
37   */
38   Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
39
40   DEFINE_STANDARD_RTTI(ModuleBase_FilterValidated)
41
42 protected:
43   /// Instance of workshop interface
44   ModuleBase_IWorkshop* myWorkshop;
45 };
46
47 #endif