42cf5bc1 |
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 |
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 _IFSelect_SelectSignature_HeaderFile |
18 | #define _IFSelect_SelectSignature_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
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; |
36 | |
37 | |
38 | class IFSelect_SelectSignature; |
39 | DEFINE_STANDARD_HANDLE(IFSelect_SelectSignature, IFSelect_SelectExtract) |
40 | |
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) |
45 | //! |
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 |
49 | //! |
50 | //! Also, numeric (integer) comparisons are supported : an item |
51 | //! can be <val ou <=val or >val or >=val , val being an Integer |
52 | //! |
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 |
56 | { |
57 | |
58 | public: |
59 | |
60 | |
61 | //! Creates a SelectSignature with its Signature and its Text to |
62 | //! Match. |
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); |
67 | |
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); |
70 | |
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); |
76 | |
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; |
80 | |
81 | //! Returns the used SignCounter. Can be used as alternative for |
82 | //! Signature |
83 | Standard_EXPORT Handle(IFSelect_SignCounter) Counter() const; |
84 | |
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; |
89 | |
90 | //! Not called, defined only to remove a deferred method here |
79104795 |
91 | Standard_EXPORT Standard_Boolean Sort (const Standard_Integer rank, const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model) const Standard_OVERRIDE; |
42cf5bc1 |
92 | |
93 | //! Returns Text used to Sort Entity on its Signature or SignCounter |
94 | Standard_EXPORT const TCollection_AsciiString& SignatureText() const; |
95 | |
96 | //! Returns True if match must be exact |
97 | Standard_EXPORT Standard_Boolean IsExact() const; |
98 | |
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) |
79104795 |
102 | Standard_EXPORT TCollection_AsciiString ExtractLabel() const Standard_OVERRIDE; |
42cf5bc1 |
103 | |
104 | |
105 | |
106 | |
92efcf78 |
107 | DEFINE_STANDARD_RTTIEXT(IFSelect_SelectSignature,IFSelect_SelectExtract) |
42cf5bc1 |
108 | |
109 | protected: |
110 | |
111 | |
112 | |
113 | |
114 | private: |
115 | |
116 | |
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; |
123 | |
124 | |
125 | }; |
126 | |
127 | |
128 | |
129 | |
130 | |
131 | |
132 | |
133 | #endif // _IFSelect_SelectSignature_HeaderFile |