0024830: Remove redundant keyword 'mutable' in CDL declarations
[occt.git] / src / IFSelect / IFSelect_ModelCopier.cdl
1 -- Created on: 1993-08-26
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1993-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 under
9 -- the terms of the GNU Lesser General Public License 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 ModelCopier  from IFSelect  inherits TShared
18
19     ---Purpose : This class performs the Copy operations involved by the
20     --           description of a ShareOut (evaluated by a ShareOutResult)
21     --           plus, if there are, the Modifications on the results, with
22     --           the help of Modifiers. Each Modifier can work on one or more
23     --           resulting packets, accoding its criteria : it operates on a
24     --           Model once copied and filled with the content of the packet.
25     --           
26     --           Modifiers can be :
27     --           - Model Modifiers, inheriting from the specific class Modifier
28     --             able to run on the content of a Model (header or entities),
29     --             activated by the ModelCopier itself
30     --           - File Modifiers, inheriting directly from GeneralModifier,
31     --             intended to be activated under the control of a WorkLibrary,
32     --             once the Model has been produced (i.e. to act on output
33     --             format, or other specific file features)
34     --           
35     --           The Copy operations can be :
36     --           - immediately put to files : for each packet, a Model is
37     --             created and filled, then the file is output, at that's all
38     --           - memorized : for each packet, a Model is created and filled,
39     --             it is memorized with the corresponding file name.
40     --             it is possible to query the result of memorization (list of
41     --             produced Models and their file names)
42     --             -> it is also possible to send it into the files :
43     --                once files are written, the result is cleared
44     --           
45     --           In addition, a list of really written files is managed :
46     --           A first call to BeginSentFiles clears the list and commands,
47     --           either to begin a new list, or to stop recording it. A call
48     --           to SentFiles returns the list (if recording has been required)
49     --           This list allows to globally exploit the set of produced files
50     --           
51     --           Remark : For operations which concern specific Entities, see
52     --           also in package IFAdapt : a sub-class of ModelCopier allows
53     --           to work with EntityModifier, in addition to Modifier itself
54     --           which still applies to a whole copied Model.
55
56 uses AsciiString from TCollection,
57      HSequenceOfInteger from TColStd, HArray1OfInteger from TColStd,
58      SequenceOfAsciiString, HSequenceOfHAsciiString from TColStd,
59      InterfaceModel, Protocol, Graph, EntityIterator, CopyTool, CheckIterator,
60      ShareOutResult, ShareOut, WorkLibrary, GeneralModifier, Modifier,
61      SequenceOfGeneralModifier, SequenceOfInterfaceModel,
62      AppliedModifiers, SequenceOfAppliedModifiers
63
64 is
65
66     Create returns ModelCopier;
67     ---Purpose : Creates an empty ModelCopier
68
69     SetShareOut (me : mutable; sho : ShareOut);
70     ---Purpose : Sets the ShareOut, which is used to define Modifiers to apply
71
72     ClearResult (me : mutable);
73     ---Purpose : Clears the list of produced Models
74
75     AddFile (me : mutable; filename : AsciiString from TCollection;
76                            content  : InterfaceModel) returns Boolean;
77     ---Purpose : Records a new File to be sent, as a couple
78     --           (Name as AsciiString, Content as InterfaceModel)
79     --           Returns True if Done, False if <filename> is already attached
80     --             to another File
81
82     NameFile (me : mutable; num : Integer; filename : AsciiString)
83         returns Boolean;
84     ---Purpose : Changes the Name attached to a File which was formerly defined
85     --           by a call to AddFile
86     --           Returns True if Done, False else : if <num> out of range or if
87     --             the new <filename> is already attached to another File
88     --           Remark : Giving an empty File Name is equivalent to ClearFile
89
90     ClearFile (me : mutable; num : Integer) returns Boolean;
91     ---Purpose : Clears the Name attached to a File which was formerly defined
92     --           by a call to AddFile. This Clearing can be undone by a call to
93     --           NameFile (with same <num>)
94     --           Returns True if Done, False else : if <num> is out of range
95
96     SetAppliedModifiers (me : mutable; num : Integer;
97         applied : AppliedModifiers) returns Boolean;
98     ---Purpose : Sets a list of File Modifiers to be applied on a file
99
100     ClearAppliedModifiers (me : mutable; num : Integer) returns Boolean;
101     ---Purpose : Clears the list of File Modifiers to be applied on a file
102
103
104     Copy (me : mutable; eval : in out ShareOutResult;
105               WL : WorkLibrary; protocol : Protocol)
106         returns CheckIterator;
107     ---Purpose : Performs the Copy Operations, which include the Modifications
108     --           defined by the list of Modifiers. Memorizes the result, as a
109     --           list of InterfaceModels with the corresponding FileNames
110     --           They can then be sent, by the method Send, or queried
111     --           Copy calls internal method Copying.
112     --           Returns the produced CheckList
113
114     Copying (me : mutable; eval : in out ShareOutResult;
115               WL : WorkLibrary; protocol : Protocol; TC : in out CopyTool)
116         returns CheckIterator  is protected;
117     ---Purpose : Internal routine which does the effective Copy. It allows to
118     --           work, either with a standard CopyTool, or a specialised one
119     --           Copying itself is done by <WL> which uses a CopyTool
120
121     SendCopied (me : mutable; WL : WorkLibrary; protocol : Protocol)
122         returns CheckIterator;
123     ---Purpose : Sends the formerly defined results (see method Copy) to files,
124     --           then clears it
125     --           Remark : A Null File Name cause file to be not produced
126
127     Send (me : mutable; eval : in out ShareOutResult;
128               WL : WorkLibrary; protocol : Protocol)
129         returns CheckIterator;
130     ---Purpose : Performs the Copy Operations (which include the Modifications)
131     --           and Sends the result on files, without memorizing it.
132     --           (the memorized result is ignored : neither queried not filled)
133
134     Sending (me : mutable; eval : in out ShareOutResult;
135           WL : WorkLibrary; protocol : Protocol; TC : in out CopyTool)
136         returns CheckIterator  is protected;
137     ---Purpose : Internal routine which does the effective Send. It allows to
138     --           work, either with a standard CopyTool, or a specialised one
139
140     SendAll (me : mutable; filename : CString;  G : Graph;
141              WL : WorkLibrary; protocol : Protocol)
142         returns CheckIterator;
143     ---Purpose : Sends a model (defined in <G>) into one file, without managing
144     --           remaining data, already sent files, etc. Applies the Model and
145     --           File Modifiers.
146     --           Returns True if well done, False else
147
148     SendSelected (me : mutable; filename : CString;  G : Graph;
149              WL : WorkLibrary; protocol : Protocol;
150              iter : EntityIterator)
151         returns CheckIterator;
152     ---Purpose : Sends a part of a model into one file. Model is gotten from
153     --           <G>, the part is defined in <iter>.
154     --           Remaining data are managed and can be later be worked on.
155     --           Returns True if well done, False else
156
157     CopiedModel (me; G        : Graph;
158                      WL       : WorkLibrary;
159                      protocol : Protocol;
160                      topcopy  : EntityIterator;
161                      filename : AsciiString from TCollection;
162                      dispnum, numod : Integer;
163                      TC       : in out CopyTool;
164                      newmod   : out InterfaceModel;
165                      applied  : out AppliedModifiers;
166                      checks   : out CheckIterator)
167         is protected;
168     ---Purpose : Performs the Copy of a unitary Packet
169     --             Input parameters are :
170     --           <G> is the graph which defines the starting entities, it
171     --             contains the original InterfaceModel
172     --           <WL> performs the copy by using <TC>
173     --           <protocol> is the used protocol (can be usefull for Modifiers)
174     --           <topcopy> is the list of Entities which are the Roots of the
175     --             packet to be copied
176     --           <filename> is the name of the file which will receive it
177     --           <dispid> is the Identifier of the Dispatch which have produced
178     --             this packet, <numod> is the rank of the packet for this
179     --             Dispatch
180     --           <TC> is a CopyTool, which performs the copy
181     --           
182     --               Returned values (as arguments) are :
183     --           <newmod> is the result of the copy, as a new InterfaceModel on
184     --           which Model Modifiers have already been applied (if there are)
185     --           <applied> determines the File Modifiers which remain to be
186     --           applied (when the file itself will be output) : for each File
187     --           Modifier recorded in <me>, <applied>'s Value is :
188     --           - Null if this Modifier has not to be applied
189     --           - an empty list if this Modifier has to be applied without
190     --             distinguishing specific entities
191     --           - a list of numbers of entities in <model> if this Modifier
192     --             concerns particularly these entities (which are the results
193     --             of copying the result of its input selection)
194     --           <checks> is the produced Check List (by Modifiers as required)
195     --             
196     --  Warning : File Modifiers are evaluated at the time of Copy itself
197     --           If their list is changed between this Copy and the Sending
198     --           itself of the file, these changes are ignored
199
200     CopiedRemaining (me : mutable; G    : Graph;
201                      WL : WorkLibrary;
202                      TC : in out CopyTool;
203                      newmod   : out InterfaceModel);
204     ---Purpose : Produces a Model copied from the Remaining List as <newmod>
205     --           <newmod> is a Null Handle if this list is empty
206     --           <WL> performs the copy by using <TC>
207     --           <TC> is assumed to have been defined with the starting model
208     --           same as defined by <G>.
209
210     SetRemaining (me; CG : in out Graph) returns Boolean;
211     ---Purpose : Updates Graph status for remaining data, for each entity :
212     --           - Entities just Sent to file or Copied (by CopiedRemaining)
213     --             have their status set to 1
214     --           - the other keep their former status (1 for Send/Copied,
215     --             0 for Remaining)
216     --           These status are computed by Copying/Sending/CopiedRemaining
217     --           Then, SetRemaining updates graph status, and mustr be called
218     --           just after one of these method has been called
219     --           Returns True if done, False if remaining info if not in phase
220     --           which the Graph (not same counts of items)
221
222
223     NbFiles (me) returns Integer;
224     ---Purpose : Returns the count of Files produced, i.e. the count of Models
225     --           memorized (produced by the mmethod Copy) with their file names
226
227     FileName (me; num : Integer) returns AsciiString from TCollection;
228     ---Purpose : Returns the File Name for a file given its rank
229     --           It is empty after a call to ClearFile on same <num>
230
231     FileModel (me; num : Integer) returns InterfaceModel;
232     ---Purpose : Returns the content of a file before sending, under the form
233     --           of an InterfaceModel, given its rank
234
235     AppliedModifiers (me; num : Integer) returns AppliedModifiers;
236     ---Purpose : Returns the list of File Modifiers to be applied on a file
237     --           when it will be sent, as computed by CopiedModel :
238     --           If it is a null handle, no File Modifier has to be applied.
239
240
241     BeginSentFiles (me : mutable; sho : ShareOut; record : Boolean);
242     ---Purpose : Begins a sequence of recording the really sent files
243     --           <sho> : the default file numbering is cleared
244     --           If <record> is False, clears the list and stops recording
245     --           If <record> is True, clears the list and commands recording
246     --           Creation time corresponds to "stop recording"
247
248     AddSentFile (me : mutable; filename : CString);
249     ---Purpose : Adds the name of a just sent file, if BeginSentFiles
250     --           has commanded recording; else does nothing
251     --           It is called by methods SendCopied Sending
252
253     SentFiles (me) returns HSequenceOfHAsciiString from TColStd;
254     ---Purpose : Returns the list of recorded names of sent files. Can be empty
255     --           (if no file has been sent). Returns a Null Handle if
256     --           BeginSentFiles has stopped recording.
257
258 fields
259
260     thefilemodels : SequenceOfInterfaceModel;
261     thefilenames  : SequenceOfAsciiString;
262     theapplieds   : SequenceOfAppliedModifiers;
263     theshareout   : ShareOut;  -- for copy-send operation (names, modifiers)
264     theremain     : HArray1OfInteger;
265     thesentfiles  : HSequenceOfHAsciiString;
266
267 end ModelCopier;