b311480e |
1 | -- Created on: 1996-12-16 |
2 | -- Created by: Christian CAILLET |
3 | -- Copyright (c) 1996-1999 Matra Datavision |
4 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
5 | -- |
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. |
10 | -- |
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. |
13 | -- |
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. |
20 | |
7fd59977 |
21 | |
22 | |
23 | class SelectMember from StepData inherits TShared |
24 | |
25 | ---Purpose : The general form for a Select Member. A Select Member can, |
26 | -- either define a value of a basic type (such as an integer) |
27 | -- with an additional information : a name or list of names |
28 | -- which precise the meaning of this value |
29 | -- or be an alternate value in a select, which also accepts an |
30 | -- entity (in this case, the name is not mandatory) |
31 | -- |
32 | -- Several sub-types of SelectMember are defined for integer and |
33 | -- real value, plus an "universal" one for any, and one more to |
34 | -- describe a select with several names |
35 | -- |
36 | -- It is also possible to define a specific subtype by redefining |
37 | -- virtual method, then give a better control |
38 | -- |
39 | -- Remark : this class itself could be deferred, because at least |
40 | -- one of its virtual methods must be redefined to be usable |
41 | |
42 | uses CString, ParamType from Interface, Logical from StepData |
43 | |
44 | is |
45 | |
46 | Create returns mutable SelectMember; |
47 | -- this constructor is useless, the class is empty |
48 | |
49 | HasName (me) returns Boolean is virtual; |
50 | ---Purpose : Tells if a SelectMember has a name. Default is False |
51 | |
52 | Name (me) returns CString is virtual; |
53 | ---Purpose : Returns the name of a SelectMember. Default is empty |
54 | |
55 | SetName (me : mutable; name : CString) returns Boolean is virtual; |
56 | ---Purpose : Sets the name of a SelectMember, returns True if done, False |
57 | -- if no name is allowed |
58 | -- Default does nothing and returns False |
59 | |
60 | Matches (me; name : CString) returns Boolean is virtual; |
61 | ---Purpose : Tells if the name of a SelectMember matches a given one |
62 | -- By default, compares the strings, can be redefined (optimised) |
63 | |
64 | Kind (me) returns Integer is virtual; |
65 | -- see Field for Kind (same codes) |
66 | |
67 | SetKind (me : mutable; kind : Integer) is virtual; |
68 | -- called by various Set* |
69 | |
70 | ParamType (me) returns ParamType from Interface; |
71 | ---Purpose : Returns the Kind of the SelectMember, under the form of an |
72 | -- enum ParamType |
73 | |
74 | Int (me) returns Integer is virtual; |
75 | ---Purpose : This internal method gives access to a value implemented by an |
76 | -- Integer (to read it) |
77 | |
78 | SetInt (me : mutable; val : Integer) is virtual; |
79 | ---Purpose : This internal method gives access to a value implemented by an |
80 | -- Integer (to set it) |
81 | |
82 | Integer (me) returns Integer; |
83 | ---Purpose : Gets the value as an Integer |
84 | |
85 | SetInteger (me : mutable; val : Integer); |
86 | |
87 | Boolean (me) returns Boolean; |
88 | |
89 | SetBoolean (me : mutable; val : Boolean); |
90 | |
91 | Logical (me) returns Logical; |
92 | |
93 | SetLogical (me : mutable; val : Logical); |
94 | |
95 | Real (me) returns Real is virtual; |
96 | |
97 | SetReal (me : mutable; val : Real) is virtual; |
98 | |
99 | String (me) returns CString is virtual; |
100 | |
101 | SetString (me : mutable; val : CString) is virtual; |
102 | |
103 | Enum (me) returns Integer; |
104 | EnumText (me) returns CString is virtual; |
105 | -- By default, returns the String |
106 | -- Can be redefined to return a String for instance bound with int value |
107 | |
108 | SetEnum (me : mutable; val : Integer; text : CString = ""); |
109 | -- calls SetInt (for val) and SetEnumText (see below) |
110 | |
111 | SetEnumText (me : mutable; val : Integer; text : CString) is virtual; |
112 | -- By default, calls SetString and disregards val |
113 | -- It is enough for standard subtypes |
114 | -- Can be redefined for a check on text and/or control of val and/or set |
115 | -- val according to text |
116 | |
117 | end SelectMember; |