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>
18 class ModuleBase_IWorkshop;
22 * A filter which provides filtering of selection in 3d viewer.
23 * Installing of this filter lets to select objects which belong to
24 * currently active document or to global document
26 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter);
27 class ModuleBase_ShapeDocumentFilter: public SelectMgr_Filter
31 /// \param theWorkshop instance of workshop interface
32 Standard_EXPORT ModuleBase_ShapeDocumentFilter(ModuleBase_IWorkshop* theWorkshop): SelectMgr_Filter(),
33 myWorkshop(theWorkshop) {}
35 /// Returns True if the given owner is acceptable for selection
36 /// \param theOwner the selected owner
37 Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
39 DEFINE_STANDARD_RTTI(ModuleBase_ShapeDocumentFilter)
42 /// Reference to workshop
43 ModuleBase_IWorkshop* myWorkshop;
47 * A filter which provides filtering of selection in 3d viewer.
48 * Installing of this filter lets to select of Vertexes and Edges which belongs to the given plane
50 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeInPlaneFilter, SelectMgr_Filter);
51 class ModuleBase_ShapeInPlaneFilter: public SelectMgr_Filter
55 Standard_EXPORT ModuleBase_ShapeInPlaneFilter(): SelectMgr_Filter() {}
58 /// \param thePane plane object
59 void setPlane(const gp_Pln& thePane) { myPlane = thePane; }
61 /// Returns current working plane
62 gp_Pln plane() const { return myPlane; }
64 /// Returns True if the given owner is acceptable for selection
65 /// \param theOwner the selected owner
66 Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
68 DEFINE_STANDARD_RTTI(ModuleBase_ShapeInPlaneFilter)
76 * A filter which provides filtering of selection in 3d viewer.
77 * Installing of this filter lets to select only object of requested type
78 * Accepts following objects types:
79 * - "construction" - to select ModelAPI_ResultConstruction objects
81 DEFINE_STANDARD_HANDLE(ModuleBase_ObjectTypesFilter, SelectMgr_Filter);
82 class ModuleBase_ObjectTypesFilter: public ModuleBase_ShapeDocumentFilter
86 /// \param theWorkshop instance of workshop interface
87 /// \param theTypes list of object types
88 Standard_EXPORT ModuleBase_ObjectTypesFilter(ModuleBase_IWorkshop* theWorkshop, const QStringList& theTypes):
89 ModuleBase_ShapeDocumentFilter(theWorkshop), myTypes(theTypes) {}
91 /// Returns True if the given owner is acceptable for selection
92 /// \param theOwner the selected owner
93 Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
95 DEFINE_STANDARD_RTTI(ModuleBase_ObjectTypesFilter)
97 /// List of object types