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_Signature_HeaderFile
18 #define _IFSelect_Signature_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Integer.hxx>
24 #include <TColStd_HSequenceOfAsciiString.hxx>
25 #include <TCollection_AsciiString.hxx>
26 #include <Interface_SignType.hxx>
27 #include <Standard_CString.hxx>
28 #include <Standard_Boolean.hxx>
29 class TCollection_AsciiString;
30 class Standard_Transient;
31 class Interface_InterfaceModel;
34 class IFSelect_Signature;
35 DEFINE_STANDARD_HANDLE(IFSelect_Signature, Interface_SignType)
37 //! Signature provides the basic service used by the classes
38 //! SelectSignature and Counter (i.e. Name, Value), which is :
39 //! - for an entity in a model, give a characteristic string, its
41 //! This string has not to be unique in the model, but gives a
42 //! value for such or such important feature.
43 //! Exemples : Dynamic Type; Category; etc
44 class IFSelect_Signature : public Interface_SignType
50 //! Sets the information data to tell "integer cases" with
51 //! possible min and max values
52 //! To be called when creating
53 Standard_EXPORT void SetIntCase (const Standard_Boolean hasmin, const Standard_Integer valmin, const Standard_Boolean hasmax, const Standard_Integer valmax);
55 //! Tells if this Signature gives integer values
56 //! and returns values from SetIntCase if True
57 Standard_EXPORT Standard_Boolean IsIntCase (Standard_Boolean& hasmin, Standard_Integer& valmin, Standard_Boolean& hasmax, Standard_Integer& valmax) const;
59 //! Adds a possible case
60 //! To be called when creating, IF the list of possible cases for
61 //! Value is known when starting
62 //! For instance, for CDL types, rather do not fill this,
63 //! but for a specific enumeration (such as a status), can be used
64 Standard_EXPORT void AddCase (const Standard_CString acase);
66 //! Returns the predefined list of possible cases, filled by AddCase
67 //! Null Handle if no predefined list (hence, to be counted)
68 //! Useful to filter on really possible vase, for instance, or
70 Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) CaseList() const;
72 //! Returns an identification of the Signature (a word), given at
73 //! initialization time
74 //! Returns the Signature for a Transient object. It is specific
75 //! of each sub-class of Signature. For a Null Handle, it should
77 //! It can work with the model which contains the entity
78 Standard_EXPORT Standard_CString Name() const Standard_OVERRIDE;
80 //! The label of a Signature uses its name as follow :
81 //! "Signature : <name>"
82 Standard_EXPORT TCollection_AsciiString Label() const;
84 //! Tells if the value for <ent> in <model> matches a text, with
85 //! a criterium <exact>.
86 //! The default definition calls MatchValue
88 Standard_EXPORT virtual Standard_Boolean Matches (const Handle(Standard_Transient)& ent, const Handle(Interface_InterfaceModel)& model, const TCollection_AsciiString& text, const Standard_Boolean exact) const;
90 //! Default procedure to tell if a value <val> matches a text
91 //! with a criterium <exact>. <exact> = True requires equality,
92 //! else only contained (no reg-exp)
93 Standard_EXPORT static Standard_Boolean MatchValue (const Standard_CString val, const TCollection_AsciiString& text, const Standard_Boolean exact);
95 //! This procedure converts an Integer to a CString
96 //! It is a convenient way when the value of a signature has the
97 //! form of a simple integer value
98 //! The value is to be used immediately (one buffer only, no copy)
99 Standard_EXPORT static Standard_CString IntValue (const Standard_Integer val);
104 DEFINE_STANDARD_RTTIEXT(IFSelect_Signature,Interface_SignType)
109 //! Initializes a Signature with its name
110 Standard_EXPORT IFSelect_Signature(const Standard_CString name);
112 TCollection_AsciiString thename;
118 Standard_Integer thecasi[3];
119 Handle(TColStd_HSequenceOfAsciiString) thecasl;
130 #endif // _IFSelect_Signature_HeaderFile