Salome HOME
Porting to SALOME_8.2.0
[modules/shaper.git] / src / PartSet / PartSet_Filters.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_Filters.h
4 // Created:     08 Nov 2014
5 // Author:      Vitaly SMETANNIKOV
6
7 #ifndef PartSet_Filters_H
8 #define PartSet_Filters_H
9
10 #include <ModuleBase_ViewerFilters.h>
11
12
13 /**
14 * \class PartSet_GlobalFilter
15 * \ingroup Modules
16 * A class which filters groups object in addition to documents (see issue #310)
17 */
18 DEFINE_STANDARD_HANDLE(PartSet_GlobalFilter, ModuleBase_ShapeDocumentFilter);
19 class PartSet_GlobalFilter: public ModuleBase_ShapeDocumentFilter
20 {
21 public:
22   /// Constructor
23   /// \param theWorkshop a pointer to workshop
24   PartSet_GlobalFilter(ModuleBase_IWorkshop* theWorkshop)
25     : ModuleBase_ShapeDocumentFilter(theWorkshop) {}
26
27   /// Returns True if selected presentation can be selected
28   /// \param theOwner an owner of the persentation
29   Standard_EXPORT virtual Standard_Boolean
30     IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
31
32   DEFINE_STANDARD_RTTIEXT(PartSet_GlobalFilter, ModuleBase_ShapeDocumentFilter)
33 };
34
35
36 /// \class PartSet_CirclePointFilter
37 /// \ingroup GUI
38 /// \brief A filter which provide filtering of selection in 3d viewer.
39 /// Installing of this filter disables selection of point on circle in sketch
40 DEFINE_STANDARD_HANDLE(PartSet_CirclePointFilter, SelectMgr_Filter);
41 class PartSet_CirclePointFilter: public SelectMgr_Filter
42 {
43 public:
44
45   /// Constructor
46   /// \param theWorkshop instance of workshop interface
47   Standard_EXPORT PartSet_CirclePointFilter(ModuleBase_IWorkshop* theWorkshop):
48     SelectMgr_Filter(),
49     myWorkshop(theWorkshop) {};
50
51   /// Returns True if the given owner is acceptable for selection
52   /// \param theOwner the selected owner
53   Standard_EXPORT virtual Standard_Boolean
54     IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
55
56   DEFINE_STANDARD_RTTIEXT(PartSet_CirclePointFilter, SelectMgr_Filter)
57
58 private:
59
60   /// Reference to workshop
61   ModuleBase_IWorkshop* myWorkshop;
62 };
63
64 #endif