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_CurveElementPurpose.hxx> |
7fd59977 |
21 | #include <StepElement_CurveElementPurposeMember.hxx> |
22 | #include <TCollection_HAsciiString.hxx> |
23 | |
24 | //======================================================================= |
25 | //function : StepElement_CurveElementPurpose |
26 | //purpose : |
27 | //======================================================================= |
7fd59977 |
28 | StepElement_CurveElementPurpose::StepElement_CurveElementPurpose () |
29 | { |
30 | } |
31 | |
32 | //======================================================================= |
33 | //function : CaseNum |
34 | //purpose : |
35 | //======================================================================= |
36 | |
35e08fe8 |
37 | Standard_Integer StepElement_CurveElementPurpose::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_CurveElementPurpose::CaseMem (const Handle(StepData_SelectMember)& ent) const |
48 | { |
49 | if(ent.IsNull()) return 0; |
50 | if(ent->Matches("EnumeratedCurveElementPurpose")) 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_CurveElementPurpose::NewMember() const |
61 | { |
62 | return new StepElement_CurveElementPurposeMember; |
63 | } |
64 | |
65 | //======================================================================= |
66 | //function : SetEnumeratedCurveElementPurpose |
67 | //purpose : |
68 | //======================================================================= |
69 | |
70 | void StepElement_CurveElementPurpose::SetEnumeratedCurveElementPurpose (const StepElement_EnumeratedCurveElementPurpose val) |
71 | { |
72 | Handle(StepElement_CurveElementPurposeMember) SelMem = Handle(StepElement_CurveElementPurposeMember)::DownCast(Value()); |
73 | if(SelMem.IsNull()) return; |
74 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("ENUMERATED_CURVE_ELEMENT_PURPOSE"); |
75 | SelMem->SetName(name->ToCString()); |
76 | SelMem->SetEnum((Standard_Integer)val); |
77 | } |
78 | |
79 | //======================================================================= |
80 | //function : EnumeratedCurveElementPurpose |
81 | //purpose : |
82 | //======================================================================= |
83 | |
84 | StepElement_EnumeratedCurveElementPurpose StepElement_CurveElementPurpose::EnumeratedCurveElementPurpose () const |
85 | { |
86 | Handle(StepElement_CurveElementPurposeMember) SelMem = Handle(StepElement_CurveElementPurposeMember)::DownCast(Value()); |
87 | if(SelMem.IsNull()) return StepElement_Axial; |
88 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString; |
89 | name->AssignCat(SelMem->Name()); |
90 | Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("ENUMERATED_CURVEELEMENT_PURPOSE"); |
91 | if(name->IsDifferent(nameitem)) return StepElement_Axial; |
92 | Standard_Integer numit = SelMem->Enum(); |
93 | StepElement_EnumeratedCurveElementPurpose val; |
94 | switch(numit) { |
95 | case 1 : val = StepElement_Axial; break; |
96 | case 2 : val = StepElement_YYBending; break; |
97 | case 3 : val = StepElement_ZZBending; break; |
98 | case 4 : val = StepElement_Torsion; break; |
99 | case 5 : val = StepElement_XYShear; break; |
100 | case 6 : val = StepElement_XZShear; break; |
101 | case 7 : val = StepElement_Warping; break; |
102 | default : return StepElement_Axial;break; |
103 | } |
104 | return val; |
105 | } |
106 | |
107 | //======================================================================= |
108 | //function : SetApplicationDefinedElementPurpose |
109 | //purpose : |
110 | //======================================================================= |
111 | |
112 | void StepElement_CurveElementPurpose::SetApplicationDefinedElementPurpose (const Handle(TCollection_HAsciiString) &val) |
113 | { |
114 | Handle(StepElement_CurveElementPurposeMember) SelMem = Handle(StepElement_CurveElementPurposeMember)::DownCast(Value()); |
115 | if(SelMem.IsNull()) return; |
116 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("APPLICATION_DEFINED_ELEMENT_PURPOSE"); |
117 | SelMem->SetName(name->ToCString()); |
118 | SelMem->SetString(val->ToCString()); |
119 | } |
120 | |
121 | //======================================================================= |
122 | //function : ApplicationDefinedElementPurpose |
123 | //purpose : |
124 | //======================================================================= |
125 | |
126 | Handle(TCollection_HAsciiString) StepElement_CurveElementPurpose::ApplicationDefinedElementPurpose () const |
127 | { |
128 | Handle(StepElement_CurveElementPurposeMember) SelMem = Handle(StepElement_CurveElementPurposeMember)::DownCast(Value()); |
129 | if(SelMem.IsNull()) return 0; |
130 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString; |
131 | name->AssignCat(SelMem->Name()); |
132 | Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("APPLICATION_DEFINED_ELEMENT_PURPOSE"); |
133 | if(name->IsDifferent(nameitem)) return 0; |
134 | Handle(TCollection_HAsciiString) val = new TCollection_HAsciiString; |
135 | val->AssignCat(SelMem->String()); |
136 | return val; |
137 | } |