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