b311480e |
1 | -- Created on: 1997-12-10 |
2 | -- Created by: Denis PASCAL |
3 | -- Copyright (c) 1997-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class Variable from TDataStd inherits Attribute from TDF |
18 | |
19 | ---Purpose: Variable attribute. |
20 | -- ================== |
21 | -- |
22 | -- * A variable is associated to a TDataStd_Real (which |
23 | -- contains its current value) and a TDataStd_Name |
24 | -- attribute (which contains its name). It contains a |
25 | -- constant flag, and a Unit |
26 | -- |
27 | -- * An expression may be assigned to a variable. In |
28 | -- thatcase the expression is handled by the associated |
29 | -- Expression Attribute and the Variable returns True to |
30 | -- the method <IsAssigned>. |
31 | |
32 | |
33 | uses Attribute from TDF, |
34 | Label from TDF, |
35 | ExtendedString from TCollection, |
36 | Real from TDataStd, |
37 | Expression from TDataStd, |
38 | GUID from Standard, |
39 | Real from Standard, |
40 | RealEnum from TDataStd, |
41 | DataSet from TDF, |
42 | RelocationTable from TDF, |
43 | AsciiString from TCollection |
44 | |
45 | |
46 | is |
47 | |
48 | ---Purpose: class methods |
49 | -- ============= |
50 | |
51 | GetID (myclass) |
52 | ---C++: return const & |
53 | returns GUID from Standard; |
54 | |
55 | Set (myclass ; label : Label from TDF) |
56 | ---Purpose: Find, or create, a Variable attribute. |
57 | returns Variable from TDataStd; |
58 | |
59 | ---Purpose: Real methods |
60 | -- ============ |
61 | |
62 | Create |
6e33d3ce |
63 | returns Variable from TDataStd; |
7fd59977 |
64 | |
65 | Name (me : mutable; string : ExtendedString from TCollection); |
66 | ---Purpose: set or change the name of the variable, in myUnknown |
67 | -- and my associated Name attribute. |
68 | |
69 | Name (me) |
70 | returns ExtendedString from TCollection; |
71 | ---Purpose: returns string stored in the associated Name |
72 | -- attribute. |
73 | ---C++: return const & |
74 | |
75 | Set (me; value : Real from Standard; dimension : RealEnum from TDataStd = TDataStd_SCALAR); |
76 | ---Purpose: retrieve or create the associated real attribute and |
77 | -- set the value <value>. if creation, dimension is |
78 | -- written. |
79 | |
80 | IsValued (me) |
81 | ---Purpose: returns True if a Real attribute is associated. |
82 | returns Boolean from Standard; |
83 | |
84 | Get (me) |
85 | ---Purpose: returns value stored in associated Real attribute. |
86 | returns Real from Standard; |
87 | |
88 | Real (me) |
89 | ---Purpose: returns associated Real attribute. |
90 | returns Real from TDataStd; |
91 | |
92 | IsAssigned (me) returns Boolean; |
93 | ---Purpose: returns True if an Expression attribute is associated. |
94 | |
95 | -- Assign (me; E : GeneralExpression from Expr) |
96 | ---Purpose: create(if doesn't exist), set and returns the assigned |
97 | -- expression attribute. |
98 | --returns Expression from TDataStd; |
99 | |
100 | Assign (me) |
101 | ---Purpose: create(if doesn't exist) and returns the assigned |
102 | -- expression attribute. fill it after. |
103 | returns Expression from TDataStd; |
104 | |
105 | Desassign (me); |
106 | ---Purpose: if <me> is assigned delete the associated expression |
107 | -- attribute. |
108 | |
109 | Expression (me) |
110 | ---Purpose: if <me> is assigned, returns associated Expression |
111 | -- attribute. |
112 | returns Expression from TDataStd; |
113 | |
114 | IsCaptured (me) returns Boolean; |
115 | ---Purpose: shortcut for <Real()->IsCaptured()> |
116 | |
117 | IsConstant (me) |
118 | ---Purpose: A constant value is not modified by regeneration. |
119 | returns Boolean from Standard; |
120 | |
121 | Unit (me:mutable; unit : AsciiString from TCollection); |
122 | |
123 | Unit (me) |
124 | ---C++: return const & |
125 | returns AsciiString from TCollection; |
126 | |
127 | ---Purpose: to read/write fields |
128 | -- =================== |
129 | |
130 | Constant (me : mutable; status : Boolean from Standard); |
131 | ---Purpose: if <status> is True, this variable will not be |
132 | -- modified by the solver. |
133 | |
134 | ---Category: TDF_Attribute methods |
135 | -- ===================== |
136 | |
137 | ID (me) |
138 | ---C++: return const & |
139 | returns GUID from Standard; |
140 | |
141 | Restore (me: mutable; With : Attribute from TDF); |
142 | |
143 | NewEmpty(me) |
6e33d3ce |
144 | returns Attribute from TDF; |
7fd59977 |
145 | |
6e33d3ce |
146 | Paste (me; Into : Attribute from TDF; |
147 | RT : RelocationTable from TDF); |
7fd59977 |
148 | |
149 | References (me; DS : DataSet from TDF) |
150 | ---Purpose: to export reference to the associated Name attribute. |
151 | is redefined; |
152 | |
153 | Dump(me; anOS : in out OStream from Standard) |
154 | returns OStream from Standard |
155 | is redefined; |
156 | ---C++: return & |
157 | |
158 | fields |
159 | |
160 | isConstant : Boolean from Standard; |
161 | myUnit : AsciiString from TCollection; |
162 | |
163 | end Variable; |