Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
[modules/shaper.git] / src / ModuleBase / ModuleBase_ViewerFilters.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_ViewerFilters_H
9 #define ModuleBase_ViewerFilters_H
10
11 #include <QStringList>
12
13 #include <SelectMgr_Filter.hxx>
14 #include <SelectMgr_EntityOwner.hxx>
15 #include <gp_Pln.hxx>
16
17
18 class ModuleBase_IWorkshop;
19
20
21 /**
22 * \class ModuleBase_ShapeDocumentFilter
23 * \ingroup GUI
24 * A filter which provides filtering of selection in 3d viewer.
25 * Installing of this filter lets to select objects which belong to 
26 * currently active document or to global document
27 */
28 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter);
29 class ModuleBase_ShapeDocumentFilter: public SelectMgr_Filter
30 {
31 public:
32   /// Constructor
33   /// \param theWorkshop instance of workshop interface
34   Standard_EXPORT ModuleBase_ShapeDocumentFilter(ModuleBase_IWorkshop* theWorkshop): SelectMgr_Filter(),
35     myWorkshop(theWorkshop) {}
36
37   /// Returns True if the given owner is acceptable for selection
38   /// \param theOwner the selected owner
39   Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
40
41   DEFINE_STANDARD_RTTI(ModuleBase_ShapeDocumentFilter)
42
43 protected:
44   /// Reference to workshop
45   ModuleBase_IWorkshop* myWorkshop;
46 };
47
48 /**
49 * \class ModuleBase_ShapeInPlaneFilter
50 * \ingroup GUI
51 * A filter which provides filtering of selection in 3d viewer.
52 * Installing of this filter lets to select of Vertexes and Edges which belongs to the given plane
53 */
54 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeInPlaneFilter, SelectMgr_Filter);
55 class ModuleBase_ShapeInPlaneFilter: public SelectMgr_Filter
56 {
57 public:
58   /// Constructor
59   Standard_EXPORT ModuleBase_ShapeInPlaneFilter(): SelectMgr_Filter() {}
60
61   /// Set working plane
62   /// \param thePane plane object
63   void setPlane(const gp_Pln& thePane) { myPlane = thePane; }
64
65   /// Returns current working plane
66   gp_Pln plane() const { return myPlane; }
67
68   /// Returns True if the given owner is acceptable for selection
69   /// \param theOwner the selected owner
70   Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
71
72   DEFINE_STANDARD_RTTI(ModuleBase_ShapeInPlaneFilter)
73 private:
74   /// Working plane
75   gp_Pln myPlane;
76 };
77
78 #endif