Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom into Dev_0.7.1
[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   /// Constructor
28   /// \param theWorkshop instance of workshop interface
29   Standard_EXPORT ModuleBase_FilterNoConsructionSubShapes(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_FilterNoConsructionSubShapes)
41
42 protected:
43   /// Instance of workshop interface
44   ModuleBase_IWorkshop* myWorkshop;
45 };
46
47 #endif