b311480e |
1 | // Created on: 2002-12-10 |
2 | // Created by: data exchange team |
973c2be1 |
3 | // Copyright (c) 2002-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
7fd59977 |
16 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0 |
7fd59977 |
17 | |
42cf5bc1 |
18 | #include <Standard_Transient.hxx> |
19 | #include <StepData_SelectMember.hxx> |
20 | #include <StepElement_VolumeElementPurpose.hxx> |
7fd59977 |
21 | #include <StepElement_VolumeElementPurposeMember.hxx> |
22 | #include <TCollection_HAsciiString.hxx> |
23 | |
24 | //======================================================================= |
25 | //function : StepElement_VolumeElementPurpose |
26 | //purpose : |
27 | //======================================================================= |
7fd59977 |
28 | StepElement_VolumeElementPurpose::StepElement_VolumeElementPurpose () |
29 | { |
30 | } |
31 | |
32 | //======================================================================= |
33 | //function : CaseNum |
34 | //purpose : |
35 | //======================================================================= |
36 | |
35e08fe8 |
37 | Standard_Integer StepElement_VolumeElementPurpose::CaseNum (const Handle(Standard_Transient)& /*ent*/) const |
7fd59977 |
38 | { |
39 | return 0; |
40 | } |
41 | |
42 | //======================================================================= |
43 | //function : CaseMem |
44 | //purpose : |
45 | //======================================================================= |
46 | |
47 | Standard_Integer StepElement_VolumeElementPurpose::CaseMem (const Handle(StepData_SelectMember)& ent) const |
48 | { |
49 | if(ent.IsNull()) return 0; |
50 | if(ent->Matches("EnumeratedVolumeElementPurpose")) return 1; |
51 | else if(ent->Matches("ApplicationDefinedElementPurpose")) return 2; |
52 | else return 0; |
53 | } |
54 | |
55 | //======================================================================= |
56 | //function : NewMember |
57 | //purpose : |
58 | //======================================================================= |
59 | |
60 | Handle(StepData_SelectMember) StepElement_VolumeElementPurpose::NewMember() const |
61 | { |
62 | return new StepElement_VolumeElementPurposeMember; |
63 | } |
64 | |
65 | //======================================================================= |
66 | //function : SetEnumeratedVolumeElementPurpose |
67 | //purpose : |
68 | //======================================================================= |
69 | |
70 | void StepElement_VolumeElementPurpose::SetEnumeratedVolumeElementPurpose (const StepElement_EnumeratedVolumeElementPurpose val) |
71 | { |
72 | Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value()); |
73 | if(SelMem.IsNull()) return; |
74 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("EnumeratedVolumeElementPurpose"); |
75 | SelMem->SetName(name->ToCString()); |
76 | SelMem->SetEnum((Standard_Integer)val); |
77 | } |
78 | |
79 | //======================================================================= |
80 | //function : EnumeratedVolumeElementPurpose |
81 | //purpose : |
82 | //======================================================================= |
83 | |
84 | StepElement_EnumeratedVolumeElementPurpose StepElement_VolumeElementPurpose::EnumeratedVolumeElementPurpose () const |
85 | { |
86 | Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value()); |
87 | if(SelMem.IsNull()) return StepElement_StressDisplacement; |
88 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString; |
89 | name->AssignCat(SelMem->Name()); |
90 | Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("EnumeratedVolumeElementPurpose"); |
91 | if(name->IsDifferent(nameitem)) return StepElement_StressDisplacement; |
92 | Standard_Integer numit = SelMem->Enum(); |
93 | StepElement_EnumeratedVolumeElementPurpose val; |
94 | switch(numit) { |
95 | case 1 : val = StepElement_StressDisplacement; break; |
96 | default : return StepElement_StressDisplacement;break; |
97 | } |
98 | return val; |
99 | } |
100 | |
101 | //======================================================================= |
102 | //function : SetApplicationDefinedElementPurpose |
103 | //purpose : |
104 | //======================================================================= |
105 | |
106 | void StepElement_VolumeElementPurpose::SetApplicationDefinedElementPurpose (const Handle(TCollection_HAsciiString) &val) |
107 | { |
108 | Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value()); |
109 | if(SelMem.IsNull()) return; |
110 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("ApplicationDefinedElementPurpose"); |
111 | SelMem->SetName(name->ToCString()); |
112 | SelMem->SetString(val->ToCString()); |
113 | } |
114 | |
115 | //======================================================================= |
116 | //function : ApplicationDefinedElementPurpose |
117 | //purpose : |
118 | //======================================================================= |
119 | |
120 | Handle(TCollection_HAsciiString) StepElement_VolumeElementPurpose::ApplicationDefinedElementPurpose () const |
121 | { |
122 | Handle(StepElement_VolumeElementPurposeMember) SelMem = Handle(StepElement_VolumeElementPurposeMember)::DownCast(Value()); |
123 | if(SelMem.IsNull()) return 0; |
124 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString; |
125 | name->AssignCat(SelMem->Name()); |
126 | Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("ApplicationDefinedElementPurpose"); |
127 | if(name->IsDifferent(nameitem)) return 0; |
128 | Handle(TCollection_HAsciiString) val = new TCollection_HAsciiString; |
129 | val->AssignCat(SelMem->String()); |
130 | return val; |
131 | } |