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 <IGESSolid_ReadWriteModule.ixx>
19 #include <Interface_Macros.hxx>
21 #include <IGESSolid_Block.hxx>
22 #include <IGESSolid_BooleanTree.hxx>
23 #include <IGESSolid_ConeFrustum.hxx>
24 #include <IGESSolid_ConicalSurface.hxx>
25 #include <IGESSolid_Cylinder.hxx>
26 #include <IGESSolid_CylindricalSurface.hxx>
27 #include <IGESSolid_EdgeList.hxx>
28 #include <IGESSolid_Ellipsoid.hxx>
29 #include <IGESSolid_Face.hxx>
30 #include <IGESSolid_Loop.hxx>
31 #include <IGESSolid_ManifoldSolid.hxx>
32 #include <IGESSolid_PlaneSurface.hxx>
33 #include <IGESSolid_RightAngularWedge.hxx>
34 #include <IGESSolid_SelectedComponent.hxx>
35 #include <IGESSolid_Shell.hxx>
36 #include <IGESSolid_SolidAssembly.hxx>
37 #include <IGESSolid_SolidInstance.hxx>
38 #include <IGESSolid_SolidOfLinearExtrusion.hxx>
39 #include <IGESSolid_SolidOfRevolution.hxx>
40 #include <IGESSolid_Sphere.hxx>
41 #include <IGESSolid_SphericalSurface.hxx>
42 #include <IGESSolid_ToroidalSurface.hxx>
43 #include <IGESSolid_Torus.hxx>
44 #include <IGESSolid_VertexList.hxx>
46 #include <IGESSolid_ToolBlock.hxx>
47 #include <IGESSolid_ToolBooleanTree.hxx>
48 #include <IGESSolid_ToolConeFrustum.hxx>
49 #include <IGESSolid_ToolConicalSurface.hxx>
50 #include <IGESSolid_ToolCylinder.hxx>
51 #include <IGESSolid_ToolCylindricalSurface.hxx>
52 #include <IGESSolid_ToolEdgeList.hxx>
53 #include <IGESSolid_ToolEllipsoid.hxx>
54 #include <IGESSolid_ToolFace.hxx>
55 #include <IGESSolid_ToolLoop.hxx>
56 #include <IGESSolid_ToolManifoldSolid.hxx>
57 #include <IGESSolid_ToolPlaneSurface.hxx>
58 #include <IGESSolid_ToolRightAngularWedge.hxx>
59 #include <IGESSolid_ToolSelectedComponent.hxx>
60 #include <IGESSolid_ToolShell.hxx>
61 #include <IGESSolid_ToolSolidAssembly.hxx>
62 #include <IGESSolid_ToolSolidInstance.hxx>
63 #include <IGESSolid_ToolSolidOfLinearExtrusion.hxx>
64 #include <IGESSolid_ToolSolidOfRevolution.hxx>
65 #include <IGESSolid_ToolSphere.hxx>
66 #include <IGESSolid_ToolSphericalSurface.hxx>
67 #include <IGESSolid_ToolToroidalSurface.hxx>
68 #include <IGESSolid_ToolTorus.hxx>
69 #include <IGESSolid_ToolVertexList.hxx>
73 // Each Module is attached to a Protocol : it must interprete Case Numbers
74 // (arguments <CN> of various methods) in accordance to values returned by
75 // the method TypeNumber from this Protocol
78 IGESSolid_ReadWriteModule::IGESSolid_ReadWriteModule () { }
81 Standard_Integer IGESSolid_ReadWriteModule::CaseIGES
82 (const Standard_Integer typenum, const Standard_Integer /*formnum*/) const
101 case 196 : return 21;
102 case 198 : return 22;
103 case 430 : return 17;
104 case 502 : return 24;
106 case 508 : return 10;
108 case 514 : return 15;
115 void IGESSolid_ReadWriteModule::ReadOwnParams
116 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
117 const Handle(IGESData_IGESReaderData)& IR, IGESData_ParamReader& PR) const
121 DeclareAndCast(IGESSolid_Block,anent,ent);
122 if (anent.IsNull()) return;
123 IGESSolid_ToolBlock tool;
124 tool.ReadOwnParams(anent,IR,PR);
128 DeclareAndCast(IGESSolid_BooleanTree,anent,ent);
129 if (anent.IsNull()) return;
130 IGESSolid_ToolBooleanTree tool;
131 tool.ReadOwnParams(anent,IR,PR);
135 DeclareAndCast(IGESSolid_ConeFrustum,anent,ent);
136 if (anent.IsNull()) return;
137 IGESSolid_ToolConeFrustum tool;
138 tool.ReadOwnParams(anent,IR,PR);
142 DeclareAndCast(IGESSolid_ConicalSurface,anent,ent);
143 if (anent.IsNull()) return;
144 IGESSolid_ToolConicalSurface tool;
145 tool.ReadOwnParams(anent,IR,PR);
149 DeclareAndCast(IGESSolid_Cylinder,anent,ent);
150 if (anent.IsNull()) return;
151 IGESSolid_ToolCylinder tool;
152 tool.ReadOwnParams(anent,IR,PR);
156 DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent);
157 if (anent.IsNull()) return;
158 IGESSolid_ToolCylindricalSurface tool;
159 tool.ReadOwnParams(anent,IR,PR);
163 DeclareAndCast(IGESSolid_EdgeList,anent,ent);
164 if (anent.IsNull()) return;
165 IGESSolid_ToolEdgeList tool;
166 tool.ReadOwnParams(anent,IR,PR);
170 DeclareAndCast(IGESSolid_Ellipsoid,anent,ent);
171 if (anent.IsNull()) return;
172 IGESSolid_ToolEllipsoid tool;
173 tool.ReadOwnParams(anent,IR,PR);
177 DeclareAndCast(IGESSolid_Face,anent,ent);
178 if (anent.IsNull()) return;
179 IGESSolid_ToolFace tool;
180 tool.ReadOwnParams(anent,IR,PR);
184 DeclareAndCast(IGESSolid_Loop,anent,ent);
185 if (anent.IsNull()) return;
186 IGESSolid_ToolLoop tool;
187 tool.ReadOwnParams(anent,IR,PR);
191 DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent);
192 if (anent.IsNull()) return;
193 IGESSolid_ToolManifoldSolid tool;
194 tool.ReadOwnParams(anent,IR,PR);
198 DeclareAndCast(IGESSolid_PlaneSurface,anent,ent);
199 if (anent.IsNull()) return;
200 IGESSolid_ToolPlaneSurface tool;
201 tool.ReadOwnParams(anent,IR,PR);
205 DeclareAndCast(IGESSolid_RightAngularWedge,anent,ent);
206 if (anent.IsNull()) return;
207 IGESSolid_ToolRightAngularWedge tool;
208 tool.ReadOwnParams(anent,IR,PR);
212 DeclareAndCast(IGESSolid_SelectedComponent,anent,ent);
213 if (anent.IsNull()) return;
214 IGESSolid_ToolSelectedComponent tool;
215 tool.ReadOwnParams(anent,IR,PR);
219 DeclareAndCast(IGESSolid_Shell,anent,ent);
220 if (anent.IsNull()) return;
221 IGESSolid_ToolShell tool;
222 tool.ReadOwnParams(anent,IR,PR);
226 DeclareAndCast(IGESSolid_SolidAssembly,anent,ent);
227 if (anent.IsNull()) return;
228 IGESSolid_ToolSolidAssembly tool;
229 tool.ReadOwnParams(anent,IR,PR);
233 DeclareAndCast(IGESSolid_SolidInstance,anent,ent);
234 if (anent.IsNull()) return;
235 IGESSolid_ToolSolidInstance tool;
236 tool.ReadOwnParams(anent,IR,PR);
240 DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent);
241 if (anent.IsNull()) return;
242 IGESSolid_ToolSolidOfLinearExtrusion tool;
243 tool.ReadOwnParams(anent,IR,PR);
247 DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent);
248 if (anent.IsNull()) return;
249 IGESSolid_ToolSolidOfRevolution tool;
250 tool.ReadOwnParams(anent,IR,PR);
254 DeclareAndCast(IGESSolid_Sphere,anent,ent);
255 if (anent.IsNull()) return;
256 IGESSolid_ToolSphere tool;
257 tool.ReadOwnParams(anent,IR,PR);
261 DeclareAndCast(IGESSolid_SphericalSurface,anent,ent);
262 if (anent.IsNull()) return;
263 IGESSolid_ToolSphericalSurface tool;
264 tool.ReadOwnParams(anent,IR,PR);
268 DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent);
269 if (anent.IsNull()) return;
270 IGESSolid_ToolToroidalSurface tool;
271 tool.ReadOwnParams(anent,IR,PR);
275 DeclareAndCast(IGESSolid_Torus,anent,ent);
276 if (anent.IsNull()) return;
277 IGESSolid_ToolTorus tool;
278 tool.ReadOwnParams(anent,IR,PR);
282 DeclareAndCast(IGESSolid_VertexList,anent,ent);
283 if (anent.IsNull()) return;
284 IGESSolid_ToolVertexList tool;
285 tool.ReadOwnParams(anent,IR,PR);
293 void IGESSolid_ReadWriteModule::WriteOwnParams
294 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
295 IGESData_IGESWriter& IW) const
299 DeclareAndCast(IGESSolid_Block,anent,ent);
300 if (anent.IsNull()) return;
301 IGESSolid_ToolBlock tool;
302 tool.WriteOwnParams(anent,IW);
306 DeclareAndCast(IGESSolid_BooleanTree,anent,ent);
307 if (anent.IsNull()) return;
308 IGESSolid_ToolBooleanTree tool;
309 tool.WriteOwnParams(anent,IW);
313 DeclareAndCast(IGESSolid_ConeFrustum,anent,ent);
314 if (anent.IsNull()) return;
315 IGESSolid_ToolConeFrustum tool;
316 tool.WriteOwnParams(anent,IW);
320 DeclareAndCast(IGESSolid_ConicalSurface,anent,ent);
321 if (anent.IsNull()) return;
322 IGESSolid_ToolConicalSurface tool;
323 tool.WriteOwnParams(anent,IW);
327 DeclareAndCast(IGESSolid_Cylinder,anent,ent);
328 if (anent.IsNull()) return;
329 IGESSolid_ToolCylinder tool;
330 tool.WriteOwnParams(anent,IW);
334 DeclareAndCast(IGESSolid_CylindricalSurface,anent,ent);
335 if (anent.IsNull()) return;
336 IGESSolid_ToolCylindricalSurface tool;
337 tool.WriteOwnParams(anent,IW);
341 DeclareAndCast(IGESSolid_EdgeList,anent,ent);
342 if (anent.IsNull()) return;
343 IGESSolid_ToolEdgeList tool;
344 tool.WriteOwnParams(anent,IW);
348 DeclareAndCast(IGESSolid_Ellipsoid,anent,ent);
349 if (anent.IsNull()) return;
350 IGESSolid_ToolEllipsoid tool;
351 tool.WriteOwnParams(anent,IW);
355 DeclareAndCast(IGESSolid_Face,anent,ent);
356 if (anent.IsNull()) return;
357 IGESSolid_ToolFace tool;
358 tool.WriteOwnParams(anent,IW);
362 DeclareAndCast(IGESSolid_Loop,anent,ent);
363 if (anent.IsNull()) return;
364 IGESSolid_ToolLoop tool;
365 tool.WriteOwnParams(anent,IW);
369 DeclareAndCast(IGESSolid_ManifoldSolid,anent,ent);
370 if (anent.IsNull()) return;
371 IGESSolid_ToolManifoldSolid tool;
372 tool.WriteOwnParams(anent,IW);
376 DeclareAndCast(IGESSolid_PlaneSurface,anent,ent);
377 if (anent.IsNull()) return;
378 IGESSolid_ToolPlaneSurface tool;
379 tool.WriteOwnParams(anent,IW);
383 DeclareAndCast(IGESSolid_RightAngularWedge,anent,ent);
384 if (anent.IsNull()) return;
385 IGESSolid_ToolRightAngularWedge tool;
386 tool.WriteOwnParams(anent,IW);
390 DeclareAndCast(IGESSolid_SelectedComponent,anent,ent);
391 if (anent.IsNull()) return;
392 IGESSolid_ToolSelectedComponent tool;
393 tool.WriteOwnParams(anent,IW);
397 DeclareAndCast(IGESSolid_Shell,anent,ent);
398 if (anent.IsNull()) return;
399 IGESSolid_ToolShell tool;
400 tool.WriteOwnParams(anent,IW);
404 DeclareAndCast(IGESSolid_SolidAssembly,anent,ent);
405 if (anent.IsNull()) return;
406 IGESSolid_ToolSolidAssembly tool;
407 tool.WriteOwnParams(anent,IW);
411 DeclareAndCast(IGESSolid_SolidInstance,anent,ent);
412 if (anent.IsNull()) return;
413 IGESSolid_ToolSolidInstance tool;
414 tool.WriteOwnParams(anent,IW);
418 DeclareAndCast(IGESSolid_SolidOfLinearExtrusion,anent,ent);
419 if (anent.IsNull()) return;
420 IGESSolid_ToolSolidOfLinearExtrusion tool;
421 tool.WriteOwnParams(anent,IW);
425 DeclareAndCast(IGESSolid_SolidOfRevolution,anent,ent);
426 if (anent.IsNull()) return;
427 IGESSolid_ToolSolidOfRevolution tool;
428 tool.WriteOwnParams(anent,IW);
432 DeclareAndCast(IGESSolid_Sphere,anent,ent);
433 if (anent.IsNull()) return;
434 IGESSolid_ToolSphere tool;
435 tool.WriteOwnParams(anent,IW);
439 DeclareAndCast(IGESSolid_SphericalSurface,anent,ent);
440 if (anent.IsNull()) return;
441 IGESSolid_ToolSphericalSurface tool;
442 tool.WriteOwnParams(anent,IW);
446 DeclareAndCast(IGESSolid_ToroidalSurface,anent,ent);
447 if (anent.IsNull()) return;
448 IGESSolid_ToolToroidalSurface tool;
449 tool.WriteOwnParams(anent,IW);
453 DeclareAndCast(IGESSolid_Torus,anent,ent);
454 if (anent.IsNull()) return;
455 IGESSolid_ToolTorus tool;
456 tool.WriteOwnParams(anent,IW);
460 DeclareAndCast(IGESSolid_VertexList,anent,ent);
461 if (anent.IsNull()) return;
462 IGESSolid_ToolVertexList tool;
463 tool.WriteOwnParams(anent,IW);