1 // Copyright (c) 2020 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #ifndef _SelectMgr_AndOrFilter_HeaderFile
15 #define _SelectMgr_AndOrFilter_HeaderFile
17 #include <Standard.hxx>
18 #include <Standard_Type.hxx>
20 #include <Graphic3d_NMapOfTransient.hxx>
21 #include <Standard_Boolean.hxx>
22 #include <SelectMgr_CompositionFilter.hxx>
23 #include <SelectMgr_FilterType.hxx>
25 DEFINE_STANDARD_HANDLE(SelectMgr_AndOrFilter, SelectMgr_CompositionFilter)
27 //! A framework to define an OR or AND selection filter.
28 //! To use an AND selection filter call SetUseOrFilter with False parameter.
29 //! By default the OR selection filter is used.
30 class SelectMgr_AndOrFilter : public SelectMgr_CompositionFilter
35 //! Constructs an empty selection filter.
36 Standard_EXPORT SelectMgr_AndOrFilter (const SelectMgr_FilterType theFilterType);
38 //! Indicates that the selected Interactive Object passes the filter.
39 Standard_EXPORT virtual Standard_Boolean IsOk (const Handle(SelectMgr_EntityOwner)& theObj) const Standard_OVERRIDE;
41 //! Disable selection of specified objects.
42 Standard_EXPORT void SetDisabledObjects (const Handle(Graphic3d_NMapOfTransient)& theObjects);
44 //! @return a selection filter type (@sa SelectMgr_FilterType).
45 SelectMgr_FilterType FilterType() const { return myFilterType; }
47 //! Sets a selection filter type.
48 //! SelectMgr_FilterType_OR selection filter is used be default.
49 //! @param theFilterType the filter type.
50 void SetFilterType (const SelectMgr_FilterType theFilterType) { myFilterType = theFilterType; }
52 DEFINE_STANDARD_RTTIEXT(SelectMgr_AndOrFilter, SelectMgr_CompositionFilter)
56 Handle(Graphic3d_NMapOfTransient) myDisabledObjects; //!< disabled objects.
57 //! Selection isn't applied to these objects.
58 SelectMgr_FilterType myFilterType; //!< selection filter type. SelectMgr_TypeFilter_OR by default.
61 #endif // _SelectMgr_AndOrFilter_HeaderFile