Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom.git into Dev_1.1.0
[modules/shaper.git] / src / ModuleBase / ModuleBase_FilterNoConsructionSubShapes.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_ViewerFilters.h
4 // Created:     07 Okt 2014
5 // Author:      Vitaly SMETANNIKOV
6
7
8 #ifndef ModuleBase_FilterNoConsructionSubShapes_H
9 #define ModuleBase_FilterNoConsructionSubShapes_H
10
11 #include <QStringList>
12
13 #include <SelectMgr_Filter.hxx>
14 #include <SelectMgr_EntityOwner.hxx>
15
16 class ModuleBase_IWorkshop;
17
18 /**
19 * \ingroup GUI
20 * \class ModuleBase_FilterNoConsructionSubShapes
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_FilterNoConsructionSubShapes, SelectMgr_Filter);
26 class ModuleBase_FilterNoConsructionSubShapes: public SelectMgr_Filter
27 {
28 public:
29   /// Constructor
30   /// \param theWorkshop instance of workshop interface
31   Standard_EXPORT ModuleBase_FilterNoConsructionSubShapes(ModuleBase_IWorkshop* theWorkshop):
32       SelectMgr_Filter(), myWorkshop(theWorkshop) {}
33
34   /**
35    * Returns true if the owner is computed from decomposition(it is global selection, not the sub-shapes)
36    * of if the selected result is a construction and the result feature is composite and has sub-elements.
37    * \param theOwner the result of selection
38    * \return whether the owner is selectable in the viewer
39   */
40   Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
41
42   DEFINE_STANDARD_RTTI(ModuleBase_FilterNoConsructionSubShapes)
43
44 protected:
45   /// Instance of workshop interface
46   ModuleBase_IWorkshop* myWorkshop;
47 };
48
49 #endif