Commit | Line | Data |
---|---|---|
b311480e | 1 | -- Created on: 1992-12-15 |
2 | -- Created by: Christian CAILLET | |
3 | -- Copyright (c) 1992-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 WorkSession from IFSelect inherits TShared | |
18 | ||
19 | ---Purpose : This class can be used to simply manage a process such as | |
20 | -- splitting a file, extracting a set of Entities ... | |
21 | -- It allows to manage different types of Variables : Integer or | |
22 | -- Text Parameters, Selections, Dispatches, in addition to a | |
23 | -- ShareOut. To each of these variables, a unique Integer | |
24 | -- Identifier is attached. A Name can be attached too as desired. | |
25 | ||
26 | uses CString, AsciiString from TCollection, HAsciiString from TCollection, | |
27 | Messenger from Message, | |
28 | SequenceOfHAsciiString from TColStd, HSequenceOfHAsciiString from TColStd, | |
29 | DictionaryOfInteger from Dico, | |
30 | Type, SequenceOfTransient from TColStd, SequenceOfInteger from TColStd, | |
31 | HSequenceOfInteger from TColStd, HArray1OfInteger from TColStd, | |
32 | DictionaryOfTransient from Dico, IndexedDataMapOfTransientTransient, | |
33 | Transient, HSequenceOfTransient from TColStd, | |
34 | InterfaceModel from Interface, EntityIterator from Interface, | |
35 | Protocol from Interface, HGraph from Interface, Graph from Interface, | |
36 | CheckIterator from Interface, GTool from Interface, | |
37 | ShareOut, IntParam, Signature, Selection, Dispatch, WorkLibrary, | |
38 | ModelCopier, GeneralModifier, Modifier, Transformer, | |
39 | SelectionIterator, PacketList, SignatureList, SignCounter, | |
40 | ReturnStatus, RemainMode, PrintCount | |
41 | ||
42 | raises DomainError | |
43 | ||
44 | is | |
45 | ||
46 | -- -- General Management -- -- | |
47 | ||
6e33d3ce | 48 | Create returns WorkSession; |
7fd59977 | 49 | ---Purpose : Creates a Work Session |
50 | -- It provides default, empty ShareOut and ModelCopier, which can | |
51 | -- be replaced (if required, should be done just after creation). | |
52 | ||
53 | SetErrorHandle (me : mutable; hand : Boolean); | |
54 | ---Purpose : Changes the Error Handler status (by default, it is not set) | |
55 | ||
56 | ErrorHandle (me) returns Boolean; | |
57 | ---Purpose : Returns the Error Handler status | |
58 | ||
6e33d3ce | 59 | ShareOut (me) returns ShareOut; |
7fd59977 | 60 | ---Purpose : Returns the ShareOut defined at creation time |
61 | ---C++ : return const & | |
62 | ||
6e33d3ce | 63 | SetShareOut (me : mutable; shareout : ShareOut); |
7fd59977 | 64 | ---Purpose : Sets a new ShareOut. Fills Items which its content |
65 | -- Warning : data from the former ShareOut are lost | |
bc650d41 G |
66 | |
67 | SetModeStat(me : mutable; theMode : Boolean); | |
68 | ---Purpose : Set value of mode responsible for precence of selections after loading | |
69 | -- If mode set to true that different selections will be accessible after loading | |
70 | -- else selections will be not accessible after loading( for economy memory in applicatios) | |
71 | ||
72 | GetModeStat(me) returns Boolean from Standard; | |
73 | ---Purpose : Return value of mode defining of filling selection during loading | |
7fd59977 | 74 | |
75 | ||
76 | SetLibrary (me : mutable; lib : WorkLibrary); | |
77 | ---Purpose : Sets a WorkLibrary, which will be used to Read and Write Files | |
78 | ||
79 | WorkLibrary (me) returns WorkLibrary; | |
80 | ---Purpose : Returns the WorkLibrary. Null Handle if not yet set | |
81 | -- should be C++ : return const & | |
82 | ||
83 | SetProtocol (me : mutable; protocol : Protocol from Interface); | |
84 | ---Purpose : Sets a Protocol, which will be used to determine Graphs, to | |
85 | -- Read and to Write Files | |
86 | ||
87 | Protocol (me) returns Protocol; | |
88 | ---Purpose : Returns the Protocol. Null Handle if not yet set | |
89 | -- should be C++ : return const & | |
90 | ||
91 | SetSignType (me : mutable; signtype : Signature); | |
92 | ---Purpose : Sets a specific Signature to be the SignType, i.e. the | |
93 | -- Signature which will determine TypeName from the Model | |
94 | -- (basic function). It is recorded in the GTool | |
95 | -- This Signature is also set as "xst-sign-type" (reserved name) | |
96 | -- | |
97 | ||
98 | SignType (me) returns Signature; | |
99 | ---Purpose : Returns the current SignType | |
100 | ||
101 | ||
102 | HasModel (me) returns Boolean; | |
103 | ---Purpose : Returns True is a Model has been set | |
104 | ||
105 | SetModel (me : mutable; model : InterfaceModel; | |
106 | clearpointed : Boolean = Standard_True); | |
107 | ---Purpose : Sets a Model as input : this will be the Model from which the | |
108 | -- ShareOut will work | |
109 | -- if <clearpointed> is True (default) all SelectPointed items | |
110 | -- are cleared, else they must be managed by the caller | |
111 | -- Remark : SetModel clears the Graph, recomputes it if a | |
112 | -- Protocol is set and if the Model is not empty, of course | |
113 | ||
114 | Model (me) returns InterfaceModel; | |
115 | ---Purpose : Returns the Model of the Work Session (Null Handle if none) | |
116 | -- should be C++ : return const & | |
117 | ||
118 | SetLoadedFile (me : mutable; filename : CString); | |
119 | ---Purpose : Stores the filename used for read for setting the model | |
120 | -- It is cleared by SetModel and ClearData(1) | |
121 | ||
122 | LoadedFile (me) returns CString; | |
123 | ---Purpose : Returns the filename used to load current model | |
124 | -- empty if unknown | |
125 | ||
126 | ReadFile (me : mutable; filename : CString) returns ReturnStatus; | |
127 | ---Purpose : Reads a file with the WorkLibrary (sets Model and LoadedFile) | |
128 | -- Returns a integer status which can be : | |
129 | -- RetDone if OK, RetVoid if no Protocol not defined, | |
130 | -- RetError for file not found, RetFail if fail during read | |
131 | ||
132 | NbStartingEntities (me) returns Integer; | |
133 | ---Purpose : Returns the count of Entities stored in the Model, or 0 | |
134 | ||
135 | StartingEntity (me; num : Integer) returns Transient; | |
136 | ---Purpose : Returns an Entity stored in the Model of the WorkSession | |
137 | -- (Null Handle is no Model or num out of range) | |
138 | ||
139 | StartingNumber (me; ent : Transient) returns Integer; | |
140 | ---Purpose : Returns the Number of an Entity in the Model | |
141 | -- (0 if no Model set or <ent> not in the Model) | |
142 | ||
143 | NumberFromLabel (me; val : CString; afternum : Integer= 0) returns Integer; | |
144 | ---Purpose : From a given label in Model, returns the corresponding number | |
145 | -- Starts from first entity by Default, may start after a given | |
146 | -- number : this number may be given negative, its absolute value | |
147 | -- is then considered. Hence a loop on NumberFromLabel may be | |
148 | -- programmed (stop test is : returned value positive or null) | |
149 | -- | |
150 | -- Returns 0 if not found, < 0 if more than one found (first | |
151 | -- found in negative). | |
152 | -- If <val> just gives an integer value, returns it | |
153 | ||
154 | EntityLabel (me; ent : Transient) returns HAsciiString from TCollection; | |
155 | ---Purpose : Returns the label for <ent>, as the Model does | |
156 | -- If <ent> is not in the Model or if no Model is loaded, a Null | |
157 | -- Handle is returned | |
158 | ||
159 | EntityName (me; ent : Transient) returns HAsciiString from TCollection; | |
160 | ---Purpose : Returns the Name of an Entity | |
161 | -- This Name is computed by the general service Name | |
162 | -- Returns a Null Handle if fails | |
163 | ||
164 | CategoryNumber (me; ent : Transient) returns Integer; | |
165 | ---Purpose : Returns the Category Number determined for an entity | |
166 | -- it is computed by the class Category | |
167 | -- An unknown entity (number 0) gives a value -1 | |
168 | ||
169 | CategoryName (me; ent : Transient) returns CString; | |
170 | ---Purpose : Returns the Category Name determined for an entity | |
171 | -- it is computed by the class Category | |
172 | -- Remark : an unknown entity gives an empty string | |
173 | ||
174 | ValidityName (me; ent : Transient) returns CString; | |
175 | ---Purpose : Returns the Validity Name determined for an entity | |
176 | -- it is computed by the class SignValidity | |
177 | -- Remark : an unknown entity gives an empty string | |
178 | ||
179 | ClearData (me : mutable; mode : Integer) is virtual; | |
180 | ---Purpose : Clears recorded data (not the items) according mode : | |
181 | -- 1 : all Data : Model, Graph, CheckList, + ClearData 4 | |
182 | -- 2 : Graph and CheckList (they will then be recomputed later) | |
183 | -- 3 : CheckList (it will be recomputed by ComputeCheck) | |
184 | -- 4 : just content of SelectPointed and Counters | |
185 | -- Plus 0 : does nothing but called by SetModel | |
186 | -- ClearData is virtual, hence it can be redefined to clear | |
187 | -- other data of a specialised Work Session | |
188 | ||
189 | ComputeGraph (me : mutable; enforce : Boolean = Standard_False) returns Boolean; | |
190 | ---Purpose : Computes the Graph used for Selections, Displays ... | |
191 | -- If a HGraph is already set, with same model as given by method | |
192 | -- Model, does nothing. Else, computes a new Graph. | |
193 | -- If <enforce> is given True, computes a new Graph anyway. | |
194 | -- Remark that a call to ClearGraph will cause ComputeGraph to | |
195 | -- really compute a new Graph | |
196 | -- Returns True if Graph is OK, False else (i.e. if no Protocol | |
197 | -- is set, or if Model is absent or empty). | |
198 | ||
199 | HGraph (me : mutable) returns HGraph; | |
200 | ---Purpose : Returns the Computed Graph as HGraph (Null Handle if not set) | |
201 | ||
202 | Graph (me : mutable) returns Graph | |
203 | ---Purpose : Returns the Computed Graph, for Read only | |
204 | raises DomainError; | |
205 | -- Error if the Graph is not available | |
206 | ---C++ : return const & | |
207 | ||
208 | Shareds (me : mutable; ent : Transient) returns HSequenceOfTransient; | |
209 | ---Purpose : Returns the list of entities shared by <ent> (can be empty) | |
210 | -- Returns a null Handle if <ent> is unknown | |
211 | ||
212 | Sharings (me : mutable; ent : Transient) returns HSequenceOfTransient; | |
213 | ---Purpose : Returns the list of entities sharing <ent> (can be empty) | |
214 | -- Returns a null Handle if <ent> is unknown | |
215 | ||
216 | IsLoaded (me) returns Boolean; | |
217 | ---Purpose : Returns True if a Model is defined and really loaded (not | |
218 | -- empty), a Protocol is set and a Graph has been computed. | |
219 | -- In this case, the WorkSession can start to work | |
220 | ||
221 | ComputeCheck (me : mutable; enforce : Boolean = Standard_False) | |
222 | returns Boolean; | |
223 | ---Purpose : Computes the CheckList for the Model currently loaded | |
224 | -- It can then be used for displays, querries ... | |
225 | -- Returns True if OK, False else (i.e. no Protocol set, or Model | |
226 | -- absent). If <enforce> is False, works only if not already done | |
227 | -- or if a new Model has been loaded from last call. | |
228 | -- Remark : computation is enforced by every call to | |
229 | -- SetModel or RunTransformer | |
230 | ||
231 | ModelCheckList (me : mutable; complete : Boolean = Standard_True) | |
232 | returns CheckIterator; | |
233 | ---Purpose : Returns the Check List for the Model currently loaded : | |
234 | -- <complete> = True : complete (syntactic & semantic messages), | |
235 | -- computed if not yet done | |
236 | -- <complete> = False : only syntactic (check file form) | |
237 | ||
238 | CheckOne (me : mutable; ent : Transient; complete : Boolean = Standard_True) | |
239 | returns CheckIterator; | |
240 | ---Purpose : Returns a Check for a single entity, under the form of a | |
241 | -- CheckIterator (this gives only one form for the user) | |
242 | -- if <ent> is Null or equates the current Model, it gives the | |
243 | -- Global Check, else the Check for the given entity | |
244 | -- <complete> as for ModelCheckList | |
245 | ||
246 | LastRunCheckList (me) returns CheckIterator; | |
247 | ---Purpose : Returns the Check List produced by the last execution of | |
248 | -- either : EvaluateFile(for Split), SendSplit, SendAll, | |
249 | -- SendSelected, RunTransformer-RunModifier | |
250 | -- Cleared by SetModel or ClearData(1) | |
251 | -- The field is protected, hence a specialized WorkSession may | |
252 | -- fill it | |
253 | ||
254 | -- -- General Management on Items (and Names) -- -- | |
255 | ||
256 | MaxIdent (me) returns Integer; | |
257 | ---Purpose : Returns the Maximum Value for an Item Identifier. It can be | |
258 | -- greater to the count of known Items, because some can have | |
259 | -- been removed | |
260 | ||
6e33d3ce | 261 | Item (me; id : Integer) returns Transient; |
7fd59977 | 262 | ---Purpose : Returns an Item, given its Ident. Returns a Null Handle if |
263 | -- no Item corresponds to this Ident. | |
264 | ||
265 | ItemIdent (me; item : Transient) returns Integer; | |
266 | ---Purpose : Returns the Ident attached to an Item in the WorkSession, or | |
267 | -- Zero if it is unknown | |
268 | ||
6e33d3ce | 269 | NamedItem (me; name : CString) returns Transient; |
7fd59977 | 270 | ---Purpose : Returns the Item which corresponds to a Variable, given its |
271 | -- Name (whatever the type of this Item). | |
272 | -- Returns a Null Handle if this Name is not recorded | |
273 | ||
6e33d3ce | 274 | NamedItem (me; name : HAsciiString from TCollection) returns Transient; |
7fd59977 | 275 | ---Purpose : Same as above, but <name> is given through a Handle |
276 | -- Especially Usefull with methods SelectionNames, etc... | |
277 | ||
278 | NameIdent (me; name : CString) returns Integer; | |
279 | ---Purpose : Returns the Ident attached to a Name, 0 if name not recorded | |
280 | ||
281 | HasName (me; item : Transient) returns Boolean; | |
282 | ---Purpose : Returns True if an Item of the WorkSession has an attached Name | |
283 | ||
284 | Name (me; item : Transient) returns HAsciiString from TCollection; | |
285 | ---Purpose : Returns the Name attached to an Item as a Variable of this | |
286 | -- WorkSession. If <item> is Null or not recorded, returns an | |
287 | -- empty string. | |
288 | ||
6e33d3ce | 289 | AddItem (me : mutable; item : Transient; |
7fd59977 | 290 | active : Boolean = Standard_True) returns Integer; |
291 | ---Purpose : Adds an Item and returns its attached Ident. Does nothing | |
292 | -- if <item> is already recorded (and returns its attached Ident) | |
293 | -- <active> if True commands call to SetActive (see below) | |
294 | -- Remark : the determined Ident is used if <item> is a Dispatch, | |
295 | -- to fill the ShareOut | |
296 | ||
6e33d3ce | 297 | AddNamedItem (me : mutable; name : CString; item : Transient; |
7fd59977 | 298 | active : Boolean = Standard_True) returns Integer; |
299 | ---Purpose : Adds an Item with an attached Name. If the Name is already | |
300 | -- known in the WorkSession, the older item losts it | |
301 | -- Returns Ident if Done, 0 else, i.e. if <item> is null | |
302 | -- If <name> is empty, works as AddItem (i.e. with no name) | |
303 | -- If <item> is already known but with no attached Name, this | |
304 | -- method tries to attached a Name to it | |
305 | -- <active> if True commands call to SetActive (see below) | |
306 | ||
6e33d3ce | 307 | SetActive (me : mutable; item : Transient; mode : Boolean) |
7fd59977 | 308 | returns Boolean; |
309 | ---Purpose : Following the type of <item> : | |
310 | -- - Dispatch : Adds or Removes it in the ShareOut & FileNaming | |
311 | -- - GeneralModifier : Adds or Removes it for final sending | |
312 | -- (i.e. in the ModelCopier) | |
313 | -- Returns True if it did something, False else (state unchanged) | |
314 | ||
315 | RemoveNamedItem (me : mutable; name : CString) returns Boolean; | |
316 | ---Purpose : Removes an Item from the Session, given its Name | |
317 | -- Returns True if Done, False else (Name not recorded) | |
318 | -- (Applies only on Item which are Named) | |
319 | ||
320 | RemoveName (me : mutable; name : CString) returns Boolean; | |
321 | ---Purpose : Removes a Name without removing the Item | |
322 | -- Returns True if Done, False else (Name not recorded) | |
323 | ||
324 | RemoveItem (me : mutable; item : Transient) returns Boolean; | |
325 | ---Purpose : Removes an Item given its Ident. Returns False if <id> is | |
326 | -- attached to no Item in the WorkSession. For a Named Item, | |
327 | -- also removes its Name. | |
328 | ||
329 | ClearItems (me : mutable); | |
330 | ---Purpose : Clears all the recorded Items : Selections, Dispatches, | |
331 | -- Modifiers, and Strings & IntParams, with their Idents & Names. | |
332 | -- Remark that if a Model has been loaded, it is not cleared. | |
333 | ||
334 | ItemLabel (me; id : Integer) returns HAsciiString from TCollection; | |
335 | ---Purpose : Returns a Label which illustrates the content of an Item, | |
336 | -- given its Ident. This Label is : | |
337 | -- - for a Text Parameter, "Text:<text value>" | |
338 | -- - for an Integer Parameter, "Integer:<integer value>" | |
339 | -- - for a Selection, a Dispatch or a Modifier, its Label | |
340 | -- (see these classes) | |
341 | -- - for any other kind of Variable, its cdl type | |
342 | ||
343 | ItemIdents (me; type : Type) returns HSequenceOfInteger from TColStd; | |
344 | ---Purpose : Fills a Sequence with the List of Idents attached to the Items | |
345 | -- of which Type complies with (IsKind) <type> (alphabetic order) | |
346 | -- Remark : <type> = TYPE(Standard_Transient) gives all the | |
347 | -- Idents which are suitable in the WorkSession | |
348 | ||
349 | ItemNames (me; type : Type) returns HSequenceOfHAsciiString from TColStd; | |
350 | ---Purpose : Fills a Sequence with the list of the Names attached to Items | |
351 | -- of which Type complies with (IsKind) <type> (alphabetic order) | |
352 | -- Remark : <type> = TYPE(Standard_Transient) gives all the Names | |
353 | ||
354 | ItemNamesForLabel (me; label : CString) returns HSequenceOfHAsciiString; | |
355 | ---Purpose : Fills a Sequence with the NAMES of the control items, of which | |
356 | -- the label matches <label> (contain it) : see NextIdentForLabel | |
357 | -- Search mode is fixed to "contained" | |
358 | -- If <label> is empty, returns all Names | |
359 | ||
360 | NextIdentForLabel (me; label : CString; id : Integer; mode : Integer = 0) | |
361 | returns Integer; | |
362 | ---Purpose : For query by Label with possible iterations | |
363 | -- Searches the Ident of which Item has a Label which matches a | |
364 | -- given one, the search starts from an initial Ident. | |
365 | -- Returns the first found Ident which follows <id>, or ZERO | |
366 | -- | |
367 | -- The search must start with <id> = 0, it returns the next Ident | |
368 | -- which matches. To iterate, call again this method which this | |
369 | -- returned value as <id>. Once an Ident has been returned, the | |
370 | -- Item can be obtained by the method Item | |
371 | -- | |
372 | -- <mode> precises the required matching mode : | |
373 | -- - 0 (Default) : <label> must match exactly with the Item Label | |
374 | -- - 1 : <label> must match the exact beginning (the end is free) | |
375 | -- - 2 : <label> must be at least once wherever in the Item Label | |
376 | -- - other values are ignored | |
377 | ||
378 | -- -- List of Parameters -- -- | |
379 | -- They are Integer (IntParam) and Text (HAsciiString from TCollection) | |
380 | ||
381 | NewParamFromStatic (me : mutable; statname : CString; name : CString = "") | |
6e33d3ce | 382 | returns Transient; |
7fd59977 | 383 | ---Purpose : Creates a parameter as being bound to a Static |
384 | -- If the Static is Integer, this creates an IntParam bound to | |
385 | -- it by its name. Else this creates a String which is the value | |
386 | -- of the Static. | |
387 | -- Returns a null handle if <statname> is unknown as a Static | |
388 | ||
6e33d3ce | 389 | IntParam (me; id : Integer) returns IntParam; |
7fd59977 | 390 | ---Purpose : Returns an IntParam, given its Ident in the Session |
391 | -- Null result if <id> is not suitable for an IntParam | |
392 | -- (undefined, or defined for another kind of variable) | |
393 | ||
394 | IntValue (me; it : IntParam) returns Integer; | |
395 | ---Purpose : Returns Integer Value of an IntParam | |
396 | ||
6e33d3ce | 397 | NewIntParam (me : mutable; name : CString = "") returns IntParam; |
7fd59977 | 398 | ---Purpose : Creates a new IntParam. A Name can be set (Optional) |
399 | -- Returns the created IntParam, or a Null Handle in case of | |
400 | -- Failure (see AddItem/AddNamedItem) | |
401 | ||
6e33d3ce | 402 | SetIntValue (me : mutable; it : IntParam; val : Integer) |
7fd59977 | 403 | returns Boolean; |
404 | ---Purpose : Changes the Integer Value of an IntParam | |
405 | -- Returns True if Done, False if <it> is not in the WorkSession | |
406 | ||
407 | ||
6e33d3ce | 408 | TextParam (me; id : Integer) returns HAsciiString from TCollection; |
7fd59977 | 409 | ---Purpose : Returns a TextParam, given its Ident in the Session |
410 | -- Null result if <id> is not suitable for a TextParam | |
411 | -- (undefined, or defined for another kind of variable) | |
412 | ||
413 | TextValue (me; par : HAsciiString from TCollection) | |
414 | returns AsciiString from TCollection; | |
415 | ---Purpose : Returns Text Value of a TextParam (a String) | |
416 | -- or an empty string if <it> is not in the WorkSession | |
417 | ||
418 | NewTextParam (me : mutable; name : CString = "") | |
6e33d3ce | 419 | returns HAsciiString from TCollection; |
7fd59977 | 420 | ---Purpose : Creates a new (empty) TextParam. A Name can be set (Optional) |
421 | -- Returns the created TextParam (as an HAsciiString), or a Null | |
422 | -- Handle in case of Failure (see AddItem/AddNamedItem) | |
423 | ||
6e33d3ce | 424 | SetTextValue (me : mutable; par : HAsciiString from TCollection; |
7fd59977 | 425 | val : CString) returns Boolean; |
426 | ---Purpose : Changes the Text Value of a TextParam (an HAsciiString) | |
427 | -- Returns True if Done, False if <it> is not in the WorkSession | |
428 | ||
429 | -- -- List of Signatures -- -- | |
430 | ||
6e33d3ce | 431 | Signature (me; id : Integer) returns Signature; |
7fd59977 | 432 | ---Purpose : Returns a Signature, given its Ident in the Session |
433 | -- Null result if <id> is not suitable for a Signature | |
434 | -- (undefined, or defined for another kind of variable) | |
435 | ||
436 | SignValue (me; sign : Signature; ent : Transient) returns CString; | |
437 | ---Purpose : Returns the Value computed by a Signature for an Entity | |
438 | -- Returns an empty string if the entity does not belong to the | |
439 | -- loaded model | |
440 | ||
441 | -- -- List of Selections -- -- | |
442 | ||
6e33d3ce | 443 | Selection (me; id : Integer) returns Selection; |
7fd59977 | 444 | ---Purpose : Returns a Selection, given its Ident in the Session |
445 | -- Null result if <id> is not suitable for a Selection | |
446 | -- (undefined, or defined for another kind of variable) | |
447 | ||
448 | EvalSelection (me; sel : Selection) returns EntityIterator | |
449 | ---Purpose : Evaluates the effect of a Selection applied on the input Model | |
450 | -- Returned Result remains empty if no input Model has been set | |
451 | raises DomainError; | |
452 | -- If ErrorHandle has been set and if an Error occurs, the | |
453 | -- exception is caught and the result is returned empty | |
454 | -- Else, the exception remains raised | |
455 | ||
456 | Sources (me; sel : Selection) returns SelectionIterator; | |
457 | ---Purpose : Returns the Selections which are source of Selection, given | |
458 | -- its rank in the List of Selections (see SelectionIterator) | |
459 | -- Returned value is empty if <num> is out of range or if | |
460 | -- <sel> is not in the WorkSession | |
461 | ||
462 | SelectionResult (me; sel : Selection) returns | |
463 | HSequenceOfTransient from TColStd raises DomainError; | |
464 | ---Purpose : Returns the result of a Selection, computed by EvalSelection | |
465 | -- (see above) under the form of a HSequence (hence, it can be | |
466 | -- used by a frontal-engine logic). It can be empty | |
467 | -- Returns a Null Handle if <sel> is not in the WorkSession | |
468 | ||
469 | SelectionResultFromList (me; sel : Selection; list : HSequenceOfTransient) | |
470 | returns HSequenceOfTransient from TColStd raises DomainError; | |
471 | ---Purpose : Returns the result of a Selection, by forcing its input with | |
472 | -- a given list <list> (unless <list> is Null). | |
473 | -- RULES : | |
474 | -- <list> applies only for a SelectDeduct kind Selection : | |
475 | -- its Input is considered : if it is a SelectDeduct kind | |
476 | -- Selection, its Input is considered, etc... until an Input | |
477 | -- is not a Deduct/Extract : its result is replaced by <list> | |
478 | -- and all the chain of deductions is applied | |
479 | ||
480 | ||
6e33d3ce | 481 | SetItemSelection (me : mutable; item : Transient; |
482 | sel : Selection) returns Boolean; | |
7fd59977 | 483 | ---Purpose : Sets a Selection as input for an item, according its type : |
484 | -- if <item> is a Dispatch : as Final Selection | |
485 | -- if <item> is a GeneralModifier (i.e. any kind of Modifier) : | |
486 | -- as Selection used to filter entities to modify | |
487 | -- <sel> Null causes this Selection to be nullified | |
488 | -- Returns False if <item> is not of a suitable type, or | |
489 | -- <item> or <sel> is not in the WorkSession | |
490 | ||
6e33d3ce | 491 | ResetItemSelection (me : mutable; item : Transient) returns Boolean; |
7fd59977 | 492 | ---Purpose : Resets input Selection which was set by SetItemSelection |
493 | -- Same conditions as for SetItemSelection | |
494 | -- Returns True if done, False if <item> is not in the WorkSession | |
495 | ||
6e33d3ce | 496 | ItemSelection (me; item : Transient) returns Selection; |
7fd59977 | 497 | ---Purpose : Returns the Selection of a Dispatch or a GeneralModifier. |
498 | -- Returns a Null Handle if none is defined or <item> not good type | |
499 | ||
500 | -- -- Counters -- -- | |
501 | -- a Counter can be used directly | |
502 | -- it can also be recorded as control item of the WorkSession, then : | |
503 | -- - it is cleared by ClearData (1 or 4) | |
504 | -- - when it is defined by a Selection, it can be recomputed | |
505 | ||
6e33d3ce | 506 | SignCounter (me; id : Integer) returns SignCounter; |
7fd59977 | 507 | ---Purpose : Returns a SignCounter from its ident in the Session |
508 | -- Null result if <id> is not suitable for a SignCounter | |
509 | -- (undefined, or defined for another kind of variable) | |
510 | ||
511 | ComputeCounter (me : mutable; counter : SignCounter; | |
512 | forced : Boolean=Standard_False) returns Boolean; | |
513 | ---Purpose : Computes the content of a SignCounter when it is defined with | |
514 | -- a Selection, then returns True | |
515 | -- Returns False if the SignCounter is not defined with a | |
516 | -- Selection, or if its Selection Mode is inhibited | |
517 | -- <forced> to work around optimisations | |
518 | ||
519 | ComputeCounterFromList (me : mutable; counter : SignCounter; | |
520 | list : HSequenceOfTransient; clear : Boolean = Standard_True) | |
521 | returns Boolean; | |
522 | ---Purpose : Computes the content of a SignCounter from an input list | |
523 | -- If <list> is Null, uses internal definition of the Counter : | |
524 | -- a Selection, else the whole Model (recomputation forced) | |
525 | -- If <clear> is True (D), starts from scratch | |
526 | -- Else, cumulates computations | |
527 | ||
528 | -- -- Dispatches (stored by ShareOut) -- -- | |
529 | ||
530 | AppliedDispatches (me) returns HSequenceOfInteger from TColStd; | |
531 | ---Purpose : Returns the ordered list of dispatches stored by the ShareOut | |
532 | ||
533 | ClearShareOut (me : mutable; onlydisp : Boolean); | |
534 | ---Purpose : Clears the list of Dispatches recorded by the ShareOut | |
535 | -- if <only> disp is True, tha's all. Else, clears also the lists | |
536 | -- of Modifiers recorded by the ShareOut | |
537 | ||
6e33d3ce | 538 | Dispatch (me; id : Integer) returns Dispatch; |
7fd59977 | 539 | ---Purpose : Returns a Dispatch, given its Ident in the Session |
540 | -- Null result if <id> is not suitable for a Dispatch | |
541 | -- (undefined, or defined for another kind of variable) | |
542 | ||
543 | ||
544 | DispatchRank (me; disp : Dispatch) returns Integer; | |
545 | ---Purpose : Returns the rank of a Dispatch in the ShareOut, or 0 if <disp> | |
546 | -- is not in the ShareOut or not in the WorkSession | |
547 | ||
548 | -- -- Modifiers (cf also ModelCopier) -- -- | |
549 | -- A Modifier can be applied to : final sending (all dispatches), | |
550 | -- final sending but for one specific Dispatch, or another action | |
551 | -- | |
552 | -- Modifiers can be, either active for final sending to file (managed | |
553 | -- by the ModelCopier), or not. | |
554 | -- Here, Management of Modifiers (except the global list) concerns | |
555 | -- only active Modifiers for the final sending. | |
556 | -- But Criteria (Selection,Dispatch) are suitable for every kind of | |
557 | -- Modifier, i.e. for GeneralModifier (also applies to IFAdapt kinds | |
558 | -- of Modifiers, which apply during the Copy operation itself) | |
559 | ||
6e33d3ce | 560 | ModelCopier (me) returns ModelCopier; |
7fd59977 | 561 | ---Purpose : Gives access to the complete ModelCopier |
562 | ||
6e33d3ce | 563 | SetModelCopier (me : mutable; copier : ModelCopier); |
7fd59977 | 564 | ---Purpose : Sets a new ModelCopier. Fills Items which its content |
565 | ---Warning : all data recorded in the former ModelCopier are lost | |
566 | -- (thus, Final Modifiers become inactive) | |
567 | ||
568 | NbFinalModifiers (me; formodel : Boolean) returns Integer; | |
569 | ---Purpose : Returns the count of Modifiers applied to final sending | |
570 | -- Model Modifiers if <formodel> is True, File Modifiers else | |
571 | -- (i.e. Modifiers which apply once the Models have been filled) | |
572 | ||
573 | FinalModifierIdents (me; formodel : Boolean) | |
574 | returns HSequenceOfInteger from TColStd; | |
575 | ---Purpose : Fills a Sequence with a list of Idents, those attached to | |
576 | -- the Modifiers applied to final sending. | |
577 | -- Model Modifiers if <formodel> is True, File Modifiers else | |
578 | -- This list is given in the order in which they will be applied | |
579 | -- (which takes into account the Changes to Modifier Ranks) | |
580 | ||
581 | GeneralModifier (me; id : Integer) | |
6e33d3ce | 582 | returns GeneralModifier; |
7fd59977 | 583 | ---Purpose : Returns a Modifier, given its Ident in the Session |
584 | -- Null result if <id> is not suitable for a Modifier | |
585 | -- (undefined, or defined for another kind of variable) | |
586 | ||
6e33d3ce | 587 | ModelModifier (me; id : Integer) returns Modifier; |
7fd59977 | 588 | ---Purpose : Returns a Model Modifier, given its Ident in the Session, |
589 | -- i.e. typed as a Modifier (not simply a GeneralModifier) | |
590 | -- Null result if <id> is not suitable for a Modifier | |
591 | -- (undefined, or defined for another kind of variable) | |
592 | ||
593 | ModifierRank (me; item : GeneralModifier) returns Integer; | |
594 | ---Purpose : Returns the Rank of a Modifier given its Ident. Model or File | |
595 | -- Modifier according its type (ModelModifier or not) | |
596 | -- Remember that Modifiers are applied sequencially following | |
597 | -- their Rank : first Model Modifiers then File Modifiers | |
598 | -- Rank is given by rank of call to AddItem and can be | |
599 | -- changed by ChangeModifierRank | |
600 | ||
601 | ChangeModifierRank (me : mutable; | |
602 | formodel : Boolean; before, after : Integer) returns Boolean; | |
603 | ---Purpose : Changes the Rank of a Modifier in the Session : | |
604 | -- Model Modifiers if <formodel> is True, File Modifiers else | |
605 | -- the Modifier n0 <before> is put to n0 <after> | |
606 | -- Return True if Done, False if <before> or <after> out of range | |
607 | ||
608 | ClearFinalModifiers (me : mutable); | |
609 | ---Purpose : Removes all the Modifiers active in the ModelCopier : they | |
610 | -- become inactive and they are removed from the Session | |
611 | ||
6e33d3ce | 612 | SetAppliedModifier (me : mutable; modif : GeneralModifier; |
613 | item : Transient) returns Boolean; | |
7fd59977 | 614 | ---Purpose : Sets a GeneralModifier to be applied to an item : |
615 | -- - item = ShareOut : applies for final sending (all dispatches) | |
616 | -- - item is a Dispatch : applies for this dispatch only | |
617 | -- Returns True if done, False if <modif> or <item> not in <me> | |
618 | ||
6e33d3ce | 619 | ResetAppliedModifier (me : mutable; modif : GeneralModifier) |
7fd59977 | 620 | returns Boolean; |
621 | ---Purpose : Resets a GeneralModifier to be applied | |
622 | -- Returns True if done, False if <modif> was not applied | |
623 | ||
6e33d3ce | 624 | UsesAppliedModifier (me; modif : GeneralModifier) returns Transient; |
7fd59977 | 625 | ---Purpose : Returns the item on which a GeneralModifier is applied : |
626 | -- the ShareOut, or a given Dispatch | |
627 | -- Returns a Null Handle if <modif> is not applied | |
628 | ||
629 | -- -- Transformation (without sending) -- -- | |
630 | ||
6e33d3ce | 631 | Transformer (me; id : Integer) returns Transformer; |
7fd59977 | 632 | ---Purpose : Returns a Transformer, given its Ident in the Session |
633 | -- Null result if <id> is not suitable for a Transformer | |
634 | -- (undefined, or defined for another kind of variable) | |
635 | ||
636 | RunTransformer (me : mutable; transf : Transformer) returns Integer; | |
637 | ---Purpose : Runs a Transformer on starting Model, which can then be edited | |
638 | -- or replaced by a new one. The Protocol can also be changed. | |
639 | -- Fills LastRunCheckList | |
640 | -- | |
641 | -- Returned status is 0 if nothing done (<transf> or model | |
642 | -- undefined), positive if OK, negative else : | |
643 | -- 0 : Nothing done | |
644 | -- 1 : OK, edition on the spot with no change to the graph | |
645 | -- of dependances (purely local) | |
646 | -- 2 : OK, model edited on the spot (graph recomputed, may | |
647 | -- have changed), protocol unchanged | |
648 | -- 3 : OK, new model produced, same protocol | |
649 | -- 4 : OK, model edited on the spot (graph recomputed), | |
650 | -- but protocol has changed | |
651 | -- 5 : OK, new model produced, protocol has changed | |
652 | -- -1 : Error on the spot (slight changes), data may be corrupted | |
653 | -- (remark : corruption should not be profound) | |
654 | -- -2 : Error on edition the spot, data may be corrupted | |
655 | -- (checking them is recommanded) | |
656 | -- -3 : Error with a new data set, transformation ignored | |
657 | -- -4 : OK as 4, but graph of dependances count not be recomputed | |
658 | -- (the former one is kept) : check the protocol | |
659 | ||
660 | RunModifier (me : mutable; modif : Modifier; copy : Boolean) | |
661 | returns Integer; | |
662 | ---Purpose : Runs a Modifier on Starting Model. It can modify entities, or | |
663 | -- add new ones. But the Model or the Protocol is unchanged. | |
664 | -- The Modifier is applied on each entity of the Model. See also | |
665 | -- RunModifierSelected | |
666 | -- Fills LastRunCheckList | |
667 | -- | |
668 | -- <copy> : if True, a new data set is produced which brings | |
669 | -- the modifications (Model + its Entities) | |
670 | -- if False, data are modified on the spot | |
671 | -- | |
672 | -- It works through a TransformStandard defined with <modif> | |
673 | -- Returned status as RunTransformer : 0 nothing done, >0 OK, | |
674 | -- <0 problem, but only between -3 and 3 (protocol unchanged) | |
675 | -- Remark : <copy> True will give <effect> = 3 or -3 | |
676 | ||
677 | RunModifierSelected (me : mutable; modif : Modifier; | |
678 | sel : Selection; copy : Boolean) | |
679 | returns Integer; | |
680 | ---Purpose : Acts as RunModifier, but the Modifier is applied on the list | |
681 | -- determined by a Selection, rather than on the whole Model | |
682 | -- If the selection is a null handle, the whole model is taken | |
683 | ||
684 | NewTransformStandard (me : mutable; copy : Boolean; name : CString = "") | |
6e33d3ce | 685 | returns Transformer; |
7fd59977 | 686 | ---Purpose : Creates and returns a TransformStandard, empty, with its |
687 | -- Copy Option (True = Copy, False = On the Spot) and an | |
688 | -- optional name. | |
689 | -- To a TransformStandard, the method SetAppliedModifier applies | |
690 | ||
691 | SetModelContent (me : mutable; sel : Selection; keep : Boolean) | |
692 | returns Boolean; | |
693 | ---Purpose : Defines a new content from the former one | |
694 | -- If <keep> is True, it is given by entities selected by | |
695 | -- Selection <sel> (and all shared entities) | |
696 | -- Else, it is given by all the former content but entities | |
697 | -- selected by the Selection <sel> (and properly shared ones) | |
698 | -- Returns True if done. Returns False if the selected list | |
699 | -- (from <sel>) is empty, hence nothing is done | |
700 | ||
701 | -- -- File and Transfer Management -- -- | |
702 | ||
703 | FilePrefix (me) returns HAsciiString from TCollection; | |
704 | ---Purpose : Returns the defined File Prefix. Null Handle if not defined | |
705 | ||
706 | DefaultFileRoot (me) returns HAsciiString from TCollection; | |
707 | ---Purpose : Returns the defined Default File Root. It is used for | |
708 | -- Dispatches which have no specific root attached. | |
709 | -- Null Handle if not defined | |
710 | ||
711 | FileExtension (me) returns HAsciiString from TCollection; | |
712 | ---Purpose : Returns the defined File Extension. Null Handle if not defined | |
713 | ||
714 | FileRoot (me; disp : Dispatch) returns HAsciiString from TCollection; | |
715 | ---Purpose : Returns the File Root defined for a Dispatch. Null if no | |
716 | -- Root Name is defined for it (hence, no File will be produced) | |
717 | ||
718 | SetFilePrefix (me : mutable; name : CString); | |
719 | ---Purpose : Defines a File Prefix | |
720 | ||
721 | SetDefaultFileRoot (me : mutable; name : CString) returns Boolean; | |
722 | ---Purpose : Defines a Default File Root Name. Clears it is <name> = "" | |
723 | -- Returns True if OK, False if <name> already set for a Dispatch | |
724 | ||
725 | SetFileExtension (me : mutable; name : CString); | |
726 | ---Purpose : Defines a File Extension | |
727 | ||
728 | SetFileRoot (me : mutable; disp : Dispatch; name : CString) returns Boolean; | |
729 | ---Purpose : Defines a Root for a Dispatch | |
730 | -- If <name> is empty, clears Root Name | |
731 | -- This has as effect to inhibit the production of File by <disp> | |
732 | -- Returns False if <disp> is not in the WorkSession or if a | |
733 | -- root name is already defined for it | |
734 | ||
735 | GiveFileRoot (me; file : CString) returns CString; | |
736 | ---Purpose : Extracts File Root Name from a given complete file name | |
737 | -- (uses OSD_Path) | |
738 | ||
739 | GiveFileComplete (me; file : CString) returns CString; | |
740 | ---Purpose : Completes a file name as required, with Prefix and Extension | |
741 | -- (if defined; for a non-defined item, completes nothing) | |
742 | ||
743 | ClearFile (me : mutable); | |
744 | ---Purpose : Erases all stored data from the File Evaluation | |
745 | -- (i.e. ALL former naming informations are lost) | |
746 | ||
747 | EvaluateFile (me : mutable); | |
748 | ---Purpose : Performs and stores a File Evaluation. The Results are a List | |
749 | -- of produced Models and a List of names (Strings), in parallel | |
750 | -- Fills LastRunCheckList | |
751 | ||
752 | NbFiles (me) returns Integer; | |
753 | ---Purpose : Returns the count of produced Models | |
754 | ||
6e33d3ce | 755 | FileModel (me; num : Integer) returns InterfaceModel; |
7fd59977 | 756 | ---Purpose : Returns a Model, given its rank in the Evaluation List |
757 | ||
758 | FileName (me; num : Integer) returns AsciiString from TCollection; | |
759 | ---Purpose : Returns the name of a file corresponding to a produced Model, | |
760 | -- given its rank in the Evaluation List | |
761 | ||
762 | BeginSentFiles (me : mutable; record : Boolean); | |
763 | ---Purpose : Commands file sending to clear the list of already sent files, | |
764 | -- commands to record a new one if <record> is True | |
765 | -- This list is managed by the ModelCopier when SendSplit is called | |
766 | -- It allows a global exploitation of the set of sent files | |
767 | ||
768 | SentFiles (me) returns HSequenceOfHAsciiString; | |
769 | ---Purpose : Returns the list of recorded sent files, or a Null Handle is | |
770 | -- recording has not been enabled | |
771 | ||
772 | ||
773 | SendSplit (me : mutable) returns Boolean; | |
774 | ---Purpose : Performs creation of derived files from the input Model | |
775 | -- Takes its data (sub-models and names), from result EvaluateFile | |
776 | -- if active, else by dynamic Evaluation (not stored) | |
777 | -- After SendSplit, result of EvaluateFile is Cleared | |
778 | -- Fills LastRunCheckList | |
779 | -- | |
780 | -- Works with the WorkLibrary which acts on specific type of Model | |
781 | -- and can work with File Modifiers (managed by the Model Copier) | |
782 | -- and a ModelCopier, which can work with Model Modifiers | |
783 | -- Returns False if, either WorkLibrary has failed on at least | |
784 | -- one sub-file, or the Work Session is badly conditionned | |
785 | -- (no Model defined, or FileNaming not in phase with ShareOut) | |
786 | ||
787 | EvalSplit (me) returns PacketList; | |
788 | ---Purpose : Returns an Evaluation of the whole ShareOut definition : i.e. | |
789 | -- how the entities of the starting model are forecast to be sent | |
790 | -- to various files : list of packets according the dispatches, | |
791 | -- effective lists of roots for each packet (which determine the | |
792 | -- content of the corresponding file); plus evaluation of which | |
793 | -- entities are : forgotten (sent into no file), duplicated (sent | |
794 | -- into more than one file), sent into a given file. | |
795 | -- See the class PacketList for more details. | |
796 | ||
797 | SentList (me; count : Integer = -1) returns EntityIterator; | |
798 | ---Purpose : Returns the list of Entities sent in files, accourding the | |
799 | -- count of files each one has been sent (these counts are reset | |
800 | -- by SetModel or SetRemaining(Forget) ) stored in Graph Status | |
801 | -- <count> = -1 (default) is for ENtities sent at least once | |
802 | -- <count> = 0 is for the Remaining List (entities not yet sent) | |
803 | -- <count> = 1 is for entities sent in one and only one file | |
804 | -- (the ideal case) | |
805 | -- Remaining Data are computed on each Sending/Copying output | |
806 | -- files (see methods EvaluateFile and SendSplit) | |
807 | -- Graph Status is 0 for Remaining Entity, <count> for Sent into | |
808 | -- <count> files | |
809 | -- This status is set to 0 (not yet sent) for all by SetModel | |
810 | -- and by SetRemaining(mode=Forget,Display) | |
811 | ||
812 | MaxSendingCount (me) returns Integer; | |
813 | ---Purpose : Returns the greater count of different files in which any of | |
814 | -- the starting entities could be sent. | |
815 | -- Before any file output, this count is 0. | |
816 | -- Ideal count is 1. More than 1 means that duplications occur. | |
817 | ||
818 | SetRemaining (me : mutable; mode : RemainMode) returns Boolean; | |
819 | ---Purpose : Processes Remaining data (after having sent files), mode : | |
820 | -- Forget : forget remaining info (i.e. clear all "Sent" status) | |
821 | -- Compute : compute and keep remaining (does nothing if : | |
822 | -- remaining is empty or if no files has been sent) | |
823 | -- Display : display entities recorded as remaining | |
824 | -- Undo : restore former state of data (after Remaining(1) ) | |
825 | -- Returns True if OK, False else (i.e. mode = 2 and Remaining | |
826 | -- List is either empty or takes all the entities, or mode = 3 | |
827 | -- and no former computation of remaining data was done) | |
828 | ||
829 | ||
830 | SendAll (me : mutable; filename : CString; | |
831 | computegraph : Boolean = Standard_False) returns ReturnStatus; | |
832 | ---Purpose : Sends the starting Model into one file, without splitting, | |
833 | -- managing remaining data or anything else. | |
834 | -- <computegraph> true commands the Graph to be recomputed before | |
835 | -- sending : required when a Model is filled in several steps | |
836 | -- | |
837 | -- The Model and File Modifiers recorded to be applied on sending | |
838 | -- files are. | |
12bf87c5 P |
839 | -- Returns a status of execution : |
840 | -- Done if OK, | |
841 | -- Void if no data available, | |
842 | -- Error if errors occured (work library is not defined), errors | |
843 | -- during translation | |
844 | -- Fail if exception during translation is raised | |
845 | -- Stop if no disk space or disk, file is write protected | |
7fd59977 | 846 | -- Fills LastRunCheckList |
847 | ||
848 | SendSelected (me : mutable; filename : CString; sel : Selection; | |
849 | computegraph : Boolean = Standard_False) returns ReturnStatus; | |
850 | ---Purpose : Sends a part of the starting Model into one file, without | |
851 | -- splitting. But remaining data are managed. | |
852 | -- <computegraph> true commands the Graph to be recomputed before | |
853 | -- sending : required when a Model is filled in several steps | |
854 | -- | |
855 | -- The Model and File Modifiers recorded to be applied on sending | |
856 | -- files are. | |
857 | -- Returns a status : Done if OK, Fail if error during send, | |
858 | -- Error : WorkLibrary not defined, Void : selection list empty | |
859 | -- Fills LastRunCheckList | |
860 | ||
861 | WriteFile (me : mutable; filename : CString) returns ReturnStatus; | |
862 | ---Purpose : Writes the current Interface Model globally to a File, and | |
863 | -- returns a write status which can be : | |
864 | -- Done OK, Fail file could not be written, Error no norm is selected | |
865 | -- Remark : It is a simple, one-file writing, other operations are | |
866 | -- available (such as splitting ...) which calls SendAll | |
867 | ||
868 | WriteFile (me : mutable; filename : CString; sel : Selection from IFSelect) | |
869 | returns ReturnStatus; | |
870 | ---Purpose : Writes a sub-part of the current Interface Model to a File, | |
871 | -- as defined by a Selection <sel>, recomputes the Graph, and | |
872 | -- returns a write status which can be : | |
873 | -- Done OK, Fail file could not be written, Error no norm is selected | |
874 | -- Remark : It is a simple, one-file writing, other operations are | |
875 | -- available (such as splitting ...) which calls SendSelected | |
876 | ||
877 | -- -- Some General Purpose Selections -- -- | |
878 | ||
879 | NbSources (me; sel : Selection) returns Integer; | |
880 | ---Purpose : Returns the count of Input Selections known for a Selection, | |
881 | -- or 0 if <sel> not in the WorkSession. This count is one for a | |
882 | -- SelectDeduct / SelectExtract kind, two for SelectControl kind, | |
883 | -- variable for a SelectCombine (Union/Intersection), zero else | |
884 | ||
6e33d3ce | 885 | Source (me; sel : Selection; num : Integer = 1) returns Selection; |
7fd59977 | 886 | ---Purpose : Returns the <num>th Input Selection of a Selection |
887 | -- (see NbSources). | |
888 | -- Returns a Null Handle if <sel> is not in the WorkSession or if | |
889 | -- <num> is out of the range <1-NbSources> | |
890 | -- To obtain more details, see the method Sources | |
891 | ||
892 | IsReversedSelectExtract (me; sel : Selection) returns Boolean; | |
893 | ---Purpose : Returns True if <sel> a Reversed SelectExtract, False else | |
894 | ||
6e33d3ce | 895 | ToggleSelectExtract (me : mutable; sel : Selection) returns Boolean; |
7fd59977 | 896 | ---Purpose : Toggles the Sense (Direct <-> Reversed) of a SelectExtract |
897 | -- Returns True if Done, False if <sel> is not a SelectExtract or | |
898 | -- is not in the WorkSession | |
899 | ||
6e33d3ce | 900 | SetInputSelection (me : mutable; sel, input : Selection) |
7fd59977 | 901 | returns Boolean; |
902 | ---Purpose : Sets an Input Selection (as <input>) to a SelectExtract or | |
903 | -- a SelectDeduct (as <sel>). | |
904 | -- Returns True if Done, False if <sel> is neither a | |
905 | -- SelectExtract nor a SelectDeduct, or not in the WorkSession | |
906 | ||
907 | ||
6e33d3ce | 908 | SetControl (me : mutable; sel, sc : Selection; |
7fd59977 | 909 | formain : Boolean = Standard_True) returns Boolean; |
910 | ---Purpose : Sets an Input Selection, Main if <formain> is True, Second else | |
911 | -- (as <sc>) to a SelectControl (as <sel>). Returns True if Done, | |
912 | -- False if <sel> is not a SelectControl, or <sc> or <sel> is not | |
913 | -- in the WorkSession | |
914 | ||
6e33d3ce | 915 | CombineAdd (me : mutable; selcomb, seladd : Selection; |
7fd59977 | 916 | atnum : Integer = 0) returns Integer; |
917 | ---Purpose : Adds an input selection to a SelectCombine (Union or Inters.). | |
918 | -- Returns new count of inputs for this SelectCombine if Done or | |
919 | -- 0 if <sel> is not kind of SelectCombine, or if <seladd> or | |
920 | -- <sel> is not in the WorkSession | |
921 | -- By default, adding is done at the end of the list | |
922 | -- Else, it is an insertion to rank <atnum> (usefull for Un-ReDo) | |
923 | ||
6e33d3ce | 924 | CombineRemove (me : mutable; selcomb, selrem : Selection) |
7fd59977 | 925 | returns Boolean; |
926 | ---Purpose : Removes an input selection from a SelectCombine (Union or | |
927 | -- Intersection). Returns True if done, False if <selcomb> is not | |
928 | -- kind of SelectCombine or <selrem> is not source of <selcomb> | |
929 | ||
930 | NewSelectPointed (me : mutable; list : HSequenceOfTransient; name : CString) | |
6e33d3ce | 931 | returns Selection; |
7fd59977 | 932 | ---Purpose : Creates a new Selection, of type SelectPointed, its content |
933 | -- starts with <list>. A name must be given (can be empty) | |
934 | ||
6e33d3ce | 935 | SetSelectPointed (me; sel : Selection; list : HSequenceOfTransient; |
7fd59977 | 936 | mode : Integer) returns Boolean; |
937 | ---Purpose : Changes the content of a Selection of type SelectPointed | |
938 | -- According <mode> : 0 set <list> as new content (clear former) | |
939 | -- 1 : adds <list> to actual content | |
940 | -- -1 : removes <list> from actual content | |
941 | -- Returns True if done, False if <sel> is not a SelectPointed | |
942 | ||
943 | -- -- Various Evaluations -- -- | |
944 | ||
945 | GiveSelection (me; selname : CString) returns Selection; | |
946 | ---Purpose : Returns a Selection from a Name : | |
947 | -- - the name of a Selection : this Selection | |
948 | -- - the name of a Signature + criteria between (..) : a new | |
949 | -- Selection from this Signature | |
950 | -- - an entity or a list of entities : a new SelectPointed | |
951 | -- Else, returns a Null Handle | |
952 | ||
953 | GiveList (me; obj : Transient) returns HSequenceOfTransient; | |
954 | ---Purpose : Determines a list of entities from an object : | |
955 | -- <obj> already HSequenceOfTransient : returned itself | |
956 | -- <obj> Selection : its Result of Evaluation is returned | |
957 | -- <obj> an entity of the Model : a HSequence which contains it | |
958 | -- else, an empty HSequence | |
959 | -- <obj> the Model it self : ALL its content (not only the roots) | |
960 | ||
961 | GiveList (me; first : CString; second : CString = "") | |
962 | returns HSequenceOfTransient; | |
963 | ---Purpose : Computes a List of entities from two alphanums, | |
964 | -- first and second, as follows : | |
965 | -- if <first> is a Number or Label of an entity : this entity | |
966 | -- if <first> is a list of Numbers/Labels : the list of entities | |
967 | -- if <first> is the name of a Selection in <WS>, and <second> | |
968 | -- not defined, the standard result of this Selection | |
969 | -- else, let's consider "first second" : this whole phrase is | |
970 | -- splitted by blanks, as follows (RECURSIVE CALL) : | |
971 | -- - the leftest term is the final selection | |
972 | -- - the other terms define the result of the selection | |
973 | -- - and so on (the "leftest minus one" is a selection, of which | |
974 | -- the input is given by the remaining ...) | |
975 | ||
976 | GiveListFromList (me; selname : CString; ent : Transient) | |
977 | returns HSequenceOfTransient; | |
978 | ---Purpose : Computes a List of entities from the model as follows | |
979 | -- <first> beeing a Selection or a combination of Selections, | |
980 | -- <ent> beeing an entity or a list | |
981 | -- of entities (as a HSequenceOfTransient) : | |
982 | -- the standard result of this selection applied to this list | |
983 | -- if <ent> is Null, the standard definition of the selection is | |
984 | -- used (which contains a default input selection) | |
985 | -- if <selname> is erroneous, a null handle is returned | |
986 | -- | |
987 | -- REMARK : selname is processed as <first second> of preceeding | |
988 | -- GiveList | |
989 | ||
990 | GiveListCombined (me; l1, l2 : HSequenceOfTransient; mode : Integer) | |
991 | returns HSequenceOfTransient; | |
992 | ---Purpose : Combines two lists and returns the result, according to mode : | |
993 | -- <mode> < 0 : entities in <l1> AND NOT in <l2> | |
994 | -- <mode> = 0 : entities in <l1> AND in <l2> | |
995 | -- <mode> > 0 : entities in <l1> OR in <l2> | |
996 | ||
997 | QueryCheckList (me : mutable; chl : CheckIterator); | |
998 | ---Purpose : Loads data from a check iterator to query status on it | |
999 | ||
1000 | QueryCheckStatus (me; ent : Transient) returns Integer; | |
1001 | ---Purpose : Determines check status for an entity regarding last call to | |
1002 | -- QueryCheckList : | |
1003 | -- -1 : <ent> unknown in the model, ignored | |
1004 | -- 0 : no check at all, immediate or inherited thru Graph | |
1005 | -- 1 : immediate warning (no fail), no inherited check | |
1006 | -- 2 : immediate fail, no inherited check | |
1007 | -- +10 : idem but some inherited warning (no fail) | |
1008 | -- +20 : idem but some inherited fail | |
1009 | ||
1010 | QueryParent (me; entdad, entson : Transient) returns Integer; | |
1011 | ---Purpose : Determines if <entdad> is parent of <entson> (in the graph), | |
1012 | -- returns : -1 if no; 0 if <entdad> = <entson> | |
1013 | -- 1 if immediate parent, > 1 if parent, gives count of steps | |
1014 | ||
1015 | -- -- Dumps, Evaluations (displayed on standard output) -- -- | |
1016 | ||
1017 | SetParams (me : mutable; | |
1018 | params : SequenceOfTransient; | |
1019 | uselist : SequenceOfInteger); | |
1020 | ---Purpose : Sets a list of Parameters, i.e. TypedValue, to be handled | |
1021 | -- through an Editor | |
1022 | -- The two lists are parallel, if <params> is longer than <uses>, | |
1023 | -- surnumeral parameters are for general use | |
1024 | -- | |
1025 | -- EditForms are created to handle these parameters (list, edit) | |
1026 | -- on the basis of a ParamEditor xst-params-edit | |
1027 | -- | |
1028 | -- A use number dispatches the parameter to a given EditForm | |
1029 | -- EditForms are defined as follows | |
1030 | -- Name Use Means | |
1031 | -- xst-params all All Parameters (complete list) | |
1032 | -- xst-params-general 1 Generals | |
1033 | -- xst-params-load 2 LoadFile (no Transfer) | |
1034 | -- xst-params-send 3 SendFile (Write, no Transfer) | |
1035 | -- xst-params-split 4 Split | |
1036 | -- xst-param-read 5 Transfer on Reading | |
1037 | -- xst-param-write 6 Transfer on Writing | |
1038 | ||
1039 | TraceStatics (me; use : Integer; mode : Integer = 0); | |
1040 | ---Purpose : Traces the Statics attached to a given use number | |
1041 | -- If <use> is given positive (normal), the trace is embedded | |
1042 | -- with a header and a trailer | |
1043 | -- If <use> is negative, just values are printed | |
1044 | -- (this allows to make compositions) | |
1045 | -- Remark : use number 5 commands use -2 to be traced | |
1046 | -- Remark : use numbers 4 and 6 command use -3 to be traced | |
1047 | ||
1048 | DumpShare (me); | |
1049 | ---Purpose : Dumps contents of the ShareOut (on "cout") | |
1050 | ||
1051 | ListItems (me; label : CString = ""); | |
1052 | ---Purpose : Lists the Labels of all Items of the WorkSession | |
1053 | -- If <label> is defined, lists labels which contain it | |
1054 | ||
1055 | ListFinalModifiers (me; formodel : Boolean); | |
1056 | ---Purpose : Lists the Modifiers of the session (for each one, displays | |
1057 | -- its Label). Listing is done following Ranks (Modifiers are | |
1058 | -- invoked following their ranks) | |
1059 | -- Model Modifiers if <formodel> is True, File Modifiers else | |
1060 | ||
1061 | DumpSelection (me; sel : Selection); | |
1062 | ---Purpose : Lists a Selection and its Sources (see SelectionIterator), | |
1063 | -- given its rank in the list | |
1064 | ||
1065 | DumpModel (me : mutable; level : Integer; S : Messenger from Message); | |
1066 | ---Purpose : Lists the content of the Input Model (if there is one) | |
1067 | -- According level : 0 -> gives only count of Entities and Roots | |
1068 | -- 1 -> Lists also Roots; 2 -> Lists all Entities (by TraceType) | |
1069 | -- 3 -> Performs a call to CheckList (Fails) and lists the result | |
1070 | -- 4 -> as 3 but all CheckList (Fails + Warnings) | |
1071 | -- 5,6,7 : as 3 but resp. Count,List,Labels by Fail | |
1072 | -- 8,9,10 : as 4 but resp. Count,List,Labels by message | |
1073 | ||
1074 | TraceDumpModel (me : mutable; mode : Integer); | |
1075 | ---Purpose : Dumps the current Model (as inherited DumpModel), on currently | |
1076 | -- defined Default Trace File (default is standard output) | |
1077 | ||
1078 | DumpEntity (me; ent : Transient; level : Integer; S : Messenger from Message); | |
1079 | ---Purpose : Dumps a starting entity according to the current norm. | |
1080 | -- To do this, it calls DumpEntity from WorkLibrary. | |
1081 | -- <level> is to be interpreted for each norm : see specific | |
1082 | -- classes of WorkLibrary for it. Generally, 0 if for very basic | |
1083 | -- (only type ...), greater values give more and more details. | |
1084 | ||
1085 | PrintEntityStatus (me : mutable; ent : Transient; S : Messenger from Message); | |
1086 | ---Purpose : Prints main informations about an entity : its number, type, | |
1087 | -- validity (and checks if any), category, shareds and sharings.. | |
1088 | -- mutable because it can recompute checks as necessary | |
1089 | ||
1090 | TraceDumpEntity (me; ent : Transient; level : Integer); | |
1091 | ---Purpose : Dumps an entity from the current Model as inherited DumpEntity | |
1092 | -- on currently defined Default Trace File | |
1093 | -- (<level> interpreted according to the Norm, see WorkLibrary) | |
1094 | ||
1095 | PrintCheckList (me; checklist : CheckIterator; | |
1096 | failsonly : Boolean; mode : PrintCount); | |
1097 | ---Purpose : Prints a CheckIterator to the current Trace File, controlled | |
1098 | -- with the current Model | |
1099 | -- complete or fails only, according to <failsonly> | |
1100 | -- <mode> defines the mode of printing | |
1101 | -- 0 : sequential, according entities; else with a CheckCounter | |
1102 | -- 1 : according messages, count of entities | |
1103 | -- 2 : id but with list of entities, designated by their numbers | |
1104 | -- 3 : as 2 but with labels of entities | |
1105 | ||
1106 | PrintSignatureList (me; signlist : SignatureList; mode : PrintCount); | |
1107 | ---Purpose : Prints a SignatureList to the current Trace File, controlled | |
1108 | -- with the current Model | |
1109 | -- <mode> defines the mode of printing (see SignatureList) | |
1110 | ||
1111 | ||
1112 | EvaluateSelection (me; sel : Selection); | |
1113 | ---Purpose : Displays the list of Entities selected by a Selection (i.e. | |
1114 | -- the result of EvalSelection). | |
1115 | ||
1116 | EvaluateDispatch (me; disp : Dispatch; mode : Integer = 0); | |
1117 | ---Purpose : Displays the result of applying a Dispatch on the input Model | |
1118 | -- (also shows Remainder if there is) | |
1119 | -- <mode> = 0 (default), displays nothing else | |
1120 | -- <mode> = 1 : displays also duplicated entities (because of | |
1121 | -- this dispatch) | |
1122 | -- <mode> = 2 : displays the entities of the starting Model | |
1123 | -- which are not taken by this dispatch (forgotten entities) | |
1124 | -- <mode> = 3 : displays both duplicated and forgotten entities | |
1125 | -- Remark : EvaluateComplete displays these data evaluated for | |
1126 | -- for all the dispatches, if there are several | |
1127 | ||
1128 | EvaluateComplete (me; mode : Integer = 0); | |
1129 | ---Purpose : Displays the effect of applying the ShareOut on the input | |
1130 | -- Model. | |
1131 | -- <mode> = 0 (default) : displays only roots for each packet, | |
1132 | -- <mode> = 1 : displays all entities for each packet, plus | |
1133 | -- duplicated entities | |
1134 | -- <mode> = 2 : same as <mode> = 1, plus displays forgotten | |
1135 | -- entities (which are in no packet at all) | |
1136 | ||
1137 | ListEntities (me; iter : EntityIterator; mode : Integer); | |
1138 | ---Purpose : Internal method which displays an EntityIterator | |
1139 | -- <mode> 0 gives short display (only entity numbers) | |
1140 | -- 1 gives a more complete trace (1 line per Entity) | |
1141 | -- (can be used each time a trace has to be output from a list) | |
1142 | -- 2 gives a form suitable for givelist : (n1,n2,n3...) | |
1143 | ||
1144 | fields | |
1145 | ||
1146 | theerrhand : Boolean; | |
1147 | theshareout : ShareOut; | |
1148 | ||
1149 | thelibrary : WorkLibrary; | |
1150 | theprotocol : Protocol from Interface; | |
1151 | themodel : InterfaceModel; | |
1152 | thegraph : HGraph is protected; | |
1153 | theloaded : AsciiString; | |
1154 | thegtool : GTool from Interface; | |
1155 | ||
1156 | thecheckdone : Boolean; | |
1157 | thechecklist : CheckIterator; | |
1158 | thecheckrun : CheckIterator is protected; -- (LastRunCheckList) | |
1159 | thecheckana : AsciiString; | |
1160 | ||
1161 | theitems : IndexedDataMapOfTransientTransient is protected; | |
1162 | thenames : DictionaryOfTransient is protected; | |
1163 | ||
1164 | thecopier : ModelCopier; -- produces + memorizes transferred data | |
1165 | theoldel : InterfaceModel; | |
bc650d41 | 1166 | themodelstat : Boolean; |
7fd59977 | 1167 | end WorkSession; |