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