Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / ModuleBase / ModuleBase_ViewerFilters.h
1 // File:        ModuleBase_ViewerFilters.h
2 // Created:     07 Okt 2014
3 // Author:      Vitaly SMETANNIKOV
4
5
6 #ifndef ModuleBase_ViewerFilters_H
7 #define ModuleBase_ViewerFilters_H
8
9 #include <QStringList>
10
11 #include <SelectMgr_Filter.hxx>
12 #include <SelectMgr_EntityOwner.hxx>
13 #include <gp_Pln.hxx>
14
15
16 class ModuleBase_IWorkshop;
17
18
19 /**
20 * A filter which provides filtering of selection in 3d viewer.
21 * Installing of this filter lets to select objects which belong to 
22 * currently active document or to global document
23 */
24 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter);
25 class ModuleBase_ShapeDocumentFilter: public SelectMgr_Filter
26 {
27 public:
28   Standard_EXPORT ModuleBase_ShapeDocumentFilter(ModuleBase_IWorkshop* theWorkshop): SelectMgr_Filter(),
29     myWorkshop(theWorkshop) {}
30
31   Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
32
33   DEFINE_STANDARD_RTTI(ModuleBase_ShapeDocumentFilter)
34
35 protected:
36   ModuleBase_IWorkshop* myWorkshop;
37 };
38
39 /**
40 * A filter which provides filtering of selection in 3d viewer.
41 * Installing of this filter lets to select of Vertexes and Edges which belongs to the given plane
42 */
43 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeInPlaneFilter, SelectMgr_Filter);
44 class ModuleBase_ShapeInPlaneFilter: public SelectMgr_Filter
45 {
46 public:
47   Standard_EXPORT ModuleBase_ShapeInPlaneFilter(const gp_Pln& thePane): 
48       SelectMgr_Filter(), myPlane(thePane) {}
49
50   Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
51
52   DEFINE_STANDARD_RTTI(ModuleBase_ShapeInPlaneFilter)
53 private:
54   gp_Pln myPlane;
55 };
56
57
58 /**
59 * A filter which provides filtering of selection in 3d viewer.
60 * Installing of this filter lets to select only object of requested type
61 */
62 DEFINE_STANDARD_HANDLE(ModuleBase_ObjectTypesFilter, SelectMgr_Filter);
63 class ModuleBase_ObjectTypesFilter: public ModuleBase_ShapeDocumentFilter
64 {
65 public:
66   Standard_EXPORT ModuleBase_ObjectTypesFilter(ModuleBase_IWorkshop* theWorkshop, const QStringList& theTypes): 
67       ModuleBase_ShapeDocumentFilter(theWorkshop), myTypes(theTypes) {}
68
69   Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
70
71   DEFINE_STANDARD_RTTI(ModuleBase_ObjectTypesFilter)
72 private:
73   QStringList myTypes;
74 };
75
76 #endif