Commit | Line | Data |
---|---|---|
b311480e | 1 | // Created on: 2002-12-12 |
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 <RWStepFEA_RWFeaAxis2Placement3d.ixx> | |
23 | ||
24 | //======================================================================= | |
25 | //function : RWStepFEA_RWFeaAxis2Placement3d | |
26 | //purpose : | |
27 | //======================================================================= | |
28 | ||
29 | RWStepFEA_RWFeaAxis2Placement3d::RWStepFEA_RWFeaAxis2Placement3d () | |
30 | { | |
31 | } | |
32 | ||
33 | //======================================================================= | |
34 | //function : ReadStep | |
35 | //purpose : | |
36 | //======================================================================= | |
37 | ||
38 | void RWStepFEA_RWFeaAxis2Placement3d::ReadStep (const Handle(StepData_StepReaderData)& data, | |
39 | const Standard_Integer num, | |
40 | Handle(Interface_Check)& ach, | |
41 | const Handle(StepFEA_FeaAxis2Placement3d) &ent) const | |
42 | { | |
43 | // Check number of parameters | |
44 | if ( ! data->CheckNbParams(num,6,ach,"fea_axis2_placement3d") ) return; | |
45 | ||
46 | // Inherited fields of RepresentationItem | |
47 | ||
48 | Handle(TCollection_HAsciiString) aRepresentationItem_Name; | |
49 | data->ReadString (num, 1, "representation_item.name", ach, aRepresentationItem_Name); | |
50 | ||
51 | // Inherited fields of Placement | |
52 | ||
53 | Handle(StepGeom_CartesianPoint) aPlacement_Location; | |
54 | data->ReadEntity (num, 2, "placement.location", ach, STANDARD_TYPE(StepGeom_CartesianPoint), aPlacement_Location); | |
55 | ||
56 | // Inherited fields of Axis2Placement3d | |
57 | ||
58 | Handle(StepGeom_Direction) aAxis2Placement3d_Axis; | |
59 | Standard_Boolean hasAxis2Placement3d_Axis = Standard_True; | |
60 | if ( data->IsParamDefined (num,3) ) { | |
61 | data->ReadEntity (num, 3, "axis2_placement3d.axis", ach, STANDARD_TYPE(StepGeom_Direction), aAxis2Placement3d_Axis); | |
62 | } | |
63 | else { | |
64 | hasAxis2Placement3d_Axis = Standard_False; | |
65 | } | |
66 | ||
67 | Handle(StepGeom_Direction) aAxis2Placement3d_RefDirection; | |
68 | Standard_Boolean hasAxis2Placement3d_RefDirection = Standard_True; | |
69 | if ( data->IsParamDefined (num,4) ) { | |
70 | data->ReadEntity (num, 4, "axis2_placement3d.ref_direction", ach, STANDARD_TYPE(StepGeom_Direction), aAxis2Placement3d_RefDirection); | |
71 | } | |
72 | else { | |
73 | hasAxis2Placement3d_RefDirection = Standard_False; | |
74 | } | |
75 | ||
76 | // Own fields of FeaAxis2Placement3d | |
77 | ||
1d47d8d0 | 78 | StepFEA_CoordinateSystemType aSystemType = StepFEA_Cartesian; |
7fd59977 | 79 | if (data->ParamType (num, 5) == Interface_ParamEnum) { |
80 | Standard_CString text = data->ParamCValue(num, 5); | |
5dc6fb93 P |
81 | if (strcmp(text, ".CARTESIAN.") == 0) aSystemType = StepFEA_Cartesian; |
82 | else if (strcmp(text, ".CYLINDRICAL.") == 0) aSystemType = StepFEA_Cylindrical; | |
83 | else if (strcmp(text, ".SPHERICAL.") == 0) aSystemType = StepFEA_Spherical; | |
7fd59977 | 84 | else ach->AddFail("Parameter #5 (system_type) has not allowed value"); |
85 | } | |
86 | else ach->AddFail("Parameter #5 (system_type) is not enumeration"); | |
87 | ||
88 | Handle(TCollection_HAsciiString) aDescription; | |
89 | data->ReadString (num, 6, "description", ach, aDescription); | |
90 | ||
91 | // Initialize entity | |
92 | ent->Init(aRepresentationItem_Name, | |
93 | aPlacement_Location, | |
94 | hasAxis2Placement3d_Axis, | |
95 | aAxis2Placement3d_Axis, | |
96 | hasAxis2Placement3d_RefDirection, | |
97 | aAxis2Placement3d_RefDirection, | |
98 | aSystemType, | |
99 | aDescription); | |
100 | } | |
101 | ||
102 | //======================================================================= | |
103 | //function : WriteStep | |
104 | //purpose : | |
105 | //======================================================================= | |
106 | ||
107 | void RWStepFEA_RWFeaAxis2Placement3d::WriteStep (StepData_StepWriter& SW, | |
108 | const Handle(StepFEA_FeaAxis2Placement3d) &ent) const | |
109 | { | |
110 | ||
111 | // Inherited fields of RepresentationItem | |
112 | ||
113 | SW.Send (ent->StepRepr_RepresentationItem::Name()); | |
114 | ||
115 | // Inherited fields of Placement | |
116 | ||
117 | SW.Send (ent->StepGeom_Placement::Location()); | |
118 | ||
119 | // Inherited fields of Axis2Placement3d | |
120 | ||
121 | if ( ent->StepGeom_Axis2Placement3d::HasAxis() ) { | |
122 | SW.Send (ent->StepGeom_Axis2Placement3d::Axis()); | |
123 | } | |
124 | else SW.SendUndef(); | |
125 | ||
126 | if ( ent->StepGeom_Axis2Placement3d::HasRefDirection() ) { | |
127 | SW.Send (ent->StepGeom_Axis2Placement3d::RefDirection()); | |
128 | } | |
129 | else SW.SendUndef(); | |
130 | ||
131 | // Own fields of FeaAxis2Placement3d | |
132 | ||
133 | switch (ent->SystemType()) { | |
134 | case StepFEA_Cartesian: SW.SendEnum (".CARTESIAN."); break; | |
135 | case StepFEA_Cylindrical: SW.SendEnum (".CYLINDRICAL."); break; | |
136 | case StepFEA_Spherical: SW.SendEnum (".SPHERICAL."); break; | |
137 | } | |
138 | ||
139 | SW.Send (ent->Description()); | |
140 | } | |
141 | ||
142 | //======================================================================= | |
143 | //function : Share | |
144 | //purpose : | |
145 | //======================================================================= | |
146 | ||
147 | void RWStepFEA_RWFeaAxis2Placement3d::Share (const Handle(StepFEA_FeaAxis2Placement3d) &ent, | |
148 | Interface_EntityIterator& iter) const | |
149 | { | |
150 | ||
151 | // Inherited fields of RepresentationItem | |
152 | ||
153 | // Inherited fields of Placement | |
154 | ||
155 | iter.AddItem (ent->StepGeom_Placement::Location()); | |
156 | ||
157 | // Inherited fields of Axis2Placement3d | |
158 | ||
159 | if ( ent->StepGeom_Axis2Placement3d::HasAxis() ) { | |
160 | iter.AddItem (ent->StepGeom_Axis2Placement3d::Axis()); | |
161 | } | |
162 | ||
163 | if ( ent->StepGeom_Axis2Placement3d::HasRefDirection() ) { | |
164 | iter.AddItem (ent->StepGeom_Axis2Placement3d::RefDirection()); | |
165 | } | |
166 | ||
167 | // Own fields of FeaAxis2Placement3d | |
168 | } |