1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_ViewerFilters.h
4 // Created: 07 Okt 2014
5 // Author: Vitaly SMETANNIKOV
8 #ifndef ModuleBase_ViewerFilters_H
9 #define ModuleBase_ViewerFilters_H
11 #include <QStringList>
13 #include <SelectMgr_Filter.hxx>
14 #include <SelectMgr_EntityOwner.hxx>
16 #include <GeomAPI_Pln.h>
19 class ModuleBase_IWorkshop;
23 * \class ModuleBase_ShapeDocumentFilter
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
29 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter);
30 class ModuleBase_ShapeDocumentFilter: public SelectMgr_Filter
34 /// \param theWorkshop instance of workshop interface
35 Standard_EXPORT ModuleBase_ShapeDocumentFilter(ModuleBase_IWorkshop* theWorkshop): SelectMgr_Filter(),
36 myWorkshop(theWorkshop) {}
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;
42 DEFINE_STANDARD_RTTI(ModuleBase_ShapeDocumentFilter)
45 /// Reference to workshop
46 ModuleBase_IWorkshop* myWorkshop;
50 * \class ModuleBase_ShapeInPlaneFilter
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
55 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeInPlaneFilter, SelectMgr_Filter);
56 class ModuleBase_ShapeInPlaneFilter: public SelectMgr_Filter
60 Standard_EXPORT ModuleBase_ShapeInPlaneFilter(): SelectMgr_Filter() {}
63 /// \param thePlane a plane object
64 void setPlane(const std::shared_ptr<GeomAPI_Pln>& thePlane) { myPlane = thePlane; }
66 /// Returns current working plane
67 std::shared_ptr<GeomAPI_Pln> plane() const { return myPlane; }
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;
73 DEFINE_STANDARD_RTTI(ModuleBase_ShapeInPlaneFilter)
76 std::shared_ptr<GeomAPI_Pln> myPlane;