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_SpecificModule.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_SpecificModule::IGESAppli_SpecificModule() { }
71 void IGESAppli_SpecificModule::OwnDump
72 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
73 const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S,
74 const Standard_Integer own) const
78 DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
79 if (anent.IsNull()) return;
80 IGESAppli_ToolDrilledHole tool;
81 tool.OwnDump(anent,dumper,S,own);
85 DeclareAndCast(IGESAppli_ElementResults,anent,ent);
86 if (anent.IsNull()) return;
87 IGESAppli_ToolElementResults tool;
88 tool.OwnDump(anent,dumper,S,own);
92 DeclareAndCast(IGESAppli_FiniteElement,anent,ent);
93 if (anent.IsNull()) return;
94 IGESAppli_ToolFiniteElement tool;
95 tool.OwnDump(anent,dumper,S,own);
99 DeclareAndCast(IGESAppli_Flow,anent,ent);
100 if (anent.IsNull()) return;
101 IGESAppli_ToolFlow tool;
102 tool.OwnDump(anent,dumper,S,own);
106 DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent);
107 if (anent.IsNull()) return;
108 IGESAppli_ToolFlowLineSpec tool;
109 tool.OwnDump(anent,dumper,S,own);
113 DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
114 if (anent.IsNull()) return;
115 IGESAppli_ToolLevelFunction tool;
116 tool.OwnDump(anent,dumper,S,own);
120 DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent);
121 if (anent.IsNull()) return;
122 IGESAppli_ToolLevelToPWBLayerMap tool;
123 tool.OwnDump(anent,dumper,S,own);
127 DeclareAndCast(IGESAppli_LineWidening,anent,ent);
128 if (anent.IsNull()) return;
129 IGESAppli_ToolLineWidening tool;
130 tool.OwnDump(anent,dumper,S,own);
134 DeclareAndCast(IGESAppli_NodalConstraint,anent,ent) ;
135 if (anent.IsNull()) return;
136 IGESAppli_ToolNodalConstraint tool;
137 tool.OwnDump(anent,dumper,S,own);
141 DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent);
142 if (anent.IsNull()) return;
143 IGESAppli_ToolNodalDisplAndRot tool;
144 tool.OwnDump(anent,dumper,S,own);
148 DeclareAndCast(IGESAppli_NodalResults,anent,ent);
149 if (anent.IsNull()) return;
150 IGESAppli_ToolNodalResults tool;
151 tool.OwnDump(anent,dumper,S,own);
155 DeclareAndCast(IGESAppli_Node,anent,ent);
156 if (anent.IsNull()) return;
157 IGESAppli_ToolNode tool;
158 tool.OwnDump(anent,dumper,S,own);
162 DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent);
163 if (anent.IsNull()) return;
164 IGESAppli_ToolPWBArtworkStackup tool;
165 tool.OwnDump(anent,dumper,S,own);
169 DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
170 if (anent.IsNull()) return;
171 IGESAppli_ToolPWBDrilledHole tool;
172 tool.OwnDump(anent,dumper,S,own);
176 DeclareAndCast(IGESAppli_PartNumber,anent,ent);
177 if (anent.IsNull()) return;
178 IGESAppli_ToolPartNumber tool;
179 tool.OwnDump(anent,dumper,S,own);
183 DeclareAndCast(IGESAppli_PinNumber,anent,ent);
184 if (anent.IsNull()) return;
185 IGESAppli_ToolPinNumber tool;
186 tool.OwnDump(anent,dumper,S,own);
190 DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
191 if (anent.IsNull()) return;
192 IGESAppli_ToolPipingFlow tool;
193 tool.OwnDump(anent,dumper,S,own);
197 DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
198 if (anent.IsNull()) return;
199 IGESAppli_ToolReferenceDesignator tool;
200 tool.OwnDump(anent,dumper,S,own);
204 DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
205 if (anent.IsNull()) return;
206 IGESAppli_ToolRegionRestriction tool;
207 tool.OwnDump(anent,dumper,S,own);
215 Standard_Boolean IGESAppli_SpecificModule::OwnCorrect
216 (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
218 // Applies only on some types
221 DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
222 if (anent.IsNull()) break;
223 IGESAppli_ToolDrilledHole tool;
224 return tool.OwnCorrect(anent);
227 DeclareAndCast(IGESAppli_Flow,anent,ent);
228 if (anent.IsNull()) break;
229 IGESAppli_ToolFlow tool;
230 return tool.OwnCorrect(anent);
233 DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
234 if (anent.IsNull()) break;
235 IGESAppli_ToolLevelFunction tool;
236 return tool.OwnCorrect(anent);
239 DeclareAndCast(IGESAppli_LineWidening,anent,ent);
240 if (anent.IsNull()) break;
241 IGESAppli_ToolLineWidening tool;
242 return tool.OwnCorrect(anent);
245 DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
246 if (anent.IsNull()) break;
247 IGESAppli_ToolPWBDrilledHole tool;
248 return tool.OwnCorrect(anent);
251 DeclareAndCast(IGESAppli_PartNumber,anent,ent);
252 if (anent.IsNull()) break;
253 IGESAppli_ToolPartNumber tool;
254 return tool.OwnCorrect(anent);
257 DeclareAndCast(IGESAppli_PinNumber,anent,ent);
258 if (anent.IsNull()) break;
259 IGESAppli_ToolPinNumber tool;
260 return tool.OwnCorrect(anent);
263 DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
264 if (anent.IsNull()) break;
265 IGESAppli_ToolPipingFlow tool;
266 return tool.OwnCorrect(anent);
269 DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
270 if (anent.IsNull()) break;
271 IGESAppli_ToolReferenceDesignator tool;
272 return tool.OwnCorrect(anent);
275 DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
276 if (anent.IsNull()) break;
277 IGESAppli_ToolRegionRestriction tool;
278 return tool.OwnCorrect(anent);
282 return Standard_False;