Warnings on vc14 were eliminated
[occt.git] / src / StepElement / StepElement_ElementAspect.cxx
1 // Created on: 2002-12-10
2 // Created by: data exchange team
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 // Generator:   ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0
17
18 #include <Standard_Transient.hxx>
19 #include <StepData_SelectMember.hxx>
20 #include <StepElement_ElementAspect.hxx>
21 #include <StepElement_ElementAspectMember.hxx>
22 #include <TCollection_HAsciiString.hxx>
23
24 //=======================================================================
25 //function : StepElement_ElementAspect
26 //purpose  : 
27 //=======================================================================
28 StepElement_ElementAspect::StepElement_ElementAspect ()
29 {
30 }
31
32 //=======================================================================
33 //function : CaseNum
34 //purpose  : 
35 //=======================================================================
36
37 Standard_Integer StepElement_ElementAspect::CaseNum (const Handle(Standard_Transient)& /*ent*/) const
38 {
39   return 0;
40 }
41
42 //=======================================================================
43 //function : CaseMem
44 //purpose  : 
45 //=======================================================================
46
47 Standard_Integer StepElement_ElementAspect::CaseMem (const Handle(StepData_SelectMember)& ent) const
48 {
49  if(ent.IsNull()) return 0;
50  if(ent->Matches("ELEMENT_VOLUME")) return 1;
51  else if(ent->Matches("VOLUME_3D_FACE")) return 2;
52  else if(ent->Matches("VOLUME_2D_FACE")) return 3;
53  else if(ent->Matches("VOLUME_3D_EDGE")) return 4;
54  else if(ent->Matches("VOLUME_2D_EDGE")) return 5;
55  else if(ent->Matches("SURFACE_3D_FACE")) return 6;
56  else if(ent->Matches("SURFACE_2D_FACE")) return 7;
57  else if(ent->Matches("SURFACE_3D_EDGE")) return 8;
58  else if(ent->Matches("SURFACE_2D_EDGE")) return 9;
59  else if(ent->Matches("CURVE_EDGE")) return 10;
60  else return 0;
61 }
62
63 //=======================================================================
64 //function : NewMember
65 //purpose  : 
66 //=======================================================================
67
68 Handle(StepData_SelectMember) StepElement_ElementAspect::NewMember() const
69 {
70  return new StepElement_ElementAspectMember;
71 }
72
73 //=======================================================================
74 //function : SetElementVolume
75 //purpose  : 
76 //=======================================================================
77
78 void StepElement_ElementAspect::SetElementVolume (const StepElement_ElementVolume val)
79 {
80   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
81   if(SelMem.IsNull()) return;
82  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("ELEMENT_VOLUME");
83  SelMem->SetName(name->ToCString());
84  SelMem->SetEnum((Standard_Integer)val);
85 }
86
87 //=======================================================================
88 //function : ElementVolume
89 //purpose  : 
90 //=======================================================================
91
92 StepElement_ElementVolume StepElement_ElementAspect::ElementVolume () const
93 {
94   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
95   if(SelMem.IsNull()) return StepElement_Volume;
96   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
97   name->AssignCat(SelMem->Name());
98   Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("ELEMENT_VOLUME");
99   if(name->IsDifferent(nameitem)) return StepElement_Volume;
100   Standard_Integer numit = SelMem->Enum();
101   StepElement_ElementVolume val;
102   switch(numit) {
103   case 1 : val = StepElement_Volume; break;
104     default : return StepElement_Volume;break;
105   }
106  return val;
107 }
108
109 //=======================================================================
110 //function : SetVolume3dFace
111 //purpose  : 
112 //=======================================================================
113
114 void StepElement_ElementAspect::SetVolume3dFace (const Standard_Integer val)
115 {
116   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
117   if(SelMem.IsNull()) return;
118  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("VOLUME_3D_FACE");
119  SelMem->SetName(name->ToCString());
120  SelMem->SetInteger(val);
121 }
122
123 //=======================================================================
124 //function : Volume3dFace
125 //purpose  : 
126 //=======================================================================
127
128 Standard_Integer StepElement_ElementAspect::Volume3dFace () const
129 {
130   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
131   if(SelMem.IsNull()) return 0;
132  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
133  name->AssignCat(SelMem->Name());
134  Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("VOLUME_3D_FACE");
135  if(name->IsDifferent(nameitem)) return 0;
136  Standard_Integer val = SelMem->Integer();
137  return val;
138 }
139
140 //=======================================================================
141 //function : SetVolume2dFace
142 //purpose  : 
143 //=======================================================================
144
145 void StepElement_ElementAspect::SetVolume2dFace (const Standard_Integer val)
146 {
147   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
148   if(SelMem.IsNull()) return;
149  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("VOLUME_2D_FACE");
150  SelMem->SetName(name->ToCString());
151  SelMem->SetInteger(val);
152 }
153
154 //=======================================================================
155 //function : Volume2dFace
156 //purpose  : 
157 //=======================================================================
158
159 Standard_Integer StepElement_ElementAspect::Volume2dFace () const
160 {
161   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
162   if(SelMem.IsNull()) return 0;
163  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
164  name->AssignCat(SelMem->Name());
165  Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("VOLUME_2D_FACE");
166  if(name->IsDifferent(nameitem)) return 0;
167  Standard_Integer val = SelMem->Integer();
168  return val;
169 }
170
171 //=======================================================================
172 //function : SetVolume3dEdge
173 //purpose  : 
174 //=======================================================================
175
176 void StepElement_ElementAspect::SetVolume3dEdge (const Standard_Integer val)
177 {
178   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
179   if(SelMem.IsNull()) return;
180  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("VOLUME_3D_EDGE");
181  SelMem->SetName(name->ToCString());
182  SelMem->SetInteger(val);
183 }
184
185 //=======================================================================
186 //function : Volume3dEdge
187 //purpose  : 
188 //=======================================================================
189
190 Standard_Integer StepElement_ElementAspect::Volume3dEdge () const
191 {
192   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
193   if(SelMem.IsNull()) return 0;
194  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
195  name->AssignCat(SelMem->Name());
196  Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("VOLUME_3D_EDGE");
197  if(name->IsDifferent(nameitem)) return 0;
198  Standard_Integer val = SelMem->Integer();
199  return val;
200 }
201
202 //=======================================================================
203 //function : SetVolume2dEdge
204 //purpose  : 
205 //=======================================================================
206
207 void StepElement_ElementAspect::SetVolume2dEdge (const Standard_Integer val)
208 {
209   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
210   if(SelMem.IsNull()) return;
211  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("VOLUME_2D_EDGE");
212  SelMem->SetName(name->ToCString());
213  SelMem->SetInteger(val);
214 }
215
216 //=======================================================================
217 //function : Volume2dEdge
218 //purpose  : 
219 //=======================================================================
220
221 Standard_Integer StepElement_ElementAspect::Volume2dEdge () const
222 {
223   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
224   if(SelMem.IsNull()) return 0;
225  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
226  name->AssignCat(SelMem->Name());
227  Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("VOLUME_2D_EDGE");
228  if(name->IsDifferent(nameitem)) return 0;
229  Standard_Integer val = SelMem->Integer();
230  return val;
231 }
232
233 //=======================================================================
234 //function : SetSurface3dFace
235 //purpose  : 
236 //=======================================================================
237
238 void StepElement_ElementAspect::SetSurface3dFace (const Standard_Integer val)
239 {
240   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
241   if(SelMem.IsNull()) return;
242  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("SURFACE_3D_FACE");
243  SelMem->SetName(name->ToCString());
244  SelMem->SetInteger(val);
245 }
246
247 //=======================================================================
248 //function : Surface3dFace
249 //purpose  : 
250 //=======================================================================
251
252 Standard_Integer StepElement_ElementAspect::Surface3dFace () const
253 {
254   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
255   if(SelMem.IsNull()) return 0;
256  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
257  name->AssignCat(SelMem->Name());
258  Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("SURFACE_3D_FACE");
259  if(name->IsDifferent(nameitem)) return 0;
260  Standard_Integer val = SelMem->Integer();
261  return val;
262 }
263
264 //=======================================================================
265 //function : SetSurface2dFace
266 //purpose  : 
267 //=======================================================================
268
269 void StepElement_ElementAspect::SetSurface2dFace (const Standard_Integer val)
270 {
271   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
272   if(SelMem.IsNull()) return;
273  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("SURFACE_2D_FACE");
274  SelMem->SetName(name->ToCString());
275  SelMem->SetInteger(val);
276 }
277
278 //=======================================================================
279 //function : Surface2dFace
280 //purpose  : 
281 //=======================================================================
282
283 Standard_Integer StepElement_ElementAspect::Surface2dFace () const
284 {
285   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
286   if(SelMem.IsNull()) return 0;
287  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
288  name->AssignCat(SelMem->Name());
289  Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("SURFACE_2D_FACE");
290  if(name->IsDifferent(nameitem)) return 0;
291  Standard_Integer val = SelMem->Integer();
292  return val;
293 }
294
295 //=======================================================================
296 //function : SetSurface3dEdge
297 //purpose  : 
298 //=======================================================================
299
300 void StepElement_ElementAspect::SetSurface3dEdge (const Standard_Integer val)
301 {
302   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
303   if(SelMem.IsNull()) return;
304  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("SURFACE_3D_EDGE");
305  SelMem->SetName(name->ToCString());
306  SelMem->SetInteger(val);
307 }
308
309 //=======================================================================
310 //function : Surface3dEdge
311 //purpose  : 
312 //=======================================================================
313
314 Standard_Integer StepElement_ElementAspect::Surface3dEdge () const
315 {
316   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
317   if(SelMem.IsNull()) return 0;
318  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
319  name->AssignCat(SelMem->Name());
320  Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("SURFACE_3D_EDGE");
321  if(name->IsDifferent(nameitem)) return 0;
322  Standard_Integer val = SelMem->Integer();
323  return val;
324 }
325
326 //=======================================================================
327 //function : SetSurface2dEdge
328 //purpose  : 
329 //=======================================================================
330
331 void StepElement_ElementAspect::SetSurface2dEdge (const Standard_Integer val)
332 {
333   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
334   if(SelMem.IsNull()) return;
335  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("SURFACE_2D_EDGE");
336  SelMem->SetName(name->ToCString());
337  SelMem->SetInteger(val);
338 }
339
340 //=======================================================================
341 //function : Surface2dEdge
342 //purpose  : 
343 //=======================================================================
344
345 Standard_Integer StepElement_ElementAspect::Surface2dEdge () const
346 {
347   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
348   if(SelMem.IsNull()) return 0;
349  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
350  name->AssignCat(SelMem->Name());
351  Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("SURFACE_2D_EDGE");
352  if(name->IsDifferent(nameitem)) return 0;
353  Standard_Integer val = SelMem->Integer();
354  return val;
355 }
356
357 //=======================================================================
358 //function : SetCurveEdge
359 //purpose  : 
360 //=======================================================================
361
362 void StepElement_ElementAspect::SetCurveEdge (const StepElement_CurveEdge val)
363 {
364   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
365   if(SelMem.IsNull()) return;
366  Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("CURVE_EDGE");
367  SelMem->SetName(name->ToCString());
368  SelMem->SetEnum((Standard_Integer)val);
369 }
370
371 //=======================================================================
372 //function : CurveEdge
373 //purpose  : 
374 //=======================================================================
375
376 StepElement_CurveEdge StepElement_ElementAspect::CurveEdge () const
377 {
378   Handle(StepElement_ElementAspectMember) SelMem = Handle(StepElement_ElementAspectMember)::DownCast(Value());
379   if(SelMem.IsNull()) return StepElement_ElementEdge;
380   Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString;
381   name->AssignCat(SelMem->Name());
382   Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("CURVE_EDGE");
383   if(name->IsDifferent(nameitem)) return StepElement_ElementEdge;
384   Standard_Integer numit = SelMem->Enum();
385   StepElement_CurveEdge val;
386   switch(numit) {
387   case 1 : val = StepElement_ElementEdge; break;
388     default : return StepElement_ElementEdge;break;
389   }
390  return val;
391 }