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_CurveElementFreedom.hxx> |
7fd59977 |
21 | #include <StepElement_CurveElementFreedomMember.hxx> |
22 | #include <TCollection_HAsciiString.hxx> |
23 | |
24 | static Standard_CString anEnum = "ENUMERATED_CURVE_ELEMENT_FREEDOM"; |
25 | static Standard_CString anApp = "APPLICATION_DEFINED_DEGREE_OF_FREEDOM"; |
26 | //======================================================================= |
27 | //function : StepElement_CurveElementFreedom |
28 | //purpose : |
29 | //======================================================================= |
30 | |
31 | StepElement_CurveElementFreedom::StepElement_CurveElementFreedom () |
32 | { |
33 | } |
34 | |
35 | //======================================================================= |
36 | //function : CaseNum |
37 | //purpose : |
38 | //======================================================================= |
39 | |
35e08fe8 |
40 | Standard_Integer StepElement_CurveElementFreedom::CaseNum (const Handle(Standard_Transient)& /*ent*/) const |
7fd59977 |
41 | { |
42 | return 0; |
43 | } |
44 | |
45 | //======================================================================= |
46 | //function : CaseMem |
47 | //purpose : |
48 | //======================================================================= |
49 | |
50 | Standard_Integer StepElement_CurveElementFreedom::CaseMem (const Handle(StepData_SelectMember)& ent) const |
51 | { |
52 | if(ent.IsNull()) return 0; |
53 | if(ent->Matches(anEnum)) return 1; |
54 | else if(ent->Matches(anApp)) return 2; |
55 | else return 0; |
56 | } |
57 | |
58 | //======================================================================= |
59 | //function : NewMember |
60 | //purpose : |
61 | //======================================================================= |
62 | |
63 | Handle(StepData_SelectMember) StepElement_CurveElementFreedom::NewMember() const |
64 | { |
65 | return new StepElement_CurveElementFreedomMember; |
66 | } |
67 | |
68 | //======================================================================= |
69 | //function : SetEnumeratedCurveElementFreedom |
70 | //purpose : |
71 | //======================================================================= |
72 | |
73 | void StepElement_CurveElementFreedom::SetEnumeratedCurveElementFreedom (const StepElement_EnumeratedCurveElementFreedom val) |
74 | { |
75 | Handle(StepElement_CurveElementFreedomMember) SelMem = Handle(StepElement_CurveElementFreedomMember)::DownCast(Value()); |
76 | if(SelMem.IsNull()) return; |
77 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("ENUMERATED_CURVE_ELEMENT_FREEDOM"); |
78 | SelMem->SetName(name->ToCString()); |
79 | SelMem->SetEnum((Standard_Integer)val); |
80 | } |
81 | |
82 | //======================================================================= |
83 | //function : EnumeratedCurveElementFreedom |
84 | //purpose : |
85 | //======================================================================= |
86 | |
87 | StepElement_EnumeratedCurveElementFreedom StepElement_CurveElementFreedom::EnumeratedCurveElementFreedom () const |
88 | { |
89 | Handle(StepElement_CurveElementFreedomMember) SelMem = Handle(StepElement_CurveElementFreedomMember)::DownCast(Value()); |
90 | if(SelMem.IsNull()) return StepElement_None; |
91 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString; |
92 | name->AssignCat(SelMem->Name()); |
93 | Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("ENUMERATED_CURVE_ELEMENT_FREEDOM"); |
94 | if(name->IsDifferent(nameitem)) return StepElement_None; |
95 | Standard_Integer numit = SelMem->Enum(); |
96 | StepElement_EnumeratedCurveElementFreedom val; |
97 | switch(numit) { |
98 | case 1 : val = StepElement_XTranslation; break; |
99 | case 2 : val = StepElement_YTranslation; break; |
100 | case 3 : val = StepElement_ZTranslation; break; |
101 | case 4 : val = StepElement_XRotation; break; |
102 | case 5 : val = StepElement_YRotation; break; |
103 | case 6 : val = StepElement_ZRotation; break; |
104 | case 7 : val = StepElement_Warp; break; |
105 | case 8 : val = StepElement_None; break; |
106 | default : return StepElement_None;break; |
107 | } |
108 | return val; |
109 | } |
110 | |
111 | //======================================================================= |
112 | //function : SetApplicationDefinedDegreeOfFreedom |
113 | //purpose : |
114 | //======================================================================= |
115 | |
116 | void StepElement_CurveElementFreedom::SetApplicationDefinedDegreeOfFreedom (const Handle(TCollection_HAsciiString) &val) |
117 | { |
118 | Handle(StepElement_CurveElementFreedomMember) SelMem = Handle(StepElement_CurveElementFreedomMember)::DownCast(Value()); |
119 | if(SelMem.IsNull()) return; |
120 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("APPLICATION_DEFINED_DEGREE_OF_FREEDOM"); |
121 | SelMem->SetName(name->ToCString()); |
122 | SelMem->SetString(val->ToCString()); |
123 | } |
124 | |
125 | //======================================================================= |
126 | //function : ApplicationDefinedDegreeOfFreedom |
127 | //purpose : |
128 | //======================================================================= |
129 | |
130 | Handle(TCollection_HAsciiString) StepElement_CurveElementFreedom::ApplicationDefinedDegreeOfFreedom () const |
131 | { |
132 | Handle(StepElement_CurveElementFreedomMember) SelMem = Handle(StepElement_CurveElementFreedomMember)::DownCast(Value()); |
133 | if(SelMem.IsNull()) return 0; |
134 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString; |
135 | name->AssignCat(SelMem->Name()); |
136 | Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("APPLICATION_DEFINED_DEGREE_OF_FREEDOM"); |
137 | if(name->IsDifferent(nameitem)) return 0; |
138 | Handle(TCollection_HAsciiString) val = new TCollection_HAsciiString; |
139 | val->AssignCat(SelMem->String()); |
140 | return val; |
141 | } |