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
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 class SelectMember from StepData inherits TShared
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)
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
36 -- It is also possible to define a specific subtype by redefining
37 -- virtual method, then give a better control
39 -- Remark : this class itself could be deferred, because at least
40 -- one of its virtual methods must be redefined to be usable
42 uses CString, ParamType from Interface, Logical from StepData
46 Create returns mutable SelectMember;
47 -- this constructor is useless, the class is empty
49 HasName (me) returns Boolean is virtual;
50 ---Purpose : Tells if a SelectMember has a name. Default is False
52 Name (me) returns CString is virtual;
53 ---Purpose : Returns the name of a SelectMember. Default is empty
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
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)
64 Kind (me) returns Integer is virtual;
65 -- see Field for Kind (same codes)
67 SetKind (me : mutable; kind : Integer) is virtual;
68 -- called by various Set*
70 ParamType (me) returns ParamType from Interface;
71 ---Purpose : Returns the Kind of the SelectMember, under the form of an
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)
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)
82 Integer (me) returns Integer;
83 ---Purpose : Gets the value as an Integer
85 SetInteger (me : mutable; val : Integer);
87 Boolean (me) returns Boolean;
89 SetBoolean (me : mutable; val : Boolean);
91 Logical (me) returns Logical;
93 SetLogical (me : mutable; val : Logical);
95 Real (me) returns Real is virtual;
97 SetReal (me : mutable; val : Real) is virtual;
99 String (me) returns CString is virtual;
101 SetString (me : mutable; val : CString) is virtual;
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
108 SetEnum (me : mutable; val : Integer; text : CString = "");
109 -- calls SetInt (for val) and SetEnumText (see below)
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