Salome HOME
49b11279971e03af32ae48295d3114c875485a38
[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 * 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_FilterNoConsructionSubShapes, SelectMgr_Filter);
24 class ModuleBase_FilterNoConsructionSubShapes: public SelectMgr_Filter
25 {
26 public:
27   Standard_EXPORT ModuleBase_FilterNoConsructionSubShapes(ModuleBase_IWorkshop* theWorkshop):
28       SelectMgr_Filter(), myWorkshop(theWorkshop) {}
29
30   /**
31    * Returns true if the owner is computed from decomposition(it is global selection, not the sub-shapes)
32    * of if the selected result is a construction and the result feature is composite and has sub-elements.
33    * \param theOwner the result of selection
34    * \return whether the owner is selectable in the viewer
35   */
36   Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
37
38   DEFINE_STANDARD_RTTI(ModuleBase_FilterNoConsructionSubShapes)
39
40 protected:
41   ModuleBase_IWorkshop* myWorkshop;
42 };
43
44 #endif