1 // Copyright (C) 2014-2017 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef ModuleBase_ViewerFilters_H
22 #define ModuleBase_ViewerFilters_H
24 #include <QStringList>
26 #include <SelectMgr_Filter.hxx>
27 #include <SelectMgr_EntityOwner.hxx>
29 #include <GeomAPI_Pln.h>
32 class ModuleBase_IWorkshop;
36 * \class ModuleBase_ShapeDocumentFilter
38 * A filter which provides filtering of selection in 3d viewer.
39 * Installing of this filter lets to select objects which belong to
40 * currently active document or to global document
42 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter);
43 class ModuleBase_ShapeDocumentFilter: public SelectMgr_Filter
47 /// \param theWorkshop instance of workshop interface
49 ModuleBase_ShapeDocumentFilter(ModuleBase_IWorkshop* theWorkshop): SelectMgr_Filter(),
50 myWorkshop(theWorkshop) {}
52 /// Returns True if the given owner is acceptable for selection
53 /// \param theOwner the selected owner
54 Standard_EXPORT virtual
55 Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
57 DEFINE_STANDARD_RTTIEXT(ModuleBase_ShapeDocumentFilter, SelectMgr_Filter)
60 /// Reference to workshop
61 ModuleBase_IWorkshop* myWorkshop;
65 * \class ModuleBase_ShapeInPlaneFilter
67 * A filter which provides filtering of selection in 3d viewer.
68 * Installing of this filter lets to select of Vertexes and Edges which belongs to the given plane
70 DEFINE_STANDARD_HANDLE(ModuleBase_ShapeInPlaneFilter, SelectMgr_Filter);
71 class ModuleBase_ShapeInPlaneFilter: public SelectMgr_Filter
75 Standard_EXPORT ModuleBase_ShapeInPlaneFilter(): SelectMgr_Filter() {}
78 /// \param thePlane a plane object
79 void setPlane(const std::shared_ptr<GeomAPI_Pln>& thePlane) { myPlane = thePlane; }
81 /// Returns current working plane
82 std::shared_ptr<GeomAPI_Pln> plane() const { return myPlane; }
84 /// Returns True if the given owner is acceptable for selection
85 /// \param theOwner the selected owner
86 Standard_EXPORT virtual
87 Standard_Boolean IsOk(const Handle(SelectMgr_EntityOwner)& theOwner) const;
89 DEFINE_STANDARD_RTTIEXT(ModuleBase_ShapeInPlaneFilter, SelectMgr_Filter)
92 std::shared_ptr<GeomAPI_Pln> myPlane;