Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-21 09:16:12

0001 // Created on: 1997-03-04
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_SignatureFilter_HeaderFile
0018 #define _AIS_SignatureFilter_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <AIS_TypeFilter.hxx>
0025 #include <AIS_KindOfInteractive.hxx>
0026 class SelectMgr_EntityOwner;
0027 
0028 //! Selects Interactive Objects through their signatures
0029 //! and types. The signature provides an
0030 //! additional characterization of an object's type, and
0031 //! takes the form of an index. The filter questions each
0032 //! Interactive Object in local context to determine
0033 //! whether it has an non-null owner, and if so, whether
0034 //! it has the desired signature. If the object returns true
0035 //! in each case, it is kept. If not, it is rejected.
0036 //! By default, the interactive object has a None type
0037 //! and a signature of 0. If you want to give a particular
0038 //! type and signature to your Interactive Object, you
0039 //! must redefine two virtual methods: Type and Signature.
0040 //! This filter is only used in an open local contexts.
0041 //! In the Collector viewer, you can only locate
0042 //! Interactive Objects which answer positively to the
0043 //! positioned filters when a local context is open.
0044 //! Warning
0045 //! Some signatures have already been used by standard
0046 //! objects delivered in AIS. These include:
0047 //! -   signature 0 - Shape
0048 //! -   signature 1 - Point
0049 //! -   signature 2 - Axis
0050 //! -   signature 3 - Trihedron
0051 //! -   signature 4 - PlaneTrihedron
0052 //! -   signature 5 - Line
0053 //! -   signature 6 - Circle
0054 //! -   signature 7 - Plane
0055 class AIS_SignatureFilter : public AIS_TypeFilter
0056 {
0057 
0058 public:
0059   //! Initializes the signature filter, adding the signature
0060   //! specification, aGivenSignature, to that for type,
0061   //! aGivenKind, in AIS_TypeFilter.
0062   Standard_EXPORT AIS_SignatureFilter(const AIS_KindOfInteractive aGivenKind,
0063                                       const int                   aGivenSignature);
0064 
0065   //! Returns False if the transient is not an AIS_InteractiveObject.
0066   //! Returns False if the signature of InteractiveObject
0067   //! is not the same as the stored one in the filter...
0068   Standard_EXPORT bool IsOk(const occ::handle<SelectMgr_EntityOwner>& anobj) const override;
0069 
0070   DEFINE_STANDARD_RTTIEXT(AIS_SignatureFilter, AIS_TypeFilter)
0071 
0072 private:
0073   int mySig;
0074 };
0075 
0076 #endif // _AIS_SignatureFilter_HeaderFile