Salome HOME
Merge branch 'master' of newgeom:newgeom
[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 <SelectMgr_Filter.hxx>
10 #include <SelectMgr_EntityOwner.hxx>
11 #include <gp_Pln.hxx>
12
13
14 class ModuleBase_IWorkshop;
15
16
17 /**
18 * A filter which provides filtering of selection in 3d viewer.
19 * Installing of this filter lets to select objects which belong to 
20 * currently active document or to global document
21 */
22 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter);
23 class ModuleBase_ShapeDocumentFilter: public SelectMgr_Filter
24 {
25 public:
26   Standard_EXPORT ModuleBase_ShapeDocumentFilter(ModuleBase_IWorkshop* theWorkshop): SelectMgr_Filter(),
27     myWorkshop(theWorkshop) {}
28
29   Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
30
31   DEFINE_STANDARD_RTTI(ModuleBase_ShapeDocumentFilter)
32
33 private:
34   ModuleBase_IWorkshop* myWorkshop;
35 };
36
37 /**
38 * A filter which provides filtering of selection in 3d viewer.
39 * Installing of this filter lets to select of Vertexes and Edges which belongs to the given plane
40 */
41 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeInPlaneFilter, SelectMgr_Filter);
42 class ModuleBase_ShapeInPlaneFilter: public SelectMgr_Filter
43 {
44 public:
45   Standard_EXPORT ModuleBase_ShapeInPlaneFilter(const gp_Pln& thePane): 
46       SelectMgr_Filter(), myPlane(thePane) {}
47
48   Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
49
50   DEFINE_STANDARD_RTTI(ModuleBase_ShapeInPlaneFilter)
51 private:
52   gp_Pln myPlane;
53 };
54
55 #endif