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