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