1 -- Created on: 1994-04-21
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1994-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
23 deferred class Signature from IFSelect inherits SignType from Interface
25 ---Purpose : Signature provides the basic service used by the classes
26 -- SelectSignature and Counter (i.e. Name, Value), which is :
27 -- - for an entity in a model, give a characteristic string, its
29 -- This string has not to be unique in the model, but gives a
30 -- value for such or such important feature.
31 -- Exemples : Dynamic Type; Category; etc
33 uses CString, Transient, AsciiString, HSequenceOfAsciiString from TColStd,
38 Initialize (name : CString);
39 ---Purpose : Initializes a Signature with its name
41 -- Possible Cases (for information and help choosing)
43 SetIntCase (me : mutable; hasmin : Boolean; valmin : Integer;
44 hasmax : Boolean; valmax : Integer);
45 ---Purpose : Sets the information data to tell "integer cases" with
46 -- possible min and max values
47 -- To be called when creating
49 IsIntCase (me; hasmin : out Boolean; valmin : out Integer;
50 hasmax : out Boolean; valmax : out Integer) returns Boolean;
51 ---Purpose : Tells if this Signature gives integer values
52 -- and returns values from SetIntCase if True
54 AddCase (me : mutable; acase : CString);
55 ---Purpose : Adds a possible case
56 -- To be called when creating, IF the list of possible cases for
57 -- Value is known when starting
58 -- For instance, for CDL types, rather do not fill this,
59 -- but for a specific enumeration (such as a status), can be used
61 CaseList (me) returns HSequenceOfAsciiString;
62 ---Purpose : Returns the predefined list of possible cases, filled by AddCase
63 -- Null Handle if no predefined list (hence, to be counted)
64 -- Useful to filter on really possible vase, for instance, or
68 Name (me) returns CString;
69 ---Purpose : Returns an identification of the Signature (a word), given at
70 -- initialization time
72 -- Value (me; ent : any Transient; model : InterfaceModel)
73 -- returns CString is deferred;
74 -- inherited from SignType
75 ---Purpose : Returns the Signature for a Transient object. It is specific
76 -- of each sub-class of Signature. For a Null Handle, it should
78 -- It can work with the model which contains the entity
80 Label (me) returns AsciiString;
81 ---Purpose : The label of a Signature uses its name as follow :
82 -- "Signature : <name>"
85 Matches (me; ent : Transient; model : InterfaceModel;
86 text : AsciiString; exact : Boolean)
87 returns Boolean is virtual;
88 ---Purpose : Tells if the value for <ent> in <model> matches a text, with
89 -- a criterium <exact>.
90 -- The default definition calls MatchValue
93 MatchValue (myclass; val : CString; text : AsciiString; exact : Boolean)
95 ---Purpose : Default procedure to tell if a value <val> matches a text
96 -- with a criterium <exact>. <exact> = True requires equality,
97 -- else only contained (no reg-exp)
99 IntValue (myclass; val : Integer) returns CString;
100 ---Purpose : This procedure converts an Integer to a CString
101 -- It is a convenient way when the value of a signature has the
102 -- form of a simple integer value
103 -- The value is to be used immediately (one buffer only, no copy)
107 thecasi : Integer[3];
108 thecasl : HSequenceOfAsciiString;
109 thename : AsciiString is protected;