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