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 | |
42cf5bc1 |
15 | #include <IGESData_DirChecker.hxx> |
16 | #include <IGESData_IGESEntity.hxx> |
7fd59977 |
17 | #include <IGESGeom_Boundary.hxx> |
18 | #include <IGESGeom_BoundedSurface.hxx> |
42cf5bc1 |
19 | #include <IGESGeom_BSplineCurve.hxx> |
20 | #include <IGESGeom_BSplineSurface.hxx> |
7fd59977 |
21 | #include <IGESGeom_CircularArc.hxx> |
22 | #include <IGESGeom_CompositeCurve.hxx> |
23 | #include <IGESGeom_ConicArc.hxx> |
24 | #include <IGESGeom_CopiousData.hxx> |
25 | #include <IGESGeom_CurveOnSurface.hxx> |
26 | #include <IGESGeom_Direction.hxx> |
27 | #include <IGESGeom_Flash.hxx> |
42cf5bc1 |
28 | #include <IGESGeom_GeneralModule.hxx> |
7fd59977 |
29 | #include <IGESGeom_Line.hxx> |
30 | #include <IGESGeom_OffsetCurve.hxx> |
31 | #include <IGESGeom_OffsetSurface.hxx> |
32 | #include <IGESGeom_Plane.hxx> |
33 | #include <IGESGeom_Point.hxx> |
34 | #include <IGESGeom_RuledSurface.hxx> |
35 | #include <IGESGeom_SplineCurve.hxx> |
36 | #include <IGESGeom_SplineSurface.hxx> |
37 | #include <IGESGeom_SurfaceOfRevolution.hxx> |
38 | #include <IGESGeom_TabulatedCylinder.hxx> |
7fd59977 |
39 | #include <IGESGeom_ToolBoundary.hxx> |
40 | #include <IGESGeom_ToolBoundedSurface.hxx> |
42cf5bc1 |
41 | #include <IGESGeom_ToolBSplineCurve.hxx> |
42 | #include <IGESGeom_ToolBSplineSurface.hxx> |
7fd59977 |
43 | #include <IGESGeom_ToolCircularArc.hxx> |
44 | #include <IGESGeom_ToolCompositeCurve.hxx> |
45 | #include <IGESGeom_ToolConicArc.hxx> |
46 | #include <IGESGeom_ToolCopiousData.hxx> |
47 | #include <IGESGeom_ToolCurveOnSurface.hxx> |
48 | #include <IGESGeom_ToolDirection.hxx> |
49 | #include <IGESGeom_ToolFlash.hxx> |
50 | #include <IGESGeom_ToolLine.hxx> |
51 | #include <IGESGeom_ToolOffsetCurve.hxx> |
52 | #include <IGESGeom_ToolOffsetSurface.hxx> |
53 | #include <IGESGeom_ToolPlane.hxx> |
54 | #include <IGESGeom_ToolPoint.hxx> |
55 | #include <IGESGeom_ToolRuledSurface.hxx> |
56 | #include <IGESGeom_ToolSplineCurve.hxx> |
57 | #include <IGESGeom_ToolSplineSurface.hxx> |
58 | #include <IGESGeom_ToolSurfaceOfRevolution.hxx> |
59 | #include <IGESGeom_ToolTabulatedCylinder.hxx> |
60 | #include <IGESGeom_ToolTransformationMatrix.hxx> |
61 | #include <IGESGeom_ToolTrimmedSurface.hxx> |
42cf5bc1 |
62 | #include <IGESGeom_TransformationMatrix.hxx> |
63 | #include <IGESGeom_TrimmedSurface.hxx> |
64 | #include <Interface_Category.hxx> |
65 | #include <Interface_Check.hxx> |
66 | #include <Interface_CopyTool.hxx> |
67 | #include <Interface_EntityIterator.hxx> |
68 | #include <Interface_Macros.hxx> |
69 | #include <Interface_ShareTool.hxx> |
70 | #include <Standard_Transient.hxx> |
71 | #include <Standard_Type.hxx> |
7fd59977 |
72 | |
73 | // Each Module is attached to a Protocol : it must interprete Case Numbers |
74 | // (arguments <CN> of various methods) in accordance to values returned by |
75 | // the method TypeNumber from this Protocol |
b311480e |
76 | IGESGeom_GeneralModule::IGESGeom_GeneralModule () { } |
7fd59977 |
77 | |
78 | |
79 | void IGESGeom_GeneralModule::OwnSharedCase |
80 | (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, |
81 | Interface_EntityIterator& iter) const |
82 | { |
83 | switch (CN) { |
84 | case 1 : { |
85 | DeclareAndCast(IGESGeom_BSplineCurve,anent,ent); |
86 | if (anent.IsNull()) return; |
87 | IGESGeom_ToolBSplineCurve tool; |
88 | tool.OwnShared(anent,iter); |
89 | } |
90 | break; |
91 | case 2 : { |
92 | DeclareAndCast(IGESGeom_BSplineSurface,anent,ent); |
93 | if (anent.IsNull()) return; |
94 | IGESGeom_ToolBSplineSurface tool; |
95 | tool.OwnShared(anent,iter); |
96 | } |
97 | break; |
98 | case 3 : { |
99 | DeclareAndCast(IGESGeom_Boundary,anent,ent); |
100 | if (anent.IsNull()) return; |
101 | IGESGeom_ToolBoundary tool; |
102 | tool.OwnShared(anent,iter); |
103 | } |
104 | break; |
105 | case 4 : { |
106 | DeclareAndCast(IGESGeom_BoundedSurface,anent,ent); |
107 | if (anent.IsNull()) return; |
108 | IGESGeom_ToolBoundedSurface tool; |
109 | tool.OwnShared(anent,iter); |
110 | } |
111 | break; |
112 | case 5 : { |
113 | DeclareAndCast(IGESGeom_CircularArc,anent,ent); |
114 | if (anent.IsNull()) return; |
115 | IGESGeom_ToolCircularArc tool; |
116 | tool.OwnShared(anent,iter); |
117 | } |
118 | break; |
119 | case 6 : { |
120 | DeclareAndCast(IGESGeom_CompositeCurve,anent,ent); |
121 | if (anent.IsNull()) return; |
122 | IGESGeom_ToolCompositeCurve tool; |
123 | tool.OwnShared(anent,iter); |
124 | } |
125 | break; |
126 | case 7 : { |
127 | DeclareAndCast(IGESGeom_ConicArc,anent,ent); |
128 | if (anent.IsNull()) return; |
129 | IGESGeom_ToolConicArc tool; |
130 | tool.OwnShared(anent,iter); |
131 | } |
132 | break; |
133 | case 8 : { |
134 | DeclareAndCast(IGESGeom_CopiousData,anent,ent); |
135 | if (anent.IsNull()) return; |
136 | IGESGeom_ToolCopiousData tool; |
137 | tool.OwnShared(anent,iter); |
138 | } |
139 | break; |
140 | case 9 : { |
141 | DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent); |
142 | if (anent.IsNull()) return; |
143 | IGESGeom_ToolCurveOnSurface tool; |
144 | tool.OwnShared(anent,iter); |
145 | } |
146 | break; |
147 | case 10 : { |
148 | DeclareAndCast(IGESGeom_Direction,anent,ent); |
149 | if (anent.IsNull()) return; |
150 | IGESGeom_ToolDirection tool; |
151 | tool.OwnShared(anent,iter); |
152 | } |
153 | break; |
154 | case 11 : { |
155 | DeclareAndCast(IGESGeom_Flash,anent,ent); |
156 | if (anent.IsNull()) return; |
157 | IGESGeom_ToolFlash tool; |
158 | tool.OwnShared(anent,iter); |
159 | } |
160 | break; |
161 | case 12 : { |
162 | DeclareAndCast(IGESGeom_Line,anent,ent); |
163 | if (anent.IsNull()) return; |
164 | IGESGeom_ToolLine tool; |
165 | tool.OwnShared(anent,iter); |
166 | } |
167 | break; |
168 | case 13 : { |
169 | DeclareAndCast(IGESGeom_OffsetCurve,anent,ent); |
170 | if (anent.IsNull()) return; |
171 | IGESGeom_ToolOffsetCurve tool; |
172 | tool.OwnShared(anent,iter); |
173 | } |
174 | break; |
175 | case 14 : { |
176 | DeclareAndCast(IGESGeom_OffsetSurface,anent,ent); |
177 | if (anent.IsNull()) return; |
178 | IGESGeom_ToolOffsetSurface tool; |
179 | tool.OwnShared(anent,iter); |
180 | } |
181 | break; |
182 | case 15 : { |
183 | DeclareAndCast(IGESGeom_Plane,anent,ent); |
184 | if (anent.IsNull()) return; |
185 | IGESGeom_ToolPlane tool; |
186 | tool.OwnShared(anent,iter); |
187 | } |
188 | break; |
189 | case 16 : { |
190 | DeclareAndCast(IGESGeom_Point,anent,ent); |
191 | if (anent.IsNull()) return; |
192 | IGESGeom_ToolPoint tool; |
193 | tool.OwnShared(anent,iter); |
194 | } |
195 | break; |
196 | case 17 : { |
197 | DeclareAndCast(IGESGeom_RuledSurface,anent,ent); |
198 | if (anent.IsNull()) return; |
199 | IGESGeom_ToolRuledSurface tool; |
200 | tool.OwnShared(anent,iter); |
201 | } |
202 | break; |
203 | case 18 : { |
204 | DeclareAndCast(IGESGeom_SplineCurve,anent,ent); |
205 | if (anent.IsNull()) return; |
206 | IGESGeom_ToolSplineCurve tool; |
207 | tool.OwnShared(anent,iter); |
208 | } |
209 | break; |
210 | case 19 : { |
211 | DeclareAndCast(IGESGeom_SplineSurface,anent,ent); |
212 | if (anent.IsNull()) return; |
213 | IGESGeom_ToolSplineSurface tool; |
214 | tool.OwnShared(anent,iter); |
215 | } |
216 | break; |
217 | case 20 : { |
218 | DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent); |
219 | if (anent.IsNull()) return; |
220 | IGESGeom_ToolSurfaceOfRevolution tool; |
221 | tool.OwnShared(anent,iter); |
222 | } |
223 | break; |
224 | case 21 : { |
225 | DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent); |
226 | if (anent.IsNull()) return; |
227 | IGESGeom_ToolTabulatedCylinder tool; |
228 | tool.OwnShared(anent,iter); |
229 | } |
230 | break; |
231 | case 22 : { |
232 | DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent); |
233 | if (anent.IsNull()) return; |
234 | IGESGeom_ToolTransformationMatrix tool; |
235 | tool.OwnShared(anent,iter); |
236 | } |
237 | break; |
238 | case 23 : { |
239 | DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent); |
240 | if (anent.IsNull()) return; |
241 | IGESGeom_ToolTrimmedSurface tool; |
242 | tool.OwnShared(anent,iter); |
243 | } |
244 | break; |
245 | default : break; |
246 | } |
247 | } |
248 | |
249 | |
250 | IGESData_DirChecker IGESGeom_GeneralModule::DirChecker |
251 | (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const |
252 | { |
253 | switch (CN) { |
254 | case 1 : { |
255 | DeclareAndCast(IGESGeom_BSplineCurve,anent,ent); |
256 | if (anent.IsNull()) break; |
257 | IGESGeom_ToolBSplineCurve tool; |
258 | return tool.DirChecker(anent); |
259 | } |
260 | case 2 : { |
261 | DeclareAndCast(IGESGeom_BSplineSurface,anent,ent); |
262 | if (anent.IsNull()) break; |
263 | IGESGeom_ToolBSplineSurface tool; |
264 | return tool.DirChecker(anent); |
265 | } |
266 | case 3 : { |
267 | DeclareAndCast(IGESGeom_Boundary,anent,ent); |
268 | if (anent.IsNull()) break; |
269 | IGESGeom_ToolBoundary tool; |
270 | return tool.DirChecker(anent); |
271 | } |
272 | case 4 : { |
273 | DeclareAndCast(IGESGeom_BoundedSurface,anent,ent); |
274 | if (anent.IsNull()) break; |
275 | IGESGeom_ToolBoundedSurface tool; |
276 | return tool.DirChecker(anent); |
277 | } |
278 | case 5 : { |
279 | DeclareAndCast(IGESGeom_CircularArc,anent,ent); |
280 | if (anent.IsNull()) break; |
281 | IGESGeom_ToolCircularArc tool; |
282 | return tool.DirChecker(anent); |
283 | } |
284 | case 6 : { |
285 | DeclareAndCast(IGESGeom_CompositeCurve,anent,ent); |
286 | if (anent.IsNull()) break; |
287 | IGESGeom_ToolCompositeCurve tool; |
288 | return tool.DirChecker(anent); |
289 | } |
290 | case 7 : { |
291 | DeclareAndCast(IGESGeom_ConicArc,anent,ent); |
292 | if (anent.IsNull()) break; |
293 | IGESGeom_ToolConicArc tool; |
294 | return tool.DirChecker(anent); |
295 | } |
296 | case 8 : { |
297 | DeclareAndCast(IGESGeom_CopiousData,anent,ent); |
298 | if (anent.IsNull()) break; |
299 | IGESGeom_ToolCopiousData tool; |
300 | return tool.DirChecker(anent); |
301 | } |
302 | case 9 : { |
303 | DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent); |
304 | if (anent.IsNull()) break; |
305 | IGESGeom_ToolCurveOnSurface tool; |
306 | return tool.DirChecker(anent); |
307 | } |
308 | case 10 : { |
309 | DeclareAndCast(IGESGeom_Direction,anent,ent); |
310 | if (anent.IsNull()) break; |
311 | IGESGeom_ToolDirection tool; |
312 | return tool.DirChecker(anent); |
313 | } |
314 | case 11 : { |
315 | DeclareAndCast(IGESGeom_Flash,anent,ent); |
316 | if (anent.IsNull()) break; |
317 | IGESGeom_ToolFlash tool; |
318 | return tool.DirChecker(anent); |
319 | } |
320 | case 12 : { |
321 | DeclareAndCast(IGESGeom_Line,anent,ent); |
322 | if (anent.IsNull()) break; |
323 | IGESGeom_ToolLine tool; |
324 | return tool.DirChecker(anent); |
325 | } |
326 | case 13 : { |
327 | DeclareAndCast(IGESGeom_OffsetCurve,anent,ent); |
328 | if (anent.IsNull()) break; |
329 | IGESGeom_ToolOffsetCurve tool; |
330 | return tool.DirChecker(anent); |
331 | } |
332 | case 14 : { |
333 | DeclareAndCast(IGESGeom_OffsetSurface,anent,ent); |
334 | if (anent.IsNull()) break; |
335 | IGESGeom_ToolOffsetSurface tool; |
336 | return tool.DirChecker(anent); |
337 | } |
338 | case 15 : { |
339 | DeclareAndCast(IGESGeom_Plane,anent,ent); |
340 | if (anent.IsNull()) break; |
341 | IGESGeom_ToolPlane tool; |
342 | return tool.DirChecker(anent); |
343 | } |
344 | case 16 : { |
345 | DeclareAndCast(IGESGeom_Point,anent,ent); |
346 | if (anent.IsNull()) break; |
347 | IGESGeom_ToolPoint tool; |
348 | return tool.DirChecker(anent); |
349 | } |
350 | case 17 : { |
351 | DeclareAndCast(IGESGeom_RuledSurface,anent,ent); |
352 | if (anent.IsNull()) break; |
353 | IGESGeom_ToolRuledSurface tool; |
354 | return tool.DirChecker(anent); |
355 | } |
356 | case 18 : { |
357 | DeclareAndCast(IGESGeom_SplineCurve,anent,ent); |
358 | if (anent.IsNull()) break; |
359 | IGESGeom_ToolSplineCurve tool; |
360 | return tool.DirChecker(anent); |
361 | } |
362 | case 19 : { |
363 | DeclareAndCast(IGESGeom_SplineSurface,anent,ent); |
364 | if (anent.IsNull()) break; |
365 | IGESGeom_ToolSplineSurface tool; |
366 | return tool.DirChecker(anent); |
367 | } |
368 | case 20 : { |
369 | DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent); |
370 | if (anent.IsNull()) break; |
371 | IGESGeom_ToolSurfaceOfRevolution tool; |
372 | return tool.DirChecker(anent); |
373 | } |
374 | case 21 : { |
375 | DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent); |
376 | if (anent.IsNull()) break; |
377 | IGESGeom_ToolTabulatedCylinder tool; |
378 | return tool.DirChecker(anent); |
379 | } |
380 | case 22 : { |
381 | DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent); |
382 | if (anent.IsNull()) break; |
383 | IGESGeom_ToolTransformationMatrix tool; |
384 | return tool.DirChecker(anent); |
385 | } |
386 | case 23 : { |
387 | DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent); |
388 | if (anent.IsNull()) break; |
389 | IGESGeom_ToolTrimmedSurface tool; |
390 | return tool.DirChecker(anent); |
391 | } |
392 | default : break; |
393 | } |
394 | return IGESData_DirChecker(); // by default, no specific criterium |
395 | } |
396 | |
397 | |
398 | void IGESGeom_GeneralModule::OwnCheckCase |
399 | (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, |
400 | const Interface_ShareTool& shares, Handle(Interface_Check)& ach) const |
401 | { |
402 | switch (CN) { |
403 | case 1 : { |
404 | DeclareAndCast(IGESGeom_BSplineCurve,anent,ent); |
405 | if (anent.IsNull()) return; |
406 | IGESGeom_ToolBSplineCurve tool; |
407 | tool.OwnCheck(anent,shares,ach); |
408 | } |
409 | break; |
410 | case 2 : { |
411 | DeclareAndCast(IGESGeom_BSplineSurface,anent,ent); |
412 | if (anent.IsNull()) return; |
413 | IGESGeom_ToolBSplineSurface tool; |
414 | tool.OwnCheck(anent,shares,ach); |
415 | } |
416 | break; |
417 | case 3 : { |
418 | DeclareAndCast(IGESGeom_Boundary,anent,ent); |
419 | if (anent.IsNull()) return; |
420 | IGESGeom_ToolBoundary tool; |
421 | tool.OwnCheck(anent,shares,ach); |
422 | } |
423 | break; |
424 | case 4 : { |
425 | DeclareAndCast(IGESGeom_BoundedSurface,anent,ent); |
426 | if (anent.IsNull()) return; |
427 | IGESGeom_ToolBoundedSurface tool; |
428 | tool.OwnCheck(anent,shares,ach); |
429 | } |
430 | break; |
431 | case 5 : { |
432 | DeclareAndCast(IGESGeom_CircularArc,anent,ent); |
433 | if (anent.IsNull()) return; |
434 | IGESGeom_ToolCircularArc tool; |
435 | tool.OwnCheck(anent,shares,ach); |
436 | } |
437 | break; |
438 | case 6 : { |
439 | DeclareAndCast(IGESGeom_CompositeCurve,anent,ent); |
440 | if (anent.IsNull()) return; |
441 | IGESGeom_ToolCompositeCurve tool; |
442 | tool.OwnCheck(anent,shares,ach); |
443 | } |
444 | break; |
445 | case 7 : { |
446 | DeclareAndCast(IGESGeom_ConicArc,anent,ent); |
447 | if (anent.IsNull()) return; |
448 | IGESGeom_ToolConicArc tool; |
449 | tool.OwnCheck(anent,shares,ach); |
450 | } |
451 | break; |
452 | case 8 : { |
453 | DeclareAndCast(IGESGeom_CopiousData,anent,ent); |
454 | if (anent.IsNull()) return; |
455 | IGESGeom_ToolCopiousData tool; |
456 | tool.OwnCheck(anent,shares,ach); |
457 | } |
458 | break; |
459 | case 9 : { |
460 | DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent); |
461 | if (anent.IsNull()) return; |
462 | IGESGeom_ToolCurveOnSurface tool; |
463 | tool.OwnCheck(anent,shares,ach); |
464 | } |
465 | break; |
466 | case 10 : { |
467 | DeclareAndCast(IGESGeom_Direction,anent,ent); |
468 | if (anent.IsNull()) return; |
469 | IGESGeom_ToolDirection tool; |
470 | tool.OwnCheck(anent,shares,ach); |
471 | } |
472 | break; |
473 | case 11 : { |
474 | DeclareAndCast(IGESGeom_Flash,anent,ent); |
475 | if (anent.IsNull()) return; |
476 | IGESGeom_ToolFlash tool; |
477 | tool.OwnCheck(anent,shares,ach); |
478 | } |
479 | break; |
480 | case 12 : { |
481 | DeclareAndCast(IGESGeom_Line,anent,ent); |
482 | if (anent.IsNull()) return; |
483 | IGESGeom_ToolLine tool; |
484 | tool.OwnCheck(anent,shares,ach); |
485 | } |
486 | break; |
487 | case 13 : { |
488 | DeclareAndCast(IGESGeom_OffsetCurve,anent,ent); |
489 | if (anent.IsNull()) return; |
490 | IGESGeom_ToolOffsetCurve tool; |
491 | tool.OwnCheck(anent,shares,ach); |
492 | } |
493 | break; |
494 | case 14 : { |
495 | DeclareAndCast(IGESGeom_OffsetSurface,anent,ent); |
496 | if (anent.IsNull()) return; |
497 | IGESGeom_ToolOffsetSurface tool; |
498 | tool.OwnCheck(anent,shares,ach); |
499 | } |
500 | break; |
501 | case 15 : { |
502 | DeclareAndCast(IGESGeom_Plane,anent,ent); |
503 | if (anent.IsNull()) return; |
504 | IGESGeom_ToolPlane tool; |
505 | tool.OwnCheck(anent,shares,ach); |
506 | } |
507 | break; |
508 | case 16 : { |
509 | DeclareAndCast(IGESGeom_Point,anent,ent); |
510 | if (anent.IsNull()) return; |
511 | IGESGeom_ToolPoint tool; |
512 | tool.OwnCheck(anent,shares,ach); |
513 | } |
514 | break; |
515 | case 17 : { |
516 | DeclareAndCast(IGESGeom_RuledSurface,anent,ent); |
517 | if (anent.IsNull()) return; |
518 | IGESGeom_ToolRuledSurface tool; |
519 | tool.OwnCheck(anent,shares,ach); |
520 | } |
521 | break; |
522 | case 18 : { |
523 | DeclareAndCast(IGESGeom_SplineCurve,anent,ent); |
524 | if (anent.IsNull()) return; |
525 | IGESGeom_ToolSplineCurve tool; |
526 | tool.OwnCheck(anent,shares,ach); |
527 | } |
528 | break; |
529 | case 19 : { |
530 | DeclareAndCast(IGESGeom_SplineSurface,anent,ent); |
531 | if (anent.IsNull()) return; |
532 | IGESGeom_ToolSplineSurface tool; |
533 | tool.OwnCheck(anent,shares,ach); |
534 | } |
535 | break; |
536 | case 20 : { |
537 | DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent); |
538 | if (anent.IsNull()) return; |
539 | IGESGeom_ToolSurfaceOfRevolution tool; |
540 | tool.OwnCheck(anent,shares,ach); |
541 | } |
542 | break; |
543 | case 21 : { |
544 | DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent); |
545 | if (anent.IsNull()) return; |
546 | IGESGeom_ToolTabulatedCylinder tool; |
547 | tool.OwnCheck(anent,shares,ach); |
548 | } |
549 | break; |
550 | case 22 : { |
551 | DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent); |
552 | if (anent.IsNull()) return; |
553 | IGESGeom_ToolTransformationMatrix tool; |
554 | tool.OwnCheck(anent,shares,ach); |
555 | } |
556 | break; |
557 | case 23 : { |
558 | DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent); |
559 | if (anent.IsNull()) return; |
560 | IGESGeom_ToolTrimmedSurface tool; |
561 | tool.OwnCheck(anent,shares,ach); |
562 | } |
563 | break; |
564 | default : break; |
565 | } |
566 | } |
567 | |
568 | |
569 | Standard_Boolean IGESGeom_GeneralModule::NewVoid |
570 | (const Standard_Integer CN, Handle(Standard_Transient)& ent) const |
571 | { |
572 | switch (CN) { |
573 | case 1 : ent = new IGESGeom_BSplineCurve; break; |
574 | case 2 : ent = new IGESGeom_BSplineSurface; break; |
575 | case 3 : ent = new IGESGeom_Boundary; break; |
576 | case 4 : ent = new IGESGeom_BoundedSurface; break; |
577 | case 5 : ent = new IGESGeom_CircularArc; break; |
578 | case 6 : ent = new IGESGeom_CompositeCurve; break; |
579 | case 7 : ent = new IGESGeom_ConicArc; break; |
580 | case 8 : ent = new IGESGeom_CopiousData; break; |
581 | case 9 : ent = new IGESGeom_CurveOnSurface; break; |
582 | case 10 : ent = new IGESGeom_Direction; break; |
583 | case 11 : ent = new IGESGeom_Flash; break; |
584 | case 12 : ent = new IGESGeom_Line; break; |
585 | case 13 : ent = new IGESGeom_OffsetCurve; break; |
586 | case 14 : ent = new IGESGeom_OffsetSurface; break; |
587 | case 15 : ent = new IGESGeom_Plane; break; |
588 | case 16 : ent = new IGESGeom_Point; break; |
589 | case 17 : ent = new IGESGeom_RuledSurface; break; |
590 | case 18 : ent = new IGESGeom_SplineCurve; break; |
591 | case 19 : ent = new IGESGeom_SplineSurface; break; |
592 | case 20 : ent = new IGESGeom_SurfaceOfRevolution; break; |
593 | case 21 : ent = new IGESGeom_TabulatedCylinder; break; |
594 | case 22 : ent = new IGESGeom_TransformationMatrix; break; |
595 | case 23 : ent = new IGESGeom_TrimmedSurface; break; |
596 | default : return Standard_False; // by default, Failure on Recognize |
597 | } |
598 | return Standard_True; |
599 | } |
600 | |
601 | |
602 | void IGESGeom_GeneralModule::OwnCopyCase |
603 | (const Standard_Integer CN, |
604 | const Handle(IGESData_IGESEntity)& entfrom, |
605 | const Handle(IGESData_IGESEntity)& entto, |
606 | Interface_CopyTool& TC) const |
607 | { |
608 | switch (CN) { |
609 | case 1 : { |
610 | DeclareAndCast(IGESGeom_BSplineCurve,enfr,entfrom); |
611 | DeclareAndCast(IGESGeom_BSplineCurve,ento,entto); |
612 | IGESGeom_ToolBSplineCurve tool; |
613 | tool.OwnCopy(enfr,ento,TC); |
614 | } |
615 | break; |
616 | case 2 : { |
617 | DeclareAndCast(IGESGeom_BSplineSurface,enfr,entfrom); |
618 | DeclareAndCast(IGESGeom_BSplineSurface,ento,entto); |
619 | IGESGeom_ToolBSplineSurface tool; |
620 | tool.OwnCopy(enfr,ento,TC); |
621 | } |
622 | break; |
623 | case 3 : { |
624 | DeclareAndCast(IGESGeom_Boundary,enfr,entfrom); |
625 | DeclareAndCast(IGESGeom_Boundary,ento,entto); |
626 | IGESGeom_ToolBoundary tool; |
627 | tool.OwnCopy(enfr,ento,TC); |
628 | } |
629 | break; |
630 | case 4 : { |
631 | DeclareAndCast(IGESGeom_BoundedSurface,enfr,entfrom); |
632 | DeclareAndCast(IGESGeom_BoundedSurface,ento,entto); |
633 | IGESGeom_ToolBoundedSurface tool; |
634 | tool.OwnCopy(enfr,ento,TC); |
635 | } |
636 | break; |
637 | case 5 : { |
638 | DeclareAndCast(IGESGeom_CircularArc,enfr,entfrom); |
639 | DeclareAndCast(IGESGeom_CircularArc,ento,entto); |
640 | IGESGeom_ToolCircularArc tool; |
641 | tool.OwnCopy(enfr,ento,TC); |
642 | } |
643 | break; |
644 | case 6 : { |
645 | DeclareAndCast(IGESGeom_CompositeCurve,enfr,entfrom); |
646 | DeclareAndCast(IGESGeom_CompositeCurve,ento,entto); |
647 | IGESGeom_ToolCompositeCurve tool; |
648 | tool.OwnCopy(enfr,ento,TC); |
649 | } |
650 | break; |
651 | case 7 : { |
652 | DeclareAndCast(IGESGeom_ConicArc,enfr,entfrom); |
653 | DeclareAndCast(IGESGeom_ConicArc,ento,entto); |
654 | IGESGeom_ToolConicArc tool; |
655 | tool.OwnCopy(enfr,ento,TC); |
656 | } |
657 | break; |
658 | case 8 : { |
659 | DeclareAndCast(IGESGeom_CopiousData,enfr,entfrom); |
660 | DeclareAndCast(IGESGeom_CopiousData,ento,entto); |
661 | IGESGeom_ToolCopiousData tool; |
662 | tool.OwnCopy(enfr,ento,TC); |
663 | } |
664 | break; |
665 | case 9 : { |
666 | DeclareAndCast(IGESGeom_CurveOnSurface,enfr,entfrom); |
667 | DeclareAndCast(IGESGeom_CurveOnSurface,ento,entto); |
668 | IGESGeom_ToolCurveOnSurface tool; |
669 | tool.OwnCopy(enfr,ento,TC); |
670 | } |
671 | break; |
672 | case 10 : { |
673 | DeclareAndCast(IGESGeom_Direction,enfr,entfrom); |
674 | DeclareAndCast(IGESGeom_Direction,ento,entto); |
675 | IGESGeom_ToolDirection tool; |
676 | tool.OwnCopy(enfr,ento,TC); |
677 | } |
678 | break; |
679 | case 11 : { |
680 | DeclareAndCast(IGESGeom_Flash,enfr,entfrom); |
681 | DeclareAndCast(IGESGeom_Flash,ento,entto); |
682 | IGESGeom_ToolFlash tool; |
683 | tool.OwnCopy(enfr,ento,TC); |
684 | } |
685 | break; |
686 | case 12 : { |
687 | DeclareAndCast(IGESGeom_Line,enfr,entfrom); |
688 | DeclareAndCast(IGESGeom_Line,ento,entto); |
689 | IGESGeom_ToolLine tool; |
690 | tool.OwnCopy(enfr,ento,TC); |
691 | } |
692 | break; |
693 | case 13 : { |
694 | DeclareAndCast(IGESGeom_OffsetCurve,enfr,entfrom); |
695 | DeclareAndCast(IGESGeom_OffsetCurve,ento,entto); |
696 | IGESGeom_ToolOffsetCurve tool; |
697 | tool.OwnCopy(enfr,ento,TC); |
698 | } |
699 | break; |
700 | case 14 : { |
701 | DeclareAndCast(IGESGeom_OffsetSurface,enfr,entfrom); |
702 | DeclareAndCast(IGESGeom_OffsetSurface,ento,entto); |
703 | IGESGeom_ToolOffsetSurface tool; |
704 | tool.OwnCopy(enfr,ento,TC); |
705 | } |
706 | break; |
707 | case 15 : { |
708 | DeclareAndCast(IGESGeom_Plane,enfr,entfrom); |
709 | DeclareAndCast(IGESGeom_Plane,ento,entto); |
710 | IGESGeom_ToolPlane tool; |
711 | tool.OwnCopy(enfr,ento,TC); |
712 | } |
713 | break; |
714 | case 16 : { |
715 | DeclareAndCast(IGESGeom_Point,enfr,entfrom); |
716 | DeclareAndCast(IGESGeom_Point,ento,entto); |
717 | IGESGeom_ToolPoint tool; |
718 | tool.OwnCopy(enfr,ento,TC); |
719 | } |
720 | break; |
721 | case 17 : { |
722 | DeclareAndCast(IGESGeom_RuledSurface,enfr,entfrom); |
723 | DeclareAndCast(IGESGeom_RuledSurface,ento,entto); |
724 | IGESGeom_ToolRuledSurface tool; |
725 | tool.OwnCopy(enfr,ento,TC); |
726 | } |
727 | break; |
728 | case 18 : { |
729 | DeclareAndCast(IGESGeom_SplineCurve,enfr,entfrom); |
730 | DeclareAndCast(IGESGeom_SplineCurve,ento,entto); |
731 | IGESGeom_ToolSplineCurve tool; |
732 | tool.OwnCopy(enfr,ento,TC); |
733 | } |
734 | break; |
735 | case 19 : { |
736 | DeclareAndCast(IGESGeom_SplineSurface,enfr,entfrom); |
737 | DeclareAndCast(IGESGeom_SplineSurface,ento,entto); |
738 | IGESGeom_ToolSplineSurface tool; |
739 | tool.OwnCopy(enfr,ento,TC); |
740 | } |
741 | break; |
742 | case 20 : { |
743 | DeclareAndCast(IGESGeom_SurfaceOfRevolution,enfr,entfrom); |
744 | DeclareAndCast(IGESGeom_SurfaceOfRevolution,ento,entto); |
745 | IGESGeom_ToolSurfaceOfRevolution tool; |
746 | tool.OwnCopy(enfr,ento,TC); |
747 | } |
748 | break; |
749 | case 21 : { |
750 | DeclareAndCast(IGESGeom_TabulatedCylinder,enfr,entfrom); |
751 | DeclareAndCast(IGESGeom_TabulatedCylinder,ento,entto); |
752 | IGESGeom_ToolTabulatedCylinder tool; |
753 | tool.OwnCopy(enfr,ento,TC); |
754 | } |
755 | break; |
756 | case 22 : { |
757 | DeclareAndCast(IGESGeom_TransformationMatrix,enfr,entfrom); |
758 | DeclareAndCast(IGESGeom_TransformationMatrix,ento,entto); |
759 | IGESGeom_ToolTransformationMatrix tool; |
760 | tool.OwnCopy(enfr,ento,TC); |
761 | } |
762 | break; |
763 | case 23 : { |
764 | DeclareAndCast(IGESGeom_TrimmedSurface,enfr,entfrom); |
765 | DeclareAndCast(IGESGeom_TrimmedSurface,ento,entto); |
766 | IGESGeom_ToolTrimmedSurface tool; |
767 | tool.OwnCopy(enfr,ento,TC); |
768 | } |
769 | break; |
770 | default : break; |
771 | } |
772 | } |
773 | |
774 | |
775 | Standard_Integer IGESGeom_GeneralModule::CategoryNumber |
776 | (const Standard_Integer CN, const Handle(Standard_Transient)& ent, |
777 | const Interface_ShareTool& ) const |
778 | { |
779 | if (CN == 11) return Interface_Category::Number("Drawing"); |
780 | if (CN == 15) { |
781 | DeclareAndCast(IGESGeom_Plane,anent,ent); |
782 | if (anent->HasSymbolAttach()) return Interface_Category::Number("Drawing"); |
783 | } |
784 | if (CN == 16) { |
785 | DeclareAndCast(IGESGeom_Point,anent,ent); |
786 | if (anent->HasDisplaySymbol()) return Interface_Category::Number("Drawing"); |
787 | } |
788 | if (CN == 22) return Interface_Category::Number("Auxiliary"); |
789 | return Interface_Category::Number("Shape"); |
790 | } |