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