1 // Created on: 1997-11-28
2 // Created by: Robert COUBLANC
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _AIS_ExclusionFilter_HeaderFile
18 #define _AIS_ExclusionFilter_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Boolean.hxx>
24 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
25 #include <SelectMgr_Filter.hxx>
26 #include <AIS_KindOfInteractive.hxx>
27 #include <Standard_Integer.hxx>
28 #include <TColStd_ListOfInteger.hxx>
29 class SelectMgr_EntityOwner;
32 class AIS_ExclusionFilter;
33 DEFINE_STANDARD_HANDLE(AIS_ExclusionFilter, SelectMgr_Filter)
35 //! A framework to reject or to accept only objects of
36 //! given types and/or signatures.
37 //! Objects are stored, and the stored objects - along
38 //! with the flag settings - are used to define the filter.
39 //! Objects to be filtered are compared with the stored
40 //! objects added to the filter, and are accepted or
41 //! rejected according to the exclusion flag setting.
42 //! - Exclusion flag on
43 //! - the function IsOk answers true for all objects,
44 //! except those of the types and signatures stored
45 //! in the filter framework
46 //! - Exclusion flag off
47 //! - the funciton IsOk answers true for all objects
48 //! which have the same type and signature as the stored ones.
49 class AIS_ExclusionFilter : public SelectMgr_Filter
55 //! Constructs an empty exclusion filter object defined by
56 //! the flag setting ExclusionFlagOn.
57 //! By default, the flag is set to true.
58 Standard_EXPORT AIS_ExclusionFilter(const Standard_Boolean ExclusionFlagOn = Standard_True);
60 //! All the AIS objects of <TypeToExclude>
61 //! Will be rejected by the IsOk Method.
62 Standard_EXPORT AIS_ExclusionFilter(const AIS_KindOfInteractive TypeToExclude, const Standard_Boolean ExclusionFlagOn = Standard_True);
64 //! Constructs an exclusion filter object defined by the
65 //! enumeration value TypeToExclude, the signature
66 //! SignatureInType, and the flag setting ExclusionFlagOn.
67 //! By default, the flag is set to true.
68 Standard_EXPORT AIS_ExclusionFilter(const AIS_KindOfInteractive TypeToExclude, const Standard_Integer SignatureInType, const Standard_Boolean ExclusionFlagOn = Standard_True);
70 Standard_EXPORT virtual Standard_Boolean IsOk (const Handle(SelectMgr_EntityOwner)& anObj) const Standard_OVERRIDE;
72 //! Adds the type TypeToExclude to the list of types.
73 Standard_EXPORT Standard_Boolean Add (const AIS_KindOfInteractive TypeToExclude);
75 Standard_EXPORT Standard_Boolean Add (const AIS_KindOfInteractive TypeToExclude, const Standard_Integer SignatureInType);
77 Standard_EXPORT Standard_Boolean Remove (const AIS_KindOfInteractive TypeToExclude);
79 Standard_EXPORT Standard_Boolean Remove (const AIS_KindOfInteractive TypeToExclude, const Standard_Integer SignatureInType);
81 Standard_EXPORT void Clear();
83 Standard_Boolean IsExclusionFlagOn() const;
85 void SetExclusionFlag (const Standard_Boolean Status);
87 Standard_EXPORT Standard_Boolean IsStored (const AIS_KindOfInteractive aType) const;
89 Standard_EXPORT void ListOfStoredTypes (TColStd_ListOfInteger& TheList) const;
91 Standard_EXPORT void ListOfSignature (const AIS_KindOfInteractive aType, TColStd_ListOfInteger& TheStoredList) const;
96 DEFINE_STANDARD_RTTIEXT(AIS_ExclusionFilter,SelectMgr_Filter)
106 Standard_EXPORT Standard_Boolean IsSignatureIn (const AIS_KindOfInteractive aType, const Standard_Integer aSignature) const;
108 Standard_Boolean myIsExclusionFlagOn;
109 TColStd_DataMapOfIntegerListOfInteger myStoredTypes;
115 #include <AIS_ExclusionFilter.lxx>
121 #endif // _AIS_ExclusionFilter_HeaderFile