| 1 | // Created on: 1997-03-06 |
| 2 | // Created by: Robert COUBLANC |
| 3 | // Copyright (c) 1997-1999 Matra Datavision |
| 4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
| 5 | // |
| 6 | // This file is part of Open CASCADE Technology software library. |
| 7 | // |
| 8 | // This library is free software; you can redistribute it and/or modify it under |
| 9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
| 10 | // by the Free Software Foundation, with special exception defined in the file |
| 11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
| 12 | // distribution for complete text of the license and disclaimer of any warranty. |
| 13 | // |
| 14 | // Alternatively, this file may be used under the terms of Open CASCADE |
| 15 | // commercial license or contractual agreement. |
| 16 | |
| 17 | #ifndef _AIS_TypeFilter_HeaderFile |
| 18 | #define _AIS_TypeFilter_HeaderFile |
| 19 | |
| 20 | #include <Standard.hxx> |
| 21 | #include <Standard_Type.hxx> |
| 22 | |
| 23 | #include <AIS_KindOfInteractive.hxx> |
| 24 | #include <SelectMgr_Filter.hxx> |
| 25 | #include <Standard_Boolean.hxx> |
| 26 | class SelectMgr_EntityOwner; |
| 27 | |
| 28 | |
| 29 | class AIS_TypeFilter; |
| 30 | DEFINE_STANDARD_HANDLE(AIS_TypeFilter, SelectMgr_Filter) |
| 31 | |
| 32 | //! Selects Interactive Objects through their types. The |
| 33 | //! filter questions each Interactive Object in local context |
| 34 | //! to determine whether it has an non-null owner, and if |
| 35 | //! so, whether it is of the desired type. If the object |
| 36 | //! returns true in each case, it is kept. If not, it is rejected. |
| 37 | //! By default, the interactive object has a None type |
| 38 | //! and a signature of 0. A filter for type specifies a |
| 39 | //! choice of type out of a range at any level enumerated |
| 40 | //! for type or kind. The choice could be for kind of |
| 41 | //! interactive object, of dimension, of unit, or type of axis, |
| 42 | //! plane or attribute. |
| 43 | //! If you want to give a particular type and signature to |
| 44 | //! your Interactive Object, you must redefine two virtual |
| 45 | //! methods: Type and Signature. |
| 46 | //! This filter is used in both Neutral Point and open local contexts. |
| 47 | //! In the Collector viewer, you can only locate |
| 48 | //! Interactive Objects which answer positively to the |
| 49 | //! positioned filters when a local context is open. |
| 50 | //! Warning |
| 51 | //! When you close a local context, all temporary |
| 52 | //! interactive objects are deleted, all selection modes |
| 53 | //! concerning the context are cancelled, and all content |
| 54 | //! filters are emptied. |
| 55 | class AIS_TypeFilter : public SelectMgr_Filter |
| 56 | { |
| 57 | |
| 58 | public: |
| 59 | |
| 60 | |
| 61 | //! Initializes filter for type, aGivenKind. |
| 62 | Standard_EXPORT AIS_TypeFilter(const AIS_KindOfInteractive aGivenKind); |
| 63 | |
| 64 | //! Returns False if the transient is not an Interactive |
| 65 | //! Object, or if the type of the Interactive Object is not |
| 66 | //! the same as that stored in the filter. |
| 67 | Standard_EXPORT virtual Standard_Boolean IsOk (const Handle(SelectMgr_EntityOwner)& anobj) const Standard_OVERRIDE; |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | DEFINE_STANDARD_RTTIEXT(AIS_TypeFilter,SelectMgr_Filter) |
| 73 | |
| 74 | protected: |
| 75 | |
| 76 | |
| 77 | AIS_KindOfInteractive myKind; |
| 78 | |
| 79 | |
| 80 | private: |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | }; |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | #endif // _AIS_TypeFilter_HeaderFile |