7fd59977 |
1 | #include <IGESGeom_SpecificModule.ixx> |
2 | #include <Interface_Macros.hxx> |
3 | |
4 | #include <IGESGeom_BSplineCurve.hxx> |
5 | #include <IGESGeom_BSplineSurface.hxx> |
6 | #include <IGESGeom_Boundary.hxx> |
7 | #include <IGESGeom_BoundedSurface.hxx> |
8 | #include <IGESGeom_CircularArc.hxx> |
9 | #include <IGESGeom_CompositeCurve.hxx> |
10 | #include <IGESGeom_ConicArc.hxx> |
11 | #include <IGESGeom_CopiousData.hxx> |
12 | #include <IGESGeom_CurveOnSurface.hxx> |
13 | #include <IGESGeom_Direction.hxx> |
14 | #include <IGESGeom_Flash.hxx> |
15 | #include <IGESGeom_Line.hxx> |
16 | #include <IGESGeom_OffsetCurve.hxx> |
17 | #include <IGESGeom_OffsetSurface.hxx> |
18 | #include <IGESGeom_Plane.hxx> |
19 | #include <IGESGeom_Point.hxx> |
20 | #include <IGESGeom_RuledSurface.hxx> |
21 | #include <IGESGeom_SplineCurve.hxx> |
22 | #include <IGESGeom_SplineSurface.hxx> |
23 | #include <IGESGeom_SurfaceOfRevolution.hxx> |
24 | #include <IGESGeom_TabulatedCylinder.hxx> |
25 | #include <IGESGeom_TransformationMatrix.hxx> |
26 | #include <IGESGeom_TrimmedSurface.hxx> |
27 | |
28 | #include <IGESGeom_ToolBSplineCurve.hxx> |
29 | #include <IGESGeom_ToolBSplineSurface.hxx> |
30 | #include <IGESGeom_ToolBoundary.hxx> |
31 | #include <IGESGeom_ToolBoundedSurface.hxx> |
32 | #include <IGESGeom_ToolCircularArc.hxx> |
33 | #include <IGESGeom_ToolCompositeCurve.hxx> |
34 | #include <IGESGeom_ToolConicArc.hxx> |
35 | #include <IGESGeom_ToolCopiousData.hxx> |
36 | #include <IGESGeom_ToolCurveOnSurface.hxx> |
37 | #include <IGESGeom_ToolDirection.hxx> |
38 | #include <IGESGeom_ToolFlash.hxx> |
39 | #include <IGESGeom_ToolLine.hxx> |
40 | #include <IGESGeom_ToolOffsetCurve.hxx> |
41 | #include <IGESGeom_ToolOffsetSurface.hxx> |
42 | #include <IGESGeom_ToolPlane.hxx> |
43 | #include <IGESGeom_ToolPoint.hxx> |
44 | #include <IGESGeom_ToolRuledSurface.hxx> |
45 | #include <IGESGeom_ToolSplineCurve.hxx> |
46 | #include <IGESGeom_ToolSplineSurface.hxx> |
47 | #include <IGESGeom_ToolSurfaceOfRevolution.hxx> |
48 | #include <IGESGeom_ToolTabulatedCylinder.hxx> |
49 | #include <IGESGeom_ToolTransformationMatrix.hxx> |
50 | #include <IGESGeom_ToolTrimmedSurface.hxx> |
51 | |
52 | |
53 | |
54 | // Each Module is attached to a Protocol : it must interprete Case Numbers |
55 | // (arguments <CN> of various methods) in accordance to values returned by |
56 | // the method TypeNumber from this Protocol |
57 | |
58 | |
59 | IGESGeom_SpecificModule::IGESGeom_SpecificModule() { } |
60 | |
61 | |
62 | void IGESGeom_SpecificModule::OwnDump |
63 | (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent, |
64 | const IGESData_IGESDumper& dumper, const Handle(Message_Messenger)& S, |
65 | const Standard_Integer own) const |
66 | { |
67 | switch (CN) { |
68 | case 1 : { |
69 | DeclareAndCast(IGESGeom_BSplineCurve,anent,ent); |
70 | if (anent.IsNull()) return; |
71 | IGESGeom_ToolBSplineCurve tool; |
72 | tool.OwnDump(anent,dumper,S,own); |
73 | } |
74 | break; |
75 | case 2 : { |
76 | DeclareAndCast(IGESGeom_BSplineSurface,anent,ent); |
77 | if (anent.IsNull()) return; |
78 | IGESGeom_ToolBSplineSurface tool; |
79 | tool.OwnDump(anent,dumper,S,own); |
80 | } |
81 | break; |
82 | case 3 : { |
83 | DeclareAndCast(IGESGeom_Boundary,anent,ent); |
84 | if (anent.IsNull()) return; |
85 | IGESGeom_ToolBoundary tool; |
86 | tool.OwnDump(anent,dumper,S,own); |
87 | } |
88 | break; |
89 | case 4 : { |
90 | DeclareAndCast(IGESGeom_BoundedSurface,anent,ent); |
91 | if (anent.IsNull()) return; |
92 | IGESGeom_ToolBoundedSurface tool; |
93 | tool.OwnDump(anent,dumper,S,own); |
94 | } |
95 | break; |
96 | case 5 : { |
97 | DeclareAndCast(IGESGeom_CircularArc,anent,ent); |
98 | if (anent.IsNull()) return; |
99 | IGESGeom_ToolCircularArc tool; |
100 | tool.OwnDump(anent,dumper,S,own); |
101 | } |
102 | break; |
103 | case 6 : { |
104 | DeclareAndCast(IGESGeom_CompositeCurve,anent,ent); |
105 | if (anent.IsNull()) return; |
106 | IGESGeom_ToolCompositeCurve tool; |
107 | tool.OwnDump(anent,dumper,S,own); |
108 | } |
109 | break; |
110 | case 7 : { |
111 | DeclareAndCast(IGESGeom_ConicArc,anent,ent); |
112 | if (anent.IsNull()) return; |
113 | IGESGeom_ToolConicArc tool; |
114 | tool.OwnDump(anent,dumper,S,own); |
115 | } |
116 | break; |
117 | case 8 : { |
118 | DeclareAndCast(IGESGeom_CopiousData,anent,ent); |
119 | if (anent.IsNull()) return; |
120 | IGESGeom_ToolCopiousData tool; |
121 | tool.OwnDump(anent,dumper,S,own); |
122 | } |
123 | break; |
124 | case 9 : { |
125 | DeclareAndCast(IGESGeom_CurveOnSurface,anent,ent); |
126 | if (anent.IsNull()) return; |
127 | IGESGeom_ToolCurveOnSurface tool; |
128 | tool.OwnDump(anent,dumper,S,own); |
129 | } |
130 | break; |
131 | case 10 : { |
132 | DeclareAndCast(IGESGeom_Direction,anent,ent); |
133 | if (anent.IsNull()) return; |
134 | IGESGeom_ToolDirection tool; |
135 | tool.OwnDump(anent,dumper,S,own); |
136 | } |
137 | break; |
138 | case 11 : { |
139 | DeclareAndCast(IGESGeom_Flash,anent,ent); |
140 | if (anent.IsNull()) return; |
141 | IGESGeom_ToolFlash tool; |
142 | tool.OwnDump(anent,dumper,S,own); |
143 | } |
144 | break; |
145 | case 12 : { |
146 | DeclareAndCast(IGESGeom_Line,anent,ent); |
147 | if (anent.IsNull()) return; |
148 | IGESGeom_ToolLine tool; |
149 | tool.OwnDump(anent,dumper,S,own); |
150 | } |
151 | break; |
152 | case 13 : { |
153 | DeclareAndCast(IGESGeom_OffsetCurve,anent,ent); |
154 | if (anent.IsNull()) return; |
155 | IGESGeom_ToolOffsetCurve tool; |
156 | tool.OwnDump(anent,dumper,S,own); |
157 | } |
158 | break; |
159 | case 14 : { |
160 | DeclareAndCast(IGESGeom_OffsetSurface,anent,ent); |
161 | if (anent.IsNull()) return; |
162 | IGESGeom_ToolOffsetSurface tool; |
163 | tool.OwnDump(anent,dumper,S,own); |
164 | } |
165 | break; |
166 | case 15 : { |
167 | DeclareAndCast(IGESGeom_Plane,anent,ent); |
168 | if (anent.IsNull()) return; |
169 | IGESGeom_ToolPlane tool; |
170 | tool.OwnDump(anent,dumper,S,own); |
171 | } |
172 | break; |
173 | case 16 : { |
174 | DeclareAndCast(IGESGeom_Point,anent,ent); |
175 | if (anent.IsNull()) return; |
176 | IGESGeom_ToolPoint tool; |
177 | tool.OwnDump(anent,dumper,S,own); |
178 | } |
179 | break; |
180 | case 17 : { |
181 | DeclareAndCast(IGESGeom_RuledSurface,anent,ent); |
182 | if (anent.IsNull()) return; |
183 | IGESGeom_ToolRuledSurface tool; |
184 | tool.OwnDump(anent,dumper,S,own); |
185 | } |
186 | break; |
187 | case 18 : { |
188 | DeclareAndCast(IGESGeom_SplineCurve,anent,ent); |
189 | if (anent.IsNull()) return; |
190 | IGESGeom_ToolSplineCurve tool; |
191 | tool.OwnDump(anent,dumper,S,own); |
192 | } |
193 | break; |
194 | case 19 : { |
195 | DeclareAndCast(IGESGeom_SplineSurface,anent,ent); |
196 | if (anent.IsNull()) return; |
197 | IGESGeom_ToolSplineSurface tool; |
198 | tool.OwnDump(anent,dumper,S,own); |
199 | } |
200 | break; |
201 | case 20 : { |
202 | DeclareAndCast(IGESGeom_SurfaceOfRevolution,anent,ent); |
203 | if (anent.IsNull()) return; |
204 | IGESGeom_ToolSurfaceOfRevolution tool; |
205 | tool.OwnDump(anent,dumper,S,own); |
206 | } |
207 | break; |
208 | case 21 : { |
209 | DeclareAndCast(IGESGeom_TabulatedCylinder,anent,ent); |
210 | if (anent.IsNull()) return; |
211 | IGESGeom_ToolTabulatedCylinder tool; |
212 | tool.OwnDump(anent,dumper,S,own); |
213 | } |
214 | break; |
215 | case 22 : { |
216 | DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent); |
217 | if (anent.IsNull()) return; |
218 | IGESGeom_ToolTransformationMatrix tool; |
219 | tool.OwnDump(anent,dumper,S,own); |
220 | } |
221 | break; |
222 | case 23 : { |
223 | DeclareAndCast(IGESGeom_TrimmedSurface,anent,ent); |
224 | if (anent.IsNull()) return; |
225 | IGESGeom_ToolTrimmedSurface tool; |
226 | tool.OwnDump(anent,dumper,S,own); |
227 | } |
228 | break; |
229 | default : break; |
230 | } |
231 | } |
232 | |
233 | |
234 | Standard_Boolean IGESGeom_SpecificModule::OwnCorrect |
235 | (const Standard_Integer CN, const Handle(IGESData_IGESEntity)& ent) const |
236 | { |
237 | // Applies only on some types |
238 | switch (CN) { |
239 | case 3 : { |
240 | DeclareAndCast(IGESGeom_Boundary,anent,ent); |
241 | if (anent.IsNull()) break; |
242 | IGESGeom_ToolBoundary tool; |
243 | return tool.OwnCorrect(anent); |
244 | } |
245 | case 7 : { |
246 | DeclareAndCast(IGESGeom_ConicArc,anent,ent); |
247 | if (anent.IsNull()) break; |
248 | IGESGeom_ToolConicArc tool; |
249 | return tool.OwnCorrect(anent); |
250 | } |
251 | case 9 : { |
252 | DeclareAndCast(IGESGeom_Boundary,anent,ent); |
253 | if (anent.IsNull()) break; |
254 | IGESGeom_ToolBoundary tool; |
255 | return tool.OwnCorrect(anent); |
256 | } |
257 | case 11 : { |
258 | DeclareAndCast(IGESGeom_Flash,anent,ent); |
259 | if (anent.IsNull()) break; |
260 | IGESGeom_ToolFlash tool; |
261 | return tool.OwnCorrect(anent); |
262 | } |
263 | case 13 : { |
264 | DeclareAndCast(IGESGeom_OffsetCurve,anent,ent); |
265 | if (anent.IsNull()) break; |
266 | IGESGeom_ToolOffsetCurve tool; |
267 | return tool.OwnCorrect(anent); |
268 | } |
269 | case 22 : { |
270 | DeclareAndCast(IGESGeom_TransformationMatrix,anent,ent); |
271 | if (anent.IsNull()) break; |
272 | IGESGeom_ToolTransformationMatrix tool; |
273 | return tool.OwnCorrect(anent); |
274 | } |
275 | default : break; |
276 | } |
277 | return Standard_False; |
278 | } |