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 * \class ModuleBase_ShapeDocumentFilter
23 * A filter which provides filtering of selection in 3d viewer.
24 * Installing of this filter lets to select objects which belong to
25 * currently active document or to global document
27 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter);
28 class ModuleBase_ShapeDocumentFilter: public SelectMgr_Filter
32 /// \param theWorkshop instance of workshop interface
33 Standard_EXPORT ModuleBase_ShapeDocumentFilter(ModuleBase_IWorkshop* theWorkshop): SelectMgr_Filter(),
34 myWorkshop(theWorkshop) {}
36 /// Returns True if the given owner is acceptable for selection
37 /// \param theOwner the selected owner
38 Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
40 DEFINE_STANDARD_RTTI(ModuleBase_ShapeDocumentFilter)
43 /// Reference to workshop
44 ModuleBase_IWorkshop* myWorkshop;
48 * \class ModuleBase_ShapeInPlaneFilter
49 * A filter which provides filtering of selection in 3d viewer.
50 * Installing of this filter lets to select of Vertexes and Edges which belongs to the given plane
52 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeInPlaneFilter, SelectMgr_Filter);
53 class ModuleBase_ShapeInPlaneFilter: public SelectMgr_Filter
57 Standard_EXPORT ModuleBase_ShapeInPlaneFilter(): SelectMgr_Filter() {}
60 /// \param thePane plane object
61 void setPlane(const gp_Pln& thePane) { myPlane = thePane; }
63 /// Returns current working plane
64 gp_Pln plane() const { return myPlane; }
66 /// Returns True if the given owner is acceptable for selection
67 /// \param theOwner the selected owner
68 Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
70 DEFINE_STANDARD_RTTI(ModuleBase_ShapeInPlaneFilter)
78 * \class ModuleBase_ObjectTypesFilter
79 * A filter which provides filtering of selection in 3d viewer.
80 * Installing of this filter lets to select only object of requested type
81 * Accepts following objects types:
82 * - "construction" - to select ModelAPI_ResultConstruction objects
84 DEFINE_STANDARD_HANDLE(ModuleBase_ObjectTypesFilter, SelectMgr_Filter);
85 class ModuleBase_ObjectTypesFilter: public ModuleBase_ShapeDocumentFilter
89 /// \param theWorkshop instance of workshop interface
90 /// \param theTypes list of object types
91 Standard_EXPORT ModuleBase_ObjectTypesFilter(ModuleBase_IWorkshop* theWorkshop, const QStringList& theTypes):
92 ModuleBase_ShapeDocumentFilter(theWorkshop), myTypes(theTypes) {}
94 /// Returns True if the given owner is acceptable for selection
95 /// \param theOwner the selected owner
96 Standard_EXPORT virtual Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
98 DEFINE_STANDARD_RTTI(ModuleBase_ObjectTypesFilter)
100 /// List of object types