1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
18 #include <IGESAppli_ReadWriteModule.ixx>
19 #include <Interface_Macros.hxx>
21 #include <IGESAppli_DrilledHole.hxx>
22 #include <IGESAppli_ElementResults.hxx>
23 #include <IGESAppli_FiniteElement.hxx>
24 #include <IGESAppli_Flow.hxx>
25 #include <IGESAppli_FlowLineSpec.hxx>
26 #include <IGESAppli_LevelFunction.hxx>
27 #include <IGESAppli_LevelToPWBLayerMap.hxx>
28 #include <IGESAppli_LineWidening.hxx>
29 #include <IGESAppli_NodalConstraint.hxx>
30 #include <IGESAppli_NodalDisplAndRot.hxx>
31 #include <IGESAppli_NodalResults.hxx>
32 #include <IGESAppli_Node.hxx>
33 #include <IGESAppli_PWBArtworkStackup.hxx>
34 #include <IGESAppli_PWBDrilledHole.hxx>
35 #include <IGESAppli_PartNumber.hxx>
36 #include <IGESAppli_PinNumber.hxx>
37 #include <IGESAppli_PipingFlow.hxx>
38 #include <IGESAppli_ReferenceDesignator.hxx>
39 #include <IGESAppli_RegionRestriction.hxx>
41 #include <IGESAppli_ToolDrilledHole.hxx>
42 #include <IGESAppli_ToolElementResults.hxx>
43 #include <IGESAppli_ToolFiniteElement.hxx>
44 #include <IGESAppli_ToolFlow.hxx>
45 #include <IGESAppli_ToolFlowLineSpec.hxx>
46 #include <IGESAppli_ToolLevelFunction.hxx>
47 #include <IGESAppli_ToolLevelToPWBLayerMap.hxx>
48 #include <IGESAppli_ToolLineWidening.hxx>
49 #include <IGESAppli_ToolNodalConstraint.hxx>
50 #include <IGESAppli_ToolNodalDisplAndRot.hxx>
51 #include <IGESAppli_ToolNodalResults.hxx>
52 #include <IGESAppli_ToolNode.hxx>
53 #include <IGESAppli_ToolPWBArtworkStackup.hxx>
54 #include <IGESAppli_ToolPWBDrilledHole.hxx>
55 #include <IGESAppli_ToolPartNumber.hxx>
56 #include <IGESAppli_ToolPinNumber.hxx>
57 #include <IGESAppli_ToolPipingFlow.hxx>
58 #include <IGESAppli_ToolReferenceDesignator.hxx>
59 #include <IGESAppli_ToolRegionRestriction.hxx>
63 // Each Module is attached to a Protocol : it must interprete Case Numbers
64 // (arguments <CN> of various methods) in accordance to values returned by
65 // the method TypeNumber from this Protocol
68 IGESAppli_ReadWriteModule::IGESAppli_ReadWriteModule () { }
71 Standard_Integer IGESAppli_ReadWriteModule::CaseIGES
72 (const Standard_Integer typenum, const Standard_Integer formnum) const
110 void IGESAppli_ReadWriteModule::ReadOwnParams
111 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
112 const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
116 DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
117 if (anent.IsNull()) return;
118 IGESAppli_ToolDrilledHole tool;
119 tool.ReadOwnParams(anent,IR,PR);
123 DeclareAndCast(IGESAppli_ElementResults,anent,ent);
124 if (anent.IsNull()) return;
125 IGESAppli_ToolElementResults tool;
126 tool.ReadOwnParams(anent,IR,PR);
130 DeclareAndCast(IGESAppli_FiniteElement,anent,ent);
131 if (anent.IsNull()) return;
132 IGESAppli_ToolFiniteElement tool;
133 tool.ReadOwnParams(anent,IR,PR);
137 DeclareAndCast(IGESAppli_Flow,anent,ent);
138 if (anent.IsNull()) return;
139 IGESAppli_ToolFlow tool;
140 tool.ReadOwnParams(anent,IR,PR);
144 DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent);
145 if (anent.IsNull()) return;
146 IGESAppli_ToolFlowLineSpec tool;
147 tool.ReadOwnParams(anent,IR,PR);
151 DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
152 if (anent.IsNull()) return;
153 IGESAppli_ToolLevelFunction tool;
154 tool.ReadOwnParams(anent,IR,PR);
158 DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent);
159 if (anent.IsNull()) return;
160 IGESAppli_ToolLevelToPWBLayerMap tool;
161 tool.ReadOwnParams(anent,IR,PR);
165 DeclareAndCast(IGESAppli_LineWidening,anent,ent);
166 if (anent.IsNull()) return;
167 IGESAppli_ToolLineWidening tool;
168 tool.ReadOwnParams(anent,IR,PR);
172 DeclareAndCast(IGESAppli_NodalConstraint,anent,ent);
173 if (anent.IsNull()) return;
174 IGESAppli_ToolNodalConstraint tool;
175 tool.ReadOwnParams(anent,IR,PR);
179 DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent);
180 if (anent.IsNull()) return;
181 IGESAppli_ToolNodalDisplAndRot tool;
182 tool.ReadOwnParams(anent,IR,PR);
186 DeclareAndCast(IGESAppli_NodalResults,anent,ent);
187 if (anent.IsNull()) return;
188 IGESAppli_ToolNodalResults tool;
189 tool.ReadOwnParams(anent,IR,PR);
193 DeclareAndCast(IGESAppli_Node,anent,ent);
194 if (anent.IsNull()) return;
195 IGESAppli_ToolNode tool;
196 tool.ReadOwnParams(anent,IR,PR);
200 DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent);
201 if (anent.IsNull()) return;
202 IGESAppli_ToolPWBArtworkStackup tool;
203 tool.ReadOwnParams(anent,IR,PR);
207 DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
208 if (anent.IsNull()) return;
209 IGESAppli_ToolPWBDrilledHole tool;
210 tool.ReadOwnParams(anent,IR,PR);
214 DeclareAndCast(IGESAppli_PartNumber,anent,ent);
215 if (anent.IsNull()) return;
216 IGESAppli_ToolPartNumber tool;
217 tool.ReadOwnParams(anent,IR,PR);
221 DeclareAndCast(IGESAppli_PinNumber,anent,ent);
222 if (anent.IsNull()) return;
223 IGESAppli_ToolPinNumber tool;
224 tool.ReadOwnParams(anent,IR,PR);
228 DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
229 if (anent.IsNull()) return;
230 IGESAppli_ToolPipingFlow tool;
231 tool.ReadOwnParams(anent,IR,PR);
235 DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
236 if (anent.IsNull()) return;
237 IGESAppli_ToolReferenceDesignator tool;
238 tool.ReadOwnParams(anent,IR,PR);
242 DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
243 if (anent.IsNull()) return;
244 IGESAppli_ToolRegionRestriction tool;
245 tool.ReadOwnParams(anent,IR,PR);
253 void IGESAppli_ReadWriteModule::WriteOwnParams
254 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
255 IGESData_IGESWriter& IW) const
259 DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
260 if (anent.IsNull()) return;
261 IGESAppli_ToolDrilledHole tool;
262 tool.WriteOwnParams(anent,IW);
266 DeclareAndCast(IGESAppli_ElementResults,anent,ent);
267 if (anent.IsNull()) return;
268 IGESAppli_ToolElementResults tool;
269 tool.WriteOwnParams(anent,IW);
273 DeclareAndCast(IGESAppli_FiniteElement,anent,ent);
274 if (anent.IsNull()) return;
275 IGESAppli_ToolFiniteElement tool;
276 tool.WriteOwnParams(anent,IW);
280 DeclareAndCast(IGESAppli_Flow,anent,ent);
281 if (anent.IsNull()) return;
282 IGESAppli_ToolFlow tool;
283 tool.WriteOwnParams(anent,IW);
287 DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent);
288 if (anent.IsNull()) return;
289 IGESAppli_ToolFlowLineSpec tool;
290 tool.WriteOwnParams(anent,IW);
294 DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
295 if (anent.IsNull()) return;
296 IGESAppli_ToolLevelFunction tool;
297 tool.WriteOwnParams(anent,IW);
301 DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent);
302 if (anent.IsNull()) return;
303 IGESAppli_ToolLevelToPWBLayerMap tool;
304 tool.WriteOwnParams(anent,IW);
308 DeclareAndCast(IGESAppli_LineWidening,anent,ent);
309 if (anent.IsNull()) return;
310 IGESAppli_ToolLineWidening tool;
311 tool.WriteOwnParams(anent,IW);
315 DeclareAndCast(IGESAppli_NodalConstraint,anent,ent);
316 if (anent.IsNull()) return;
317 IGESAppli_ToolNodalConstraint tool;
318 tool.WriteOwnParams(anent,IW);
322 DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent);
323 if (anent.IsNull()) return;
324 IGESAppli_ToolNodalDisplAndRot tool;
325 tool.WriteOwnParams(anent,IW);
329 DeclareAndCast(IGESAppli_NodalResults,anent,ent);
330 if (anent.IsNull()) return;
331 IGESAppli_ToolNodalResults tool;
332 tool.WriteOwnParams(anent,IW);
336 DeclareAndCast(IGESAppli_Node,anent,ent);
337 if (anent.IsNull()) return;
338 IGESAppli_ToolNode tool;
339 tool.WriteOwnParams(anent,IW);
343 DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent);
344 if (anent.IsNull()) return;
345 IGESAppli_ToolPWBArtworkStackup tool;
346 tool.WriteOwnParams(anent,IW);
350 DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
351 if (anent.IsNull()) return;
352 IGESAppli_ToolPWBDrilledHole tool;
353 tool.WriteOwnParams(anent,IW);
357 DeclareAndCast(IGESAppli_PartNumber,anent,ent);
358 if (anent.IsNull()) return;
359 IGESAppli_ToolPartNumber tool;
360 tool.WriteOwnParams(anent,IW);
364 DeclareAndCast(IGESAppli_PinNumber,anent,ent);
365 if (anent.IsNull()) return;
366 IGESAppli_ToolPinNumber tool;
367 tool.WriteOwnParams(anent,IW);
371 DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
372 if (anent.IsNull()) return;
373 IGESAppli_ToolPipingFlow tool;
374 tool.WriteOwnParams(anent,IW);
378 DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
379 if (anent.IsNull()) return;
380 IGESAppli_ToolReferenceDesignator tool;
381 tool.WriteOwnParams(anent,IW);
385 DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
386 if (anent.IsNull()) return;
387 IGESAppli_ToolRegionRestriction tool;
388 tool.WriteOwnParams(anent,IW);