0022627: Change OCCT memory management defaults
[occt.git] / src / IGESAppli / IGESAppli_ReadWriteModule.cxx
CommitLineData
7fd59977 1#include <IGESAppli_ReadWriteModule.ixx>
2#include <Interface_Macros.hxx>
3
4#include <IGESAppli_DrilledHole.hxx>
5#include <IGESAppli_ElementResults.hxx>
6#include <IGESAppli_FiniteElement.hxx>
7#include <IGESAppli_Flow.hxx>
8#include <IGESAppli_FlowLineSpec.hxx>
9#include <IGESAppli_LevelFunction.hxx>
10#include <IGESAppli_LevelToPWBLayerMap.hxx>
11#include <IGESAppli_LineWidening.hxx>
12#include <IGESAppli_NodalConstraint.hxx>
13#include <IGESAppli_NodalDisplAndRot.hxx>
14#include <IGESAppli_NodalResults.hxx>
15#include <IGESAppli_Node.hxx>
16#include <IGESAppli_PWBArtworkStackup.hxx>
17#include <IGESAppli_PWBDrilledHole.hxx>
18#include <IGESAppli_PartNumber.hxx>
19#include <IGESAppli_PinNumber.hxx>
20#include <IGESAppli_PipingFlow.hxx>
21#include <IGESAppli_ReferenceDesignator.hxx>
22#include <IGESAppli_RegionRestriction.hxx>
23
24#include <IGESAppli_ToolDrilledHole.hxx>
25#include <IGESAppli_ToolElementResults.hxx>
26#include <IGESAppli_ToolFiniteElement.hxx>
27#include <IGESAppli_ToolFlow.hxx>
28#include <IGESAppli_ToolFlowLineSpec.hxx>
29#include <IGESAppli_ToolLevelFunction.hxx>
30#include <IGESAppli_ToolLevelToPWBLayerMap.hxx>
31#include <IGESAppli_ToolLineWidening.hxx>
32#include <IGESAppli_ToolNodalConstraint.hxx>
33#include <IGESAppli_ToolNodalDisplAndRot.hxx>
34#include <IGESAppli_ToolNodalResults.hxx>
35#include <IGESAppli_ToolNode.hxx>
36#include <IGESAppli_ToolPWBArtworkStackup.hxx>
37#include <IGESAppli_ToolPWBDrilledHole.hxx>
38#include <IGESAppli_ToolPartNumber.hxx>
39#include <IGESAppli_ToolPinNumber.hxx>
40#include <IGESAppli_ToolPipingFlow.hxx>
41#include <IGESAppli_ToolReferenceDesignator.hxx>
42#include <IGESAppli_ToolRegionRestriction.hxx>
43
44
45
46// Each Module is attached to a Protocol : it must interprete Case Numbers
47// (arguments <CN> of various methods) in accordance to values returned by
48// the method TypeNumber from this Protocol
49
50
51 IGESAppli_ReadWriteModule::IGESAppli_ReadWriteModule () { }
52
53
54 Standard_Integer IGESAppli_ReadWriteModule::CaseIGES
55 (const Standard_Integer typenum, const Standard_Integer formnum) const
56{
57 switch (typenum) {
58 case 134 : return 12;
59 case 136 : return 3;
60 case 138 : return 10;
61 case 146 : return 11;
62 case 148 : return 2;
63 case 402 :
64 switch (formnum) {
65 case 18 : return 4;
66 case 20 : return 17;
67 default : break;
68 }
69 break;
70 case 406 :
71 switch (formnum) {
72 case 2 : return 19;
73 case 3 : return 6;
74 case 5 : return 8;
75 case 6 : return 1;
76 case 7 : return 18;
77 case 8 : return 16;
78 case 9 : return 15;
79 case 14 : return 5;
80 case 24 : return 7;
81 case 25 : return 13;
82 case 26 : return 14;
83 default : break;
84 }
85 break;
86 case 418 : return 9;
87 default : break;
88 }
89 return 0;
90}
91
92
93 void IGESAppli_ReadWriteModule::ReadOwnParams
94 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
95 const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
96{
97 switch (CN) {
98 case 1 : {
99 DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
100 if (anent.IsNull()) return;
101 IGESAppli_ToolDrilledHole tool;
102 tool.ReadOwnParams(anent,IR,PR);
103 }
104 break;
105 case 2 : {
106 DeclareAndCast(IGESAppli_ElementResults,anent,ent);
107 if (anent.IsNull()) return;
108 IGESAppli_ToolElementResults tool;
109 tool.ReadOwnParams(anent,IR,PR);
110 }
111 break;
112 case 3 : {
113 DeclareAndCast(IGESAppli_FiniteElement,anent,ent);
114 if (anent.IsNull()) return;
115 IGESAppli_ToolFiniteElement tool;
116 tool.ReadOwnParams(anent,IR,PR);
117 }
118 break;
119 case 4 : {
120 DeclareAndCast(IGESAppli_Flow,anent,ent);
121 if (anent.IsNull()) return;
122 IGESAppli_ToolFlow tool;
123 tool.ReadOwnParams(anent,IR,PR);
124 }
125 break;
126 case 5 : {
127 DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent);
128 if (anent.IsNull()) return;
129 IGESAppli_ToolFlowLineSpec tool;
130 tool.ReadOwnParams(anent,IR,PR);
131 }
132 break;
133 case 6 : {
134 DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
135 if (anent.IsNull()) return;
136 IGESAppli_ToolLevelFunction tool;
137 tool.ReadOwnParams(anent,IR,PR);
138 }
139 break;
140 case 7 : {
141 DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent);
142 if (anent.IsNull()) return;
143 IGESAppli_ToolLevelToPWBLayerMap tool;
144 tool.ReadOwnParams(anent,IR,PR);
145 }
146 break;
147 case 8 : {
148 DeclareAndCast(IGESAppli_LineWidening,anent,ent);
149 if (anent.IsNull()) return;
150 IGESAppli_ToolLineWidening tool;
151 tool.ReadOwnParams(anent,IR,PR);
152 }
153 break;
154 case 9 : {
155 DeclareAndCast(IGESAppli_NodalConstraint,anent,ent);
156 if (anent.IsNull()) return;
157 IGESAppli_ToolNodalConstraint tool;
158 tool.ReadOwnParams(anent,IR,PR);
159 }
160 break;
161 case 10 : {
162 DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent);
163 if (anent.IsNull()) return;
164 IGESAppli_ToolNodalDisplAndRot tool;
165 tool.ReadOwnParams(anent,IR,PR);
166 }
167 break;
168 case 11 : {
169 DeclareAndCast(IGESAppli_NodalResults,anent,ent);
170 if (anent.IsNull()) return;
171 IGESAppli_ToolNodalResults tool;
172 tool.ReadOwnParams(anent,IR,PR);
173 }
174 break;
175 case 12 : {
176 DeclareAndCast(IGESAppli_Node,anent,ent);
177 if (anent.IsNull()) return;
178 IGESAppli_ToolNode tool;
179 tool.ReadOwnParams(anent,IR,PR);
180 }
181 break;
182 case 13 : {
183 DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent);
184 if (anent.IsNull()) return;
185 IGESAppli_ToolPWBArtworkStackup tool;
186 tool.ReadOwnParams(anent,IR,PR);
187 }
188 break;
189 case 14 : {
190 DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
191 if (anent.IsNull()) return;
192 IGESAppli_ToolPWBDrilledHole tool;
193 tool.ReadOwnParams(anent,IR,PR);
194 }
195 break;
196 case 15 : {
197 DeclareAndCast(IGESAppli_PartNumber,anent,ent);
198 if (anent.IsNull()) return;
199 IGESAppli_ToolPartNumber tool;
200 tool.ReadOwnParams(anent,IR,PR);
201 }
202 break;
203 case 16 : {
204 DeclareAndCast(IGESAppli_PinNumber,anent,ent);
205 if (anent.IsNull()) return;
206 IGESAppli_ToolPinNumber tool;
207 tool.ReadOwnParams(anent,IR,PR);
208 }
209 break;
210 case 17 : {
211 DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
212 if (anent.IsNull()) return;
213 IGESAppli_ToolPipingFlow tool;
214 tool.ReadOwnParams(anent,IR,PR);
215 }
216 break;
217 case 18 : {
218 DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
219 if (anent.IsNull()) return;
220 IGESAppli_ToolReferenceDesignator tool;
221 tool.ReadOwnParams(anent,IR,PR);
222 }
223 break;
224 case 19 : {
225 DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
226 if (anent.IsNull()) return;
227 IGESAppli_ToolRegionRestriction tool;
228 tool.ReadOwnParams(anent,IR,PR);
229 }
230 break;
231 default : break;
232 }
233}
234
235
236 void IGESAppli_ReadWriteModule::WriteOwnParams
237 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
238 IGESData_IGESWriter& IW) const
239{
240 switch (CN) {
241 case 1 : {
242 DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
243 if (anent.IsNull()) return;
244 IGESAppli_ToolDrilledHole tool;
245 tool.WriteOwnParams(anent,IW);
246 }
247 break;
248 case 2 : {
249 DeclareAndCast(IGESAppli_ElementResults,anent,ent);
250 if (anent.IsNull()) return;
251 IGESAppli_ToolElementResults tool;
252 tool.WriteOwnParams(anent,IW);
253 }
254 break;
255 case 3 : {
256 DeclareAndCast(IGESAppli_FiniteElement,anent,ent);
257 if (anent.IsNull()) return;
258 IGESAppli_ToolFiniteElement tool;
259 tool.WriteOwnParams(anent,IW);
260 }
261 break;
262 case 4 : {
263 DeclareAndCast(IGESAppli_Flow,anent,ent);
264 if (anent.IsNull()) return;
265 IGESAppli_ToolFlow tool;
266 tool.WriteOwnParams(anent,IW);
267 }
268 break;
269 case 5 : {
270 DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent);
271 if (anent.IsNull()) return;
272 IGESAppli_ToolFlowLineSpec tool;
273 tool.WriteOwnParams(anent,IW);
274 }
275 break;
276 case 6 : {
277 DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
278 if (anent.IsNull()) return;
279 IGESAppli_ToolLevelFunction tool;
280 tool.WriteOwnParams(anent,IW);
281 }
282 break;
283 case 7 : {
284 DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent);
285 if (anent.IsNull()) return;
286 IGESAppli_ToolLevelToPWBLayerMap tool;
287 tool.WriteOwnParams(anent,IW);
288 }
289 break;
290 case 8 : {
291 DeclareAndCast(IGESAppli_LineWidening,anent,ent);
292 if (anent.IsNull()) return;
293 IGESAppli_ToolLineWidening tool;
294 tool.WriteOwnParams(anent,IW);
295 }
296 break;
297 case 9 : {
298 DeclareAndCast(IGESAppli_NodalConstraint,anent,ent);
299 if (anent.IsNull()) return;
300 IGESAppli_ToolNodalConstraint tool;
301 tool.WriteOwnParams(anent,IW);
302 }
303 break;
304 case 10 : {
305 DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent);
306 if (anent.IsNull()) return;
307 IGESAppli_ToolNodalDisplAndRot tool;
308 tool.WriteOwnParams(anent,IW);
309 }
310 break;
311 case 11 : {
312 DeclareAndCast(IGESAppli_NodalResults,anent,ent);
313 if (anent.IsNull()) return;
314 IGESAppli_ToolNodalResults tool;
315 tool.WriteOwnParams(anent,IW);
316 }
317 break;
318 case 12 : {
319 DeclareAndCast(IGESAppli_Node,anent,ent);
320 if (anent.IsNull()) return;
321 IGESAppli_ToolNode tool;
322 tool.WriteOwnParams(anent,IW);
323 }
324 break;
325 case 13 : {
326 DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent);
327 if (anent.IsNull()) return;
328 IGESAppli_ToolPWBArtworkStackup tool;
329 tool.WriteOwnParams(anent,IW);
330 }
331 break;
332 case 14 : {
333 DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
334 if (anent.IsNull()) return;
335 IGESAppli_ToolPWBDrilledHole tool;
336 tool.WriteOwnParams(anent,IW);
337 }
338 break;
339 case 15 : {
340 DeclareAndCast(IGESAppli_PartNumber,anent,ent);
341 if (anent.IsNull()) return;
342 IGESAppli_ToolPartNumber tool;
343 tool.WriteOwnParams(anent,IW);
344 }
345 break;
346 case 16 : {
347 DeclareAndCast(IGESAppli_PinNumber,anent,ent);
348 if (anent.IsNull()) return;
349 IGESAppli_ToolPinNumber tool;
350 tool.WriteOwnParams(anent,IW);
351 }
352 break;
353 case 17 : {
354 DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
355 if (anent.IsNull()) return;
356 IGESAppli_ToolPipingFlow tool;
357 tool.WriteOwnParams(anent,IW);
358 }
359 break;
360 case 18 : {
361 DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
362 if (anent.IsNull()) return;
363 IGESAppli_ToolReferenceDesignator tool;
364 tool.WriteOwnParams(anent,IW);
365 }
366 break;
367 case 19 : {
368 DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
369 if (anent.IsNull()) return;
370 IGESAppli_ToolRegionRestriction tool;
371 tool.WriteOwnParams(anent,IW);
372 }
373 break;
374 default : break;
375 }
376}