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