0024157: Parallelization of assembly part of BO
[occt.git] / src / IGESAppli / IGESAppli_SpecificModule.cxx
1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
2 //
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.
7 //
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.
10 //
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.
17
18 #include <IGESAppli_SpecificModule.ixx>
19 #include <Interface_Macros.hxx>
20
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>
40
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>
60
61
62
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
66
67
68 IGESAppli_SpecificModule::IGESAppli_SpecificModule()    {  }
69
70
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 
75 {
76   switch (CN) {
77     case  1 : {
78       DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
79       if (anent.IsNull()) return;
80       IGESAppli_ToolDrilledHole tool;
81       tool.OwnDump(anent,dumper,S,own);
82     }
83       break;
84     case  2 : {
85       DeclareAndCast(IGESAppli_ElementResults,anent,ent);
86       if (anent.IsNull()) return;
87       IGESAppli_ToolElementResults tool;
88       tool.OwnDump(anent,dumper,S,own);
89     }
90       break;
91     case  3 : {
92       DeclareAndCast(IGESAppli_FiniteElement,anent,ent);
93       if (anent.IsNull()) return;
94       IGESAppli_ToolFiniteElement tool;
95       tool.OwnDump(anent,dumper,S,own);
96     }
97       break;
98     case  4 : {
99       DeclareAndCast(IGESAppli_Flow,anent,ent);
100       if (anent.IsNull()) return;
101       IGESAppli_ToolFlow tool;
102       tool.OwnDump(anent,dumper,S,own);
103     }
104       break;
105     case  5 : {
106       DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent);
107       if (anent.IsNull()) return;
108       IGESAppli_ToolFlowLineSpec tool;
109       tool.OwnDump(anent,dumper,S,own);
110     }
111       break;
112     case  6 : {
113       DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
114       if (anent.IsNull()) return;
115       IGESAppli_ToolLevelFunction tool;
116       tool.OwnDump(anent,dumper,S,own);
117     }
118       break;
119     case  7 : {
120       DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent);
121       if (anent.IsNull()) return;
122       IGESAppli_ToolLevelToPWBLayerMap tool;
123       tool.OwnDump(anent,dumper,S,own);
124     }
125       break;
126     case  8 : {
127       DeclareAndCast(IGESAppli_LineWidening,anent,ent);
128       if (anent.IsNull()) return;
129       IGESAppli_ToolLineWidening tool;
130       tool.OwnDump(anent,dumper,S,own);
131     }
132       break;
133     case  9 : {
134       DeclareAndCast(IGESAppli_NodalConstraint,anent,ent) ;
135       if (anent.IsNull()) return;
136       IGESAppli_ToolNodalConstraint tool;
137       tool.OwnDump(anent,dumper,S,own);
138     }
139       break;
140     case 10 : {
141       DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent);
142       if (anent.IsNull()) return;
143       IGESAppli_ToolNodalDisplAndRot tool;
144       tool.OwnDump(anent,dumper,S,own);
145     }
146       break;
147     case 11 : {
148       DeclareAndCast(IGESAppli_NodalResults,anent,ent);
149       if (anent.IsNull()) return;
150       IGESAppli_ToolNodalResults tool;
151       tool.OwnDump(anent,dumper,S,own);
152     }
153       break;
154     case 12 : {
155       DeclareAndCast(IGESAppli_Node,anent,ent);
156       if (anent.IsNull()) return;
157       IGESAppli_ToolNode tool;
158       tool.OwnDump(anent,dumper,S,own);
159     }
160       break;
161     case 13 : {
162       DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent);
163       if (anent.IsNull()) return;
164       IGESAppli_ToolPWBArtworkStackup tool;
165       tool.OwnDump(anent,dumper,S,own);
166     }
167       break;
168     case 14 : {
169       DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
170       if (anent.IsNull()) return;
171       IGESAppli_ToolPWBDrilledHole tool;
172       tool.OwnDump(anent,dumper,S,own);
173     }
174       break;
175     case 15 : {
176       DeclareAndCast(IGESAppli_PartNumber,anent,ent);
177       if (anent.IsNull()) return;
178       IGESAppli_ToolPartNumber tool;
179       tool.OwnDump(anent,dumper,S,own);
180     }
181       break;
182     case 16 : {
183       DeclareAndCast(IGESAppli_PinNumber,anent,ent);
184       if (anent.IsNull()) return;
185       IGESAppli_ToolPinNumber tool;
186       tool.OwnDump(anent,dumper,S,own);
187     }
188       break;
189     case 17 : {
190       DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
191       if (anent.IsNull()) return;
192       IGESAppli_ToolPipingFlow tool;
193       tool.OwnDump(anent,dumper,S,own);
194     }
195       break;
196     case 18 : {
197       DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
198       if (anent.IsNull()) return;
199       IGESAppli_ToolReferenceDesignator tool;
200       tool.OwnDump(anent,dumper,S,own);
201     }
202       break;
203     case 19 : {
204       DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
205       if (anent.IsNull()) return;
206       IGESAppli_ToolRegionRestriction tool;
207       tool.OwnDump(anent,dumper,S,own);
208     }
209       break;
210     default : break;
211   }
212 }
213
214
215     Standard_Boolean  IGESAppli_SpecificModule::OwnCorrect
216   (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
217 {
218 //   Applies only on some types
219   switch (CN) {
220     case  1 : {
221       DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
222       if (anent.IsNull()) break;
223       IGESAppli_ToolDrilledHole tool;
224       return tool.OwnCorrect(anent);
225     }
226     case  4 : {
227       DeclareAndCast(IGESAppli_Flow,anent,ent);
228       if (anent.IsNull()) break;
229       IGESAppli_ToolFlow tool;
230       return tool.OwnCorrect(anent);
231     }
232     case  6 : {
233       DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
234       if (anent.IsNull()) break;
235       IGESAppli_ToolLevelFunction tool;
236       return tool.OwnCorrect(anent);
237     }
238     case  8 : {
239       DeclareAndCast(IGESAppli_LineWidening,anent,ent);
240       if (anent.IsNull()) break;
241       IGESAppli_ToolLineWidening tool;
242       return tool.OwnCorrect(anent);
243     }
244     case 14 : {
245       DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
246       if (anent.IsNull()) break;
247       IGESAppli_ToolPWBDrilledHole tool;
248       return tool.OwnCorrect(anent);
249     }
250     case 15 : {
251       DeclareAndCast(IGESAppli_PartNumber,anent,ent);
252       if (anent.IsNull()) break;
253       IGESAppli_ToolPartNumber tool;
254       return tool.OwnCorrect(anent);
255     }
256     case 16 : {
257       DeclareAndCast(IGESAppli_PinNumber,anent,ent);
258       if (anent.IsNull()) break;
259       IGESAppli_ToolPinNumber tool;
260       return tool.OwnCorrect(anent);
261     }
262     case 17 : {
263       DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
264       if (anent.IsNull()) break;
265       IGESAppli_ToolPipingFlow tool;
266       return tool.OwnCorrect(anent);
267     }
268     case 18 : {
269       DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
270       if (anent.IsNull()) break;
271       IGESAppli_ToolReferenceDesignator tool;
272       return tool.OwnCorrect(anent);
273     }
274     case 19 : {
275       DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
276       if (anent.IsNull()) break;
277       IGESAppli_ToolRegionRestriction tool;
278       return tool.OwnCorrect(anent);
279     }
280     default : break;
281   }
282   return Standard_False;
283 }