b311480e |
1 | // Created on: 2002-12-10 |
2 | // Created by: data exchange team |
3 | // Copyright (c) 2002-2012 OPEN CASCADE SAS |
4 | // |
5 | // The content of this file is subject to the Open CASCADE Technology Public |
6 | // License Version 6.5 (the "License"). You may not use the content of this file |
7 | // except in compliance with the License. Please obtain a copy of the License |
8 | // at http://www.opencascade.org and read it completely before using this file. |
9 | // |
10 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | // |
13 | // The Original Code and all software distributed under the License is |
14 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | // Initial Developer hereby disclaims all such warranties, including without |
16 | // limitation, any warranties of merchantability, fitness for a particular |
17 | // purpose or non-infringement. Please see the License for the specific terms |
18 | // and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V2.0 |
7fd59977 |
21 | |
22 | #include <StepElement_CurveElementFreedom.ixx> |
23 | #include <StepElement_CurveElementFreedomMember.hxx> |
24 | #include <TCollection_HAsciiString.hxx> |
25 | |
26 | static Standard_CString anEnum = "ENUMERATED_CURVE_ELEMENT_FREEDOM"; |
27 | static Standard_CString anApp = "APPLICATION_DEFINED_DEGREE_OF_FREEDOM"; |
28 | //======================================================================= |
29 | //function : StepElement_CurveElementFreedom |
30 | //purpose : |
31 | //======================================================================= |
32 | |
33 | StepElement_CurveElementFreedom::StepElement_CurveElementFreedom () |
34 | { |
35 | } |
36 | |
37 | //======================================================================= |
38 | //function : CaseNum |
39 | //purpose : |
40 | //======================================================================= |
41 | |
42 | Standard_Integer StepElement_CurveElementFreedom::CaseNum (const Handle(Standard_Transient)& ent) const |
43 | { |
44 | return 0; |
45 | } |
46 | |
47 | //======================================================================= |
48 | //function : CaseMem |
49 | //purpose : |
50 | //======================================================================= |
51 | |
52 | Standard_Integer StepElement_CurveElementFreedom::CaseMem (const Handle(StepData_SelectMember)& ent) const |
53 | { |
54 | if(ent.IsNull()) return 0; |
55 | if(ent->Matches(anEnum)) return 1; |
56 | else if(ent->Matches(anApp)) return 2; |
57 | else return 0; |
58 | } |
59 | |
60 | //======================================================================= |
61 | //function : NewMember |
62 | //purpose : |
63 | //======================================================================= |
64 | |
65 | Handle(StepData_SelectMember) StepElement_CurveElementFreedom::NewMember() const |
66 | { |
67 | return new StepElement_CurveElementFreedomMember; |
68 | } |
69 | |
70 | //======================================================================= |
71 | //function : SetEnumeratedCurveElementFreedom |
72 | //purpose : |
73 | //======================================================================= |
74 | |
75 | void StepElement_CurveElementFreedom::SetEnumeratedCurveElementFreedom (const StepElement_EnumeratedCurveElementFreedom val) |
76 | { |
77 | Handle(StepElement_CurveElementFreedomMember) SelMem = Handle(StepElement_CurveElementFreedomMember)::DownCast(Value()); |
78 | if(SelMem.IsNull()) return; |
79 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("ENUMERATED_CURVE_ELEMENT_FREEDOM"); |
80 | SelMem->SetName(name->ToCString()); |
81 | SelMem->SetEnum((Standard_Integer)val); |
82 | } |
83 | |
84 | //======================================================================= |
85 | //function : EnumeratedCurveElementFreedom |
86 | //purpose : |
87 | //======================================================================= |
88 | |
89 | StepElement_EnumeratedCurveElementFreedom StepElement_CurveElementFreedom::EnumeratedCurveElementFreedom () const |
90 | { |
91 | Handle(StepElement_CurveElementFreedomMember) SelMem = Handle(StepElement_CurveElementFreedomMember)::DownCast(Value()); |
92 | if(SelMem.IsNull()) return StepElement_None; |
93 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString; |
94 | name->AssignCat(SelMem->Name()); |
95 | Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("ENUMERATED_CURVE_ELEMENT_FREEDOM"); |
96 | if(name->IsDifferent(nameitem)) return StepElement_None; |
97 | Standard_Integer numit = SelMem->Enum(); |
98 | StepElement_EnumeratedCurveElementFreedom val; |
99 | switch(numit) { |
100 | case 1 : val = StepElement_XTranslation; break; |
101 | case 2 : val = StepElement_YTranslation; break; |
102 | case 3 : val = StepElement_ZTranslation; break; |
103 | case 4 : val = StepElement_XRotation; break; |
104 | case 5 : val = StepElement_YRotation; break; |
105 | case 6 : val = StepElement_ZRotation; break; |
106 | case 7 : val = StepElement_Warp; break; |
107 | case 8 : val = StepElement_None; break; |
108 | default : return StepElement_None;break; |
109 | } |
110 | return val; |
111 | } |
112 | |
113 | //======================================================================= |
114 | //function : SetApplicationDefinedDegreeOfFreedom |
115 | //purpose : |
116 | //======================================================================= |
117 | |
118 | void StepElement_CurveElementFreedom::SetApplicationDefinedDegreeOfFreedom (const Handle(TCollection_HAsciiString) &val) |
119 | { |
120 | Handle(StepElement_CurveElementFreedomMember) SelMem = Handle(StepElement_CurveElementFreedomMember)::DownCast(Value()); |
121 | if(SelMem.IsNull()) return; |
122 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("APPLICATION_DEFINED_DEGREE_OF_FREEDOM"); |
123 | SelMem->SetName(name->ToCString()); |
124 | SelMem->SetString(val->ToCString()); |
125 | } |
126 | |
127 | //======================================================================= |
128 | //function : ApplicationDefinedDegreeOfFreedom |
129 | //purpose : |
130 | //======================================================================= |
131 | |
132 | Handle(TCollection_HAsciiString) StepElement_CurveElementFreedom::ApplicationDefinedDegreeOfFreedom () const |
133 | { |
134 | Handle(StepElement_CurveElementFreedomMember) SelMem = Handle(StepElement_CurveElementFreedomMember)::DownCast(Value()); |
135 | if(SelMem.IsNull()) return 0; |
136 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString; |
137 | name->AssignCat(SelMem->Name()); |
138 | Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("APPLICATION_DEFINED_DEGREE_OF_FREEDOM"); |
139 | if(name->IsDifferent(nameitem)) return 0; |
140 | Handle(TCollection_HAsciiString) val = new TCollection_HAsciiString; |
141 | val->AssignCat(SelMem->String()); |
142 | return val; |
143 | } |