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_ReferenceDesignator.hxx>
33 #include <IGESAppli_RegionRestriction.hxx>
34 #include <IGESAppli_SpecificModule.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_IGESDumper.hxx>
55 #include <IGESData_IGESEntity.hxx>
56 #include <Interface_Macros.hxx>
57 #include <Message_Messenger.hxx>
58 #include <Standard_Type.hxx>
60 IMPLEMENT_STANDARD_RTTIEXT(IGESAppli_SpecificModule,IGESData_SpecificModule)
62 // Each Module is attached to a Protocol : it must interpret Case Numbers
63 // (arguments <CN> of various methods) in accordance to values returned by
64 // the method TypeNumber from this Protocol
65 IGESAppli_SpecificModule::IGESAppli_SpecificModule() { }
68 void IGESAppli_SpecificModule::OwnDump
69 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
70 const IGESData_IGESDumper& dumper, Standard_OStream& S,
71 const Standard_Integer own) const
75 DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
76 if (anent.IsNull()) return;
77 IGESAppli_ToolDrilledHole tool;
78 tool.OwnDump(anent,dumper,S,own);
82 DeclareAndCast(IGESAppli_ElementResults,anent,ent);
83 if (anent.IsNull()) return;
84 IGESAppli_ToolElementResults tool;
85 tool.OwnDump(anent,dumper,S,own);
89 DeclareAndCast(IGESAppli_FiniteElement,anent,ent);
90 if (anent.IsNull()) return;
91 IGESAppli_ToolFiniteElement tool;
92 tool.OwnDump(anent,dumper,S,own);
96 DeclareAndCast(IGESAppli_Flow,anent,ent);
97 if (anent.IsNull()) return;
98 IGESAppli_ToolFlow tool;
99 tool.OwnDump(anent,dumper,S,own);
103 DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent);
104 if (anent.IsNull()) return;
105 IGESAppli_ToolFlowLineSpec tool;
106 tool.OwnDump(anent,dumper,S,own);
110 DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
111 if (anent.IsNull()) return;
112 IGESAppli_ToolLevelFunction tool;
113 tool.OwnDump(anent,dumper,S,own);
117 DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent);
118 if (anent.IsNull()) return;
119 IGESAppli_ToolLevelToPWBLayerMap tool;
120 tool.OwnDump(anent,dumper,S,own);
124 DeclareAndCast(IGESAppli_LineWidening,anent,ent);
125 if (anent.IsNull()) return;
126 IGESAppli_ToolLineWidening tool;
127 tool.OwnDump(anent,dumper,S,own);
131 DeclareAndCast(IGESAppli_NodalConstraint,anent,ent) ;
132 if (anent.IsNull()) return;
133 IGESAppli_ToolNodalConstraint tool;
134 tool.OwnDump(anent,dumper,S,own);
138 DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent);
139 if (anent.IsNull()) return;
140 IGESAppli_ToolNodalDisplAndRot tool;
141 tool.OwnDump(anent,dumper,S,own);
145 DeclareAndCast(IGESAppli_NodalResults,anent,ent);
146 if (anent.IsNull()) return;
147 IGESAppli_ToolNodalResults tool;
148 tool.OwnDump(anent,dumper,S,own);
152 DeclareAndCast(IGESAppli_Node,anent,ent);
153 if (anent.IsNull()) return;
154 IGESAppli_ToolNode tool;
155 tool.OwnDump(anent,dumper,S,own);
159 DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent);
160 if (anent.IsNull()) return;
161 IGESAppli_ToolPWBArtworkStackup tool;
162 tool.OwnDump(anent,dumper,S,own);
166 DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
167 if (anent.IsNull()) return;
168 IGESAppli_ToolPWBDrilledHole tool;
169 tool.OwnDump(anent,dumper,S,own);
173 DeclareAndCast(IGESAppli_PartNumber,anent,ent);
174 if (anent.IsNull()) return;
175 IGESAppli_ToolPartNumber tool;
176 tool.OwnDump(anent,dumper,S,own);
180 DeclareAndCast(IGESAppli_PinNumber,anent,ent);
181 if (anent.IsNull()) return;
182 IGESAppli_ToolPinNumber tool;
183 tool.OwnDump(anent,dumper,S,own);
187 DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
188 if (anent.IsNull()) return;
189 IGESAppli_ToolPipingFlow tool;
190 tool.OwnDump(anent,dumper,S,own);
194 DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
195 if (anent.IsNull()) return;
196 IGESAppli_ToolReferenceDesignator tool;
197 tool.OwnDump(anent,dumper,S,own);
201 DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
202 if (anent.IsNull()) return;
203 IGESAppli_ToolRegionRestriction tool;
204 tool.OwnDump(anent,dumper,S,own);
212 Standard_Boolean IGESAppli_SpecificModule::OwnCorrect
213 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
215 // Applies only on some types
218 DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
219 if (anent.IsNull()) break;
220 IGESAppli_ToolDrilledHole tool;
221 return tool.OwnCorrect(anent);
224 DeclareAndCast(IGESAppli_Flow,anent,ent);
225 if (anent.IsNull()) break;
226 IGESAppli_ToolFlow tool;
227 return tool.OwnCorrect(anent);
230 DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
231 if (anent.IsNull()) break;
232 IGESAppli_ToolLevelFunction tool;
233 return tool.OwnCorrect(anent);
236 DeclareAndCast(IGESAppli_LineWidening,anent,ent);
237 if (anent.IsNull()) break;
238 IGESAppli_ToolLineWidening tool;
239 return tool.OwnCorrect(anent);
242 DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
243 if (anent.IsNull()) break;
244 IGESAppli_ToolPWBDrilledHole tool;
245 return tool.OwnCorrect(anent);
248 DeclareAndCast(IGESAppli_PartNumber,anent,ent);
249 if (anent.IsNull()) break;
250 IGESAppli_ToolPartNumber tool;
251 return tool.OwnCorrect(anent);
254 DeclareAndCast(IGESAppli_PinNumber,anent,ent);
255 if (anent.IsNull()) break;
256 IGESAppli_ToolPinNumber tool;
257 return tool.OwnCorrect(anent);
260 DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
261 if (anent.IsNull()) break;
262 IGESAppli_ToolPipingFlow tool;
263 return tool.OwnCorrect(anent);
266 DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
267 if (anent.IsNull()) break;
268 IGESAppli_ToolReferenceDesignator tool;
269 return tool.OwnCorrect(anent);
272 DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
273 if (anent.IsNull()) break;
274 IGESAppli_ToolRegionRestriction tool;
275 return tool.OwnCorrect(anent);
279 return Standard_False;