b311480e |
1 | // Created on: 2002-12-14 |
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) V1.2 |
7fd59977 |
21 | |
22 | #include <StepFEA_DegreeOfFreedom.ixx> |
23 | #include <StepFEA_DegreeOfFreedomMember.hxx> |
24 | #include <TCollection_HAsciiString.hxx> |
25 | |
26 | //======================================================================= |
27 | //function : StepFEA_DegreeOfFreedom |
28 | //purpose : |
29 | //======================================================================= |
30 | |
31 | StepFEA_DegreeOfFreedom::StepFEA_DegreeOfFreedom () |
32 | { |
33 | } |
34 | |
35 | //======================================================================= |
36 | //function : CaseNum |
37 | //purpose : |
38 | //======================================================================= |
39 | |
35e08fe8 |
40 | Standard_Integer StepFEA_DegreeOfFreedom::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 StepFEA_DegreeOfFreedom::CaseMem (const Handle(StepData_SelectMember)& ent) const |
51 | { |
52 | if(ent.IsNull()) return 0; |
53 | if(ent->Matches("ENUMERATED_DEGREE_OF_FREEDOM")) return 1; |
54 | else if(ent->Matches("APPLICATION_DEFINED_DEGREE_OF_FREEDOM")) return 2; |
55 | else return 0; |
56 | } |
57 | |
58 | //======================================================================= |
59 | //function : NewMember |
60 | //purpose : |
61 | //======================================================================= |
62 | |
63 | Handle(StepData_SelectMember) StepFEA_DegreeOfFreedom::NewMember() const |
64 | { |
65 | return new StepFEA_DegreeOfFreedomMember; |
66 | } |
67 | |
68 | //======================================================================= |
69 | //function : SetEnumeratedCurveElementFreedom |
70 | //purpose : |
71 | //======================================================================= |
72 | |
73 | void StepFEA_DegreeOfFreedom::SetEnumeratedDegreeOfFreedom (const StepFEA_EnumeratedDegreeOfFreedom val) |
74 | { |
75 | Handle(StepFEA_DegreeOfFreedomMember) SelMem = Handle(StepFEA_DegreeOfFreedomMember)::DownCast(Value()); |
76 | if(SelMem.IsNull()) return; |
77 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString("ENUMERATED_DEGREE_OF_FREEDOM"); |
78 | SelMem->SetName(name->ToCString()); |
79 | SelMem->SetEnum((Standard_Integer)val); |
80 | } |
81 | |
82 | //======================================================================= |
83 | //function : EnumeratedCurveElementFreedom |
84 | //purpose : |
85 | //======================================================================= |
86 | |
87 | StepFEA_EnumeratedDegreeOfFreedom StepFEA_DegreeOfFreedom::EnumeratedDegreeOfFreedom () const |
88 | { |
89 | Handle(StepFEA_DegreeOfFreedomMember) SelMem = Handle(StepFEA_DegreeOfFreedomMember)::DownCast(Value()); |
90 | if(SelMem.IsNull()) return StepFEA_XTranslation; |
91 | Handle(TCollection_HAsciiString) name = new TCollection_HAsciiString; |
92 | name->AssignCat(SelMem->Name()); |
93 | Handle(TCollection_HAsciiString) nameitem = new TCollection_HAsciiString("ENUMERATED_DEGREE_OF_FREEDOM"); |
94 | if(name->IsDifferent(nameitem)) return StepFEA_XTranslation; |
95 | Standard_Integer numit = SelMem->Enum(); |
96 | StepFEA_EnumeratedDegreeOfFreedom val; |
97 | switch(numit) { |
98 | case 1 : val = StepFEA_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 StepFEA_XTranslation;break; |
107 | } |
108 | return val; |
109 | } |
110 | |
111 | //======================================================================= |
112 | //function : SetApplicationDefinedDegreeOfFreedom |
113 | //purpose : |
114 | //======================================================================= |
115 | |
116 | void StepFEA_DegreeOfFreedom::SetApplicationDefinedDegreeOfFreedom (const Handle(TCollection_HAsciiString) &val) |
117 | { |
118 | Handle(StepFEA_DegreeOfFreedomMember) SelMem = Handle(StepFEA_DegreeOfFreedomMember)::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) StepFEA_DegreeOfFreedom::ApplicationDefinedDegreeOfFreedom () const |
131 | { |
132 | Handle(StepFEA_DegreeOfFreedomMember) SelMem = Handle(StepFEA_DegreeOfFreedomMember)::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 | } |