0024624: Lost word in license statement in source files
[occt.git] / src / IGESAppli / IGESAppli_SpecificModule.cxx
1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
2 //
3 // This file is part of Open CASCADE Technology software library.
4 //
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.
10 //
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
13
14 #include <IGESAppli_SpecificModule.ixx>
15 #include <Interface_Macros.hxx>
16
17 #include <IGESAppli_DrilledHole.hxx>
18 #include <IGESAppli_ElementResults.hxx>
19 #include <IGESAppli_FiniteElement.hxx>
20 #include <IGESAppli_Flow.hxx>
21 #include <IGESAppli_FlowLineSpec.hxx>
22 #include <IGESAppli_LevelFunction.hxx>
23 #include <IGESAppli_LevelToPWBLayerMap.hxx>
24 #include <IGESAppli_LineWidening.hxx>
25 #include <IGESAppli_NodalConstraint.hxx>
26 #include <IGESAppli_NodalDisplAndRot.hxx>
27 #include <IGESAppli_NodalResults.hxx>
28 #include <IGESAppli_Node.hxx>
29 #include <IGESAppli_PWBArtworkStackup.hxx>
30 #include <IGESAppli_PWBDrilledHole.hxx>
31 #include <IGESAppli_PartNumber.hxx>
32 #include <IGESAppli_PinNumber.hxx>
33 #include <IGESAppli_PipingFlow.hxx>
34 #include <IGESAppli_ReferenceDesignator.hxx>
35 #include <IGESAppli_RegionRestriction.hxx>
36
37 #include <IGESAppli_ToolDrilledHole.hxx>
38 #include <IGESAppli_ToolElementResults.hxx>
39 #include <IGESAppli_ToolFiniteElement.hxx>
40 #include <IGESAppli_ToolFlow.hxx>
41 #include <IGESAppli_ToolFlowLineSpec.hxx>
42 #include <IGESAppli_ToolLevelFunction.hxx>
43 #include <IGESAppli_ToolLevelToPWBLayerMap.hxx>
44 #include <IGESAppli_ToolLineWidening.hxx>
45 #include <IGESAppli_ToolNodalConstraint.hxx>
46 #include <IGESAppli_ToolNodalDisplAndRot.hxx>
47 #include <IGESAppli_ToolNodalResults.hxx>
48 #include <IGESAppli_ToolNode.hxx>
49 #include <IGESAppli_ToolPWBArtworkStackup.hxx>
50 #include <IGESAppli_ToolPWBDrilledHole.hxx>
51 #include <IGESAppli_ToolPartNumber.hxx>
52 #include <IGESAppli_ToolPinNumber.hxx>
53 #include <IGESAppli_ToolPipingFlow.hxx>
54 #include <IGESAppli_ToolReferenceDesignator.hxx>
55 #include <IGESAppli_ToolRegionRestriction.hxx>
56
57
58
59 //  Each Module is attached to a Protocol : it must interprete Case Numbers
60 //  (arguments <CN> of various methods) in accordance to values returned by
61 //  the method TypeNumber from this Protocol
62
63
64 IGESAppli_SpecificModule::IGESAppli_SpecificModule()    {  }
65
66
67     void  IGESAppli_SpecificModule::OwnDump
68   (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent,
69    const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S,
70    const Standard_Integer own) const 
71 {
72   switch (CN) {
73     case  1 : {
74       DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
75       if (anent.IsNull()) return;
76       IGESAppli_ToolDrilledHole tool;
77       tool.OwnDump(anent,dumper,S,own);
78     }
79       break;
80     case  2 : {
81       DeclareAndCast(IGESAppli_ElementResults,anent,ent);
82       if (anent.IsNull()) return;
83       IGESAppli_ToolElementResults tool;
84       tool.OwnDump(anent,dumper,S,own);
85     }
86       break;
87     case  3 : {
88       DeclareAndCast(IGESAppli_FiniteElement,anent,ent);
89       if (anent.IsNull()) return;
90       IGESAppli_ToolFiniteElement tool;
91       tool.OwnDump(anent,dumper,S,own);
92     }
93       break;
94     case  4 : {
95       DeclareAndCast(IGESAppli_Flow,anent,ent);
96       if (anent.IsNull()) return;
97       IGESAppli_ToolFlow tool;
98       tool.OwnDump(anent,dumper,S,own);
99     }
100       break;
101     case  5 : {
102       DeclareAndCast(IGESAppli_FlowLineSpec,anent,ent);
103       if (anent.IsNull()) return;
104       IGESAppli_ToolFlowLineSpec tool;
105       tool.OwnDump(anent,dumper,S,own);
106     }
107       break;
108     case  6 : {
109       DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
110       if (anent.IsNull()) return;
111       IGESAppli_ToolLevelFunction tool;
112       tool.OwnDump(anent,dumper,S,own);
113     }
114       break;
115     case  7 : {
116       DeclareAndCast(IGESAppli_LevelToPWBLayerMap,anent,ent);
117       if (anent.IsNull()) return;
118       IGESAppli_ToolLevelToPWBLayerMap tool;
119       tool.OwnDump(anent,dumper,S,own);
120     }
121       break;
122     case  8 : {
123       DeclareAndCast(IGESAppli_LineWidening,anent,ent);
124       if (anent.IsNull()) return;
125       IGESAppli_ToolLineWidening tool;
126       tool.OwnDump(anent,dumper,S,own);
127     }
128       break;
129     case  9 : {
130       DeclareAndCast(IGESAppli_NodalConstraint,anent,ent) ;
131       if (anent.IsNull()) return;
132       IGESAppli_ToolNodalConstraint tool;
133       tool.OwnDump(anent,dumper,S,own);
134     }
135       break;
136     case 10 : {
137       DeclareAndCast(IGESAppli_NodalDisplAndRot,anent,ent);
138       if (anent.IsNull()) return;
139       IGESAppli_ToolNodalDisplAndRot tool;
140       tool.OwnDump(anent,dumper,S,own);
141     }
142       break;
143     case 11 : {
144       DeclareAndCast(IGESAppli_NodalResults,anent,ent);
145       if (anent.IsNull()) return;
146       IGESAppli_ToolNodalResults tool;
147       tool.OwnDump(anent,dumper,S,own);
148     }
149       break;
150     case 12 : {
151       DeclareAndCast(IGESAppli_Node,anent,ent);
152       if (anent.IsNull()) return;
153       IGESAppli_ToolNode tool;
154       tool.OwnDump(anent,dumper,S,own);
155     }
156       break;
157     case 13 : {
158       DeclareAndCast(IGESAppli_PWBArtworkStackup,anent,ent);
159       if (anent.IsNull()) return;
160       IGESAppli_ToolPWBArtworkStackup tool;
161       tool.OwnDump(anent,dumper,S,own);
162     }
163       break;
164     case 14 : {
165       DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
166       if (anent.IsNull()) return;
167       IGESAppli_ToolPWBDrilledHole tool;
168       tool.OwnDump(anent,dumper,S,own);
169     }
170       break;
171     case 15 : {
172       DeclareAndCast(IGESAppli_PartNumber,anent,ent);
173       if (anent.IsNull()) return;
174       IGESAppli_ToolPartNumber tool;
175       tool.OwnDump(anent,dumper,S,own);
176     }
177       break;
178     case 16 : {
179       DeclareAndCast(IGESAppli_PinNumber,anent,ent);
180       if (anent.IsNull()) return;
181       IGESAppli_ToolPinNumber tool;
182       tool.OwnDump(anent,dumper,S,own);
183     }
184       break;
185     case 17 : {
186       DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
187       if (anent.IsNull()) return;
188       IGESAppli_ToolPipingFlow tool;
189       tool.OwnDump(anent,dumper,S,own);
190     }
191       break;
192     case 18 : {
193       DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
194       if (anent.IsNull()) return;
195       IGESAppli_ToolReferenceDesignator tool;
196       tool.OwnDump(anent,dumper,S,own);
197     }
198       break;
199     case 19 : {
200       DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
201       if (anent.IsNull()) return;
202       IGESAppli_ToolRegionRestriction tool;
203       tool.OwnDump(anent,dumper,S,own);
204     }
205       break;
206     default : break;
207   }
208 }
209
210
211     Standard_Boolean  IGESAppli_SpecificModule::OwnCorrect
212   (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const
213 {
214 //   Applies only on some types
215   switch (CN) {
216     case  1 : {
217       DeclareAndCast(IGESAppli_DrilledHole,anent,ent);
218       if (anent.IsNull()) break;
219       IGESAppli_ToolDrilledHole tool;
220       return tool.OwnCorrect(anent);
221     }
222     case  4 : {
223       DeclareAndCast(IGESAppli_Flow,anent,ent);
224       if (anent.IsNull()) break;
225       IGESAppli_ToolFlow tool;
226       return tool.OwnCorrect(anent);
227     }
228     case  6 : {
229       DeclareAndCast(IGESAppli_LevelFunction,anent,ent);
230       if (anent.IsNull()) break;
231       IGESAppli_ToolLevelFunction tool;
232       return tool.OwnCorrect(anent);
233     }
234     case  8 : {
235       DeclareAndCast(IGESAppli_LineWidening,anent,ent);
236       if (anent.IsNull()) break;
237       IGESAppli_ToolLineWidening tool;
238       return tool.OwnCorrect(anent);
239     }
240     case 14 : {
241       DeclareAndCast(IGESAppli_PWBDrilledHole,anent,ent);
242       if (anent.IsNull()) break;
243       IGESAppli_ToolPWBDrilledHole tool;
244       return tool.OwnCorrect(anent);
245     }
246     case 15 : {
247       DeclareAndCast(IGESAppli_PartNumber,anent,ent);
248       if (anent.IsNull()) break;
249       IGESAppli_ToolPartNumber tool;
250       return tool.OwnCorrect(anent);
251     }
252     case 16 : {
253       DeclareAndCast(IGESAppli_PinNumber,anent,ent);
254       if (anent.IsNull()) break;
255       IGESAppli_ToolPinNumber tool;
256       return tool.OwnCorrect(anent);
257     }
258     case 17 : {
259       DeclareAndCast(IGESAppli_PipingFlow,anent,ent);
260       if (anent.IsNull()) break;
261       IGESAppli_ToolPipingFlow tool;
262       return tool.OwnCorrect(anent);
263     }
264     case 18 : {
265       DeclareAndCast(IGESAppli_ReferenceDesignator,anent,ent);
266       if (anent.IsNull()) break;
267       IGESAppli_ToolReferenceDesignator tool;
268       return tool.OwnCorrect(anent);
269     }
270     case 19 : {
271       DeclareAndCast(IGESAppli_RegionRestriction,anent,ent);
272       if (anent.IsNull()) break;
273       IGESAppli_ToolRegionRestriction tool;
274       return tool.OwnCorrect(anent);
275     }
276     default : break;
277   }
278   return Standard_False;
279 }