1 // Created on: 1994-04-21
2 // Created by: Christian CAILLET
3 // Copyright (c) 1994-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 _IFSelect_SelectSignature_HeaderFile
18 #define _IFSelect_SelectSignature_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TCollection_AsciiString.hxx>
24 #include <Standard_Integer.hxx>
25 #include <TColStd_SequenceOfAsciiString.hxx>
26 #include <TColStd_SequenceOfInteger.hxx>
27 #include <IFSelect_SelectExtract.hxx>
28 #include <Standard_CString.hxx>
29 #include <Standard_Boolean.hxx>
30 class IFSelect_Signature;
31 class IFSelect_SignCounter;
32 class TCollection_AsciiString;
33 class Standard_Transient;
34 class Interface_Graph;
35 class Interface_InterfaceModel;
38 class IFSelect_SelectSignature;
39 DEFINE_STANDARD_HANDLE(IFSelect_SelectSignature, IFSelect_SelectExtract)
41 //! A SelectSignature sorts the Entities on a Signature Matching.
42 //! The signature to match is given at creation time. Also, the
43 //! required match is given at creation time : exact (IsEqual) or
44 //! contains (the Type's Name must contain the criterium Text)
46 //! Remark that no more interpretation is done, it is an
47 //! alpha-numeric signature : for instance, DynamicType is matched
48 //! as such, super-types are not considered
50 //! Also, numeric (integer) comparisons are supported : an item
51 //! can be <val ou <=val or >val or >=val , val being an Integer
53 //! A SelectSignature may also be created from a SignCounter,
54 //! which then just gives its LastValue as SignatureValue
55 class IFSelect_SelectSignature : public IFSelect_SelectExtract
61 //! Creates a SelectSignature with its Signature and its Text to
63 //! <exact> if True requires exact match,
64 //! if False requires <signtext> to be contained in the Signature
65 //! of the entity (default is "exact")
66 Standard_EXPORT IFSelect_SelectSignature(const Handle(IFSelect_Signature)& matcher, const Standard_CString signtext, const Standard_Boolean exact = Standard_True);
68 //! As above with an AsciiString
69 Standard_EXPORT IFSelect_SelectSignature(const Handle(IFSelect_Signature)& matcher, const TCollection_AsciiString& signtext, const Standard_Boolean exact = Standard_True);
71 //! Creates a SelectSignature with a Counter, more precisely a
72 //! SelectSignature. Which is used here to just give a Signature
73 //! Value (by SignOnly Mode)
74 //! Matching is the default provided by the class Signature
75 Standard_EXPORT IFSelect_SelectSignature(const Handle(IFSelect_SignCounter)& matcher, const Standard_CString signtext, const Standard_Boolean exact = Standard_True);
77 //! Returns the used Signature, then it is possible to access it,
78 //! modify it as required. Can be null, hence see Counter
79 Standard_EXPORT Handle(IFSelect_Signature) Signature() const;
81 //! Returns the used SignCounter. Can be used as alternative for
83 Standard_EXPORT Handle(IFSelect_SignCounter) Counter() const;
85 //! Returns True for an Entity (model->Value(num)) of which the
86 //! signature matches the text given as creation time
87 //! May also work with a Counter from the Graph
88 Standard_EXPORT virtual Standard_Boolean SortInGraph (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Interface_Graph& G) const Standard_OVERRIDE;
90 //! Not called, defined only to remove a deferred method here
91 Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE;
93 //! Returns Text used to Sort Entity on its Signature or SignCounter
94 Standard_EXPORT const TCollection_AsciiString& SignatureText() const;
96 //! Returns True if match must be exact
97 Standard_EXPORT Standard_Boolean IsExact() const;
99 //! Returns a text defining the criterium.
100 //! (it refers to the text and exact flag to be matched, and is
101 //! qualified by the Name provided by the Signature)
102 Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE;
107 DEFINE_STANDARD_RTTIEXT(IFSelect_SelectSignature,IFSelect_SelectExtract)
117 Handle(IFSelect_Signature) thematcher;
118 Handle(IFSelect_SignCounter) thecounter;
119 TCollection_AsciiString thesigntext;
120 Standard_Integer theexact;
121 TColStd_SequenceOfAsciiString thesignlist;
122 TColStd_SequenceOfInteger thesignmode;
133 #endif // _IFSelect_SelectSignature_HeaderFile