1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License 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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <IGESAppli_DrilledHole.hxx>
16 #include <IGESAppli_ElementResults.hxx>
17 #include <IGESAppli_FiniteElement.hxx>
18 #include <IGESAppli_Flow.hxx>
19 #include <IGESAppli_FlowLineSpec.hxx>
20 #include <IGESAppli_LevelFunction.hxx>
21 #include <IGESAppli_LevelToPWBLayerMap.hxx>
22 #include <IGESAppli_LineWidening.hxx>
23 #include <IGESAppli_NodalConstraint.hxx>
24 #include <IGESAppli_NodalDisplAndRot.hxx>
25 #include <IGESAppli_NodalResults.hxx>
26 #include <IGESAppli_Node.hxx>
27 #include <IGESAppli_PartNumber.hxx>
28 #include <IGESAppli_PinNumber.hxx>
29 #include <IGESAppli_PipingFlow.hxx>
30 #include <IGESAppli_PWBArtworkStackup.hxx>
31 #include <IGESAppli_PWBDrilledHole.hxx>
32 #include <IGESAppli_ReadWriteModule.hxx>
33 #include <IGESAppli_ReferenceDesignator.hxx>
34 #include <IGESAppli_RegionRestriction.hxx>
35 #include <IGESAppli_ToolDrilledHole.hxx>
36 #include <IGESAppli_ToolElementResults.hxx>
37 #include <IGESAppli_ToolFiniteElement.hxx>
38 #include <IGESAppli_ToolFlow.hxx>
39 #include <IGESAppli_ToolFlowLineSpec.hxx>
40 #include <IGESAppli_ToolLevelFunction.hxx>
41 #include <IGESAppli_ToolLevelToPWBLayerMap.hxx>
42 #include <IGESAppli_ToolLineWidening.hxx>
43 #include <IGESAppli_ToolNodalConstraint.hxx>
44 #include <IGESAppli_ToolNodalDisplAndRot.hxx>
45 #include <IGESAppli_ToolNodalResults.hxx>
46 #include <IGESAppli_ToolNode.hxx>
47 #include <IGESAppli_ToolPartNumber.hxx>
48 #include <IGESAppli_ToolPinNumber.hxx>
49 #include <IGESAppli_ToolPipingFlow.hxx>
50 #include <IGESAppli_ToolPWBArtworkStackup.hxx>
51 #include <IGESAppli_ToolPWBDrilledHole.hxx>
52 #include <IGESAppli_ToolReferenceDesignator.hxx>
53 #include <IGESAppli_ToolRegionRestriction.hxx>
54 #include <IGESData_IGESEntity.hxx>
55 #include <IGESData_IGESReaderData.hxx>
56 #include <IGESData_IGESWriter.hxx>
57 #include <IGESData_ParamReader.hxx>
58 #include <Interface_Macros.hxx>
59 #include <Standard_DomainError.hxx>
60 #include <Standard_Type.hxx>
62 IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_ReadWriteModule,IGESData_ReadWriteModule)
64 // Each Module is attached to a Protocol : it must interprete Case Numbers
65 // (arguments <CN> of various methods) in accordance to values returned by
66 // the method TypeNumber from this Protocol
67 IGESAppli_ReadWriteModule::IGESAppli_ReadWriteModule () { }
70 Standard_Integer IGESAppli_ReadWriteModule::CaseIGES
71 (const Standard_Integer typenum, const Standard_Integer formnum) const
109 void IGESAppli_ReadWriteModule::ReadOwnParams
110 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
111 const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
115 DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
116 if (anent.IsNull()) return;
117 IGESAppli_ToolDrilledHole tool;
118 tool.ReadOwnParams(anent,IR,PR);
122 DeclareAndCast(IGESAppli_ElementResults,anent,ent);
123 if (anent.IsNull()) return;
124 IGESAppli_ToolElementResults tool;
125 tool.ReadOwnParams(anent,IR,PR);
129 DeclareAndCast(IGESAppli_FiniteElement,anent,ent);
130 if (anent.IsNull()) return;
131 IGESAppli_ToolFiniteElement tool;
132 tool.ReadOwnParams(anent,IR,PR);
136 DeclareAndCast(IGESAppli_Flow,anent,ent);
137 if (anent.IsNull()) return;
138 IGESAppli_ToolFlow tool;
139 tool.ReadOwnParams(anent,IR,PR);
143 DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent);
144 if (anent.IsNull()) return;
145 IGESAppli_ToolFlowLineSpec tool;
146 tool.ReadOwnParams(anent,IR,PR);
150 DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
151 if (anent.IsNull()) return;
152 IGESAppli_ToolLevelFunction tool;
153 tool.ReadOwnParams(anent,IR,PR);
157 DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent);
158 if (anent.IsNull()) return;
159 IGESAppli_ToolLevelToPWBLayerMap tool;
160 tool.ReadOwnParams(anent,IR,PR);
164 DeclareAndCast(IGESAppli_LineWidening,anent,ent);
165 if (anent.IsNull()) return;
166 IGESAppli_ToolLineWidening tool;
167 tool.ReadOwnParams(anent,IR,PR);
171 DeclareAndCast(IGESAppli_NodalConstraint,anent,ent);
172 if (anent.IsNull()) return;
173 IGESAppli_ToolNodalConstraint tool;
174 tool.ReadOwnParams(anent,IR,PR);
178 DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent);
179 if (anent.IsNull()) return;
180 IGESAppli_ToolNodalDisplAndRot tool;
181 tool.ReadOwnParams(anent,IR,PR);
185 DeclareAndCast(IGESAppli_NodalResults,anent,ent);
186 if (anent.IsNull()) return;
187 IGESAppli_ToolNodalResults tool;
188 tool.ReadOwnParams(anent,IR,PR);
192 DeclareAndCast(IGESAppli_Node,anent,ent);
193 if (anent.IsNull()) return;
194 IGESAppli_ToolNode tool;
195 tool.ReadOwnParams(anent,IR,PR);
199 DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent);
200 if (anent.IsNull()) return;
201 IGESAppli_ToolPWBArtworkStackup tool;
202 tool.ReadOwnParams(anent,IR,PR);
206 DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
207 if (anent.IsNull()) return;
208 IGESAppli_ToolPWBDrilledHole tool;
209 tool.ReadOwnParams(anent,IR,PR);
213 DeclareAndCast(IGESAppli_PartNumber,anent,ent);
214 if (anent.IsNull()) return;
215 IGESAppli_ToolPartNumber tool;
216 tool.ReadOwnParams(anent,IR,PR);
220 DeclareAndCast(IGESAppli_PinNumber,anent,ent);
221 if (anent.IsNull()) return;
222 IGESAppli_ToolPinNumber tool;
223 tool.ReadOwnParams(anent,IR,PR);
227 DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
228 if (anent.IsNull()) return;
229 IGESAppli_ToolPipingFlow tool;
230 tool.ReadOwnParams(anent,IR,PR);
234 DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
235 if (anent.IsNull()) return;
236 IGESAppli_ToolReferenceDesignator tool;
237 tool.ReadOwnParams(anent,IR,PR);
241 DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
242 if (anent.IsNull()) return;
243 IGESAppli_ToolRegionRestriction tool;
244 tool.ReadOwnParams(anent,IR,PR);
252 void IGESAppli_ReadWriteModule::WriteOwnParams
253 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
254 IGESData_IGESWriter& IW) const
258 DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
259 if (anent.IsNull()) return;
260 IGESAppli_ToolDrilledHole tool;
261 tool.WriteOwnParams(anent,IW);
265 DeclareAndCast(IGESAppli_ElementResults,anent,ent);
266 if (anent.IsNull()) return;
267 IGESAppli_ToolElementResults tool;
268 tool.WriteOwnParams(anent,IW);
272 DeclareAndCast(IGESAppli_FiniteElement,anent,ent);
273 if (anent.IsNull()) return;
274 IGESAppli_ToolFiniteElement tool;
275 tool.WriteOwnParams(anent,IW);
279 DeclareAndCast(IGESAppli_Flow,anent,ent);
280 if (anent.IsNull()) return;
281 IGESAppli_ToolFlow tool;
282 tool.WriteOwnParams(anent,IW);
286 DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent);
287 if (anent.IsNull()) return;
288 IGESAppli_ToolFlowLineSpec tool;
289 tool.WriteOwnParams(anent,IW);
293 DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
294 if (anent.IsNull()) return;
295 IGESAppli_ToolLevelFunction tool;
296 tool.WriteOwnParams(anent,IW);
300 DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent);
301 if (anent.IsNull()) return;
302 IGESAppli_ToolLevelToPWBLayerMap tool;
303 tool.WriteOwnParams(anent,IW);
307 DeclareAndCast(IGESAppli_LineWidening,anent,ent);
308 if (anent.IsNull()) return;
309 IGESAppli_ToolLineWidening tool;
310 tool.WriteOwnParams(anent,IW);
314 DeclareAndCast(IGESAppli_NodalConstraint,anent,ent);
315 if (anent.IsNull()) return;
316 IGESAppli_ToolNodalConstraint tool;
317 tool.WriteOwnParams(anent,IW);
321 DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent);
322 if (anent.IsNull()) return;
323 IGESAppli_ToolNodalDisplAndRot tool;
324 tool.WriteOwnParams(anent,IW);
328 DeclareAndCast(IGESAppli_NodalResults,anent,ent);
329 if (anent.IsNull()) return;
330 IGESAppli_ToolNodalResults tool;
331 tool.WriteOwnParams(anent,IW);
335 DeclareAndCast(IGESAppli_Node,anent,ent);
336 if (anent.IsNull()) return;
337 IGESAppli_ToolNode tool;
338 tool.WriteOwnParams(anent,IW);
342 DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent);
343 if (anent.IsNull()) return;
344 IGESAppli_ToolPWBArtworkStackup tool;
345 tool.WriteOwnParams(anent,IW);
349 DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
350 if (anent.IsNull()) return;
351 IGESAppli_ToolPWBDrilledHole tool;
352 tool.WriteOwnParams(anent,IW);
356 DeclareAndCast(IGESAppli_PartNumber,anent,ent);
357 if (anent.IsNull()) return;
358 IGESAppli_ToolPartNumber tool;
359 tool.WriteOwnParams(anent,IW);
363 DeclareAndCast(IGESAppli_PinNumber,anent,ent);
364 if (anent.IsNull()) return;
365 IGESAppli_ToolPinNumber tool;
366 tool.WriteOwnParams(anent,IW);
370 DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
371 if (anent.IsNull()) return;
372 IGESAppli_ToolPipingFlow tool;
373 tool.WriteOwnParams(anent,IW);
377 DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
378 if (anent.IsNull()) return;
379 IGESAppli_ToolReferenceDesignator tool;
380 tool.WriteOwnParams(anent,IW);
384 DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
385 if (anent.IsNull()) return;
386 IGESAppli_ToolRegionRestriction tool;
387 tool.WriteOwnParams(anent,IW);