Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:54

0001 // Created on: 1997-11-28
0002 // Created by: Robert COUBLANC
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _AIS_ExclusionFilter_HeaderFile
0018 #define _AIS_ExclusionFilter_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <TColStd_DataMapOfIntegerListOfInteger.hxx>
0024 #include <SelectMgr_Filter.hxx>
0025 #include <AIS_KindOfInteractive.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <TColStd_ListOfInteger.hxx>
0028 class SelectMgr_EntityOwner;
0029 
0030 class AIS_ExclusionFilter;
0031 DEFINE_STANDARD_HANDLE(AIS_ExclusionFilter, SelectMgr_Filter)
0032 
0033 //! A framework to reject or to accept only objects of
0034 //! given types and/or signatures.
0035 //! Objects are stored, and the stored objects - along
0036 //! with the flag settings - are used to define the filter.
0037 //! Objects to be filtered are compared with the stored
0038 //! objects added to the filter, and are accepted or
0039 //! rejected according to the exclusion flag setting.
0040 //! -   Exclusion flag on
0041 //! -   the function IsOk answers true for all objects,
0042 //! except those of the types and signatures stored
0043 //! in the filter framework
0044 //! -   Exclusion flag off
0045 //! -   the funciton IsOk answers true for all objects
0046 //! which have the same type and signature as the stored ones.
0047 class AIS_ExclusionFilter : public SelectMgr_Filter
0048 {
0049 
0050 public:
0051 
0052   
0053   //! Constructs an empty exclusion filter object defined by
0054   //! the flag setting ExclusionFlagOn.
0055   //! By default, the flag is set to true.
0056   Standard_EXPORT AIS_ExclusionFilter(const Standard_Boolean ExclusionFlagOn = Standard_True);
0057   
0058   //! All the AIS objects of <TypeToExclude>
0059   //! Will be rejected by the IsOk Method.
0060   Standard_EXPORT AIS_ExclusionFilter(const AIS_KindOfInteractive TypeToExclude, const Standard_Boolean ExclusionFlagOn = Standard_True);
0061   
0062   //! Constructs an exclusion filter object defined by the
0063   //! enumeration value TypeToExclude, the signature
0064   //! SignatureInType, and the flag setting ExclusionFlagOn.
0065   //! By default, the flag is set to true.
0066   Standard_EXPORT AIS_ExclusionFilter(const AIS_KindOfInteractive TypeToExclude, const Standard_Integer SignatureInType, const Standard_Boolean ExclusionFlagOn = Standard_True);
0067   
0068   Standard_EXPORT virtual Standard_Boolean IsOk (const Handle(SelectMgr_EntityOwner)& anObj) const Standard_OVERRIDE;
0069   
0070   //! Adds the type TypeToExclude to the list of types.
0071   Standard_EXPORT Standard_Boolean Add (const AIS_KindOfInteractive TypeToExclude);
0072   
0073   Standard_EXPORT Standard_Boolean Add (const AIS_KindOfInteractive TypeToExclude, const Standard_Integer SignatureInType);
0074   
0075   Standard_EXPORT Standard_Boolean Remove (const AIS_KindOfInteractive TypeToExclude);
0076   
0077   Standard_EXPORT Standard_Boolean Remove (const AIS_KindOfInteractive TypeToExclude, const Standard_Integer SignatureInType);
0078   
0079   Standard_EXPORT void Clear();
0080 
0081   Standard_Boolean IsExclusionFlagOn() const { return myIsExclusionFlagOn; }
0082 
0083   void SetExclusionFlag (const Standard_Boolean theStatus) { myIsExclusionFlagOn = theStatus; }
0084 
0085   Standard_EXPORT Standard_Boolean IsStored (const AIS_KindOfInteractive aType) const;
0086   
0087   Standard_EXPORT void ListOfStoredTypes (TColStd_ListOfInteger& TheList) const;
0088   
0089   Standard_EXPORT void ListOfSignature (const AIS_KindOfInteractive aType, TColStd_ListOfInteger& TheStoredList) const;
0090 
0091   DEFINE_STANDARD_RTTIEXT(AIS_ExclusionFilter,SelectMgr_Filter)
0092 
0093 private:
0094 
0095   Standard_EXPORT Standard_Boolean IsSignatureIn (const AIS_KindOfInteractive aType, const Standard_Integer aSignature) const;
0096 
0097   Standard_Boolean myIsExclusionFlagOn;
0098   TColStd_DataMapOfIntegerListOfInteger myStoredTypes;
0099 
0100 };
0101 
0102 #endif // _AIS_ExclusionFilter_HeaderFile