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