b311480e |
1 | // Created on: 2002-12-12 |
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) V1.2 |
7fd59977 |
17 | |
18 | #include <RWStepFEA_RWVolume3dElementRepresentation.ixx> |
19 | #include <StepRepr_HArray1OfRepresentationItem.hxx> |
20 | #include <StepRepr_RepresentationItem.hxx> |
21 | #include <StepFEA_HArray1OfNodeRepresentation.hxx> |
22 | #include <StepFEA_NodeRepresentation.hxx> |
ec357c5c |
23 | #include <StepRepr_RepresentationContext.hxx> |
24 | #include <StepFEA_FeaModel3d.hxx> |
25 | #include <StepElement_Volume3dElementDescriptor.hxx> |
26 | #include <StepElement_ElementMaterial.hxx> |
7fd59977 |
27 | |
28 | //======================================================================= |
29 | //function : RWStepFEA_RWVolume3dElementRepresentation |
30 | //purpose : |
31 | //======================================================================= |
32 | |
33 | RWStepFEA_RWVolume3dElementRepresentation::RWStepFEA_RWVolume3dElementRepresentation () |
34 | { |
35 | } |
36 | |
37 | //======================================================================= |
38 | //function : ReadStep |
39 | //purpose : |
40 | //======================================================================= |
41 | |
42 | void RWStepFEA_RWVolume3dElementRepresentation::ReadStep (const Handle(StepData_StepReaderData)& data, |
43 | const Standard_Integer num, |
44 | Handle(Interface_Check)& ach, |
45 | const Handle(StepFEA_Volume3dElementRepresentation) &ent) const |
46 | { |
47 | // Check number of parameters |
48 | if ( ! data->CheckNbParams(num,7,ach,"volume3d_element_representation") ) return; |
49 | |
50 | // Inherited fields of Representation |
51 | |
52 | Handle(TCollection_HAsciiString) aRepresentation_Name; |
53 | data->ReadString (num, 1, "representation.name", ach, aRepresentation_Name); |
54 | |
55 | Handle(StepRepr_HArray1OfRepresentationItem) aRepresentation_Items; |
56 | Standard_Integer sub2 = 0; |
57 | if ( data->ReadSubList (num, 2, "representation.items", ach, sub2) ) { |
58 | Standard_Integer nb0 = data->NbParams(sub2); |
59 | aRepresentation_Items = new StepRepr_HArray1OfRepresentationItem (1, nb0); |
60 | Standard_Integer num2 = sub2; |
61 | for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { |
62 | Handle(StepRepr_RepresentationItem) anIt0; |
63 | data->ReadEntity (num2, i0, "representation_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anIt0); |
64 | aRepresentation_Items->SetValue(i0, anIt0); |
65 | } |
66 | } |
67 | |
68 | Handle(StepRepr_RepresentationContext) aRepresentation_ContextOfItems; |
69 | data->ReadEntity (num, 3, "representation.context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aRepresentation_ContextOfItems); |
70 | |
71 | // Inherited fields of ElementRepresentation |
72 | |
73 | Handle(StepFEA_HArray1OfNodeRepresentation) aElementRepresentation_NodeList; |
74 | Standard_Integer sub4 = 0; |
75 | if ( data->ReadSubList (num, 4, "element_representation.node_list", ach, sub4) ) { |
76 | Standard_Integer nb0 = data->NbParams(sub4); |
77 | aElementRepresentation_NodeList = new StepFEA_HArray1OfNodeRepresentation (1, nb0); |
78 | Standard_Integer num2 = sub4; |
79 | for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { |
80 | Handle(StepFEA_NodeRepresentation) anIt0; |
81 | data->ReadEntity (num2, i0, "node_representation", ach, STANDARD_TYPE(StepFEA_NodeRepresentation), anIt0); |
82 | aElementRepresentation_NodeList->SetValue(i0, anIt0); |
83 | } |
84 | } |
85 | |
86 | // Own fields of Volume3dElementRepresentation |
87 | |
88 | Handle(StepFEA_FeaModel3d) aModelRef; |
89 | data->ReadEntity (num, 5, "model_ref", ach, STANDARD_TYPE(StepFEA_FeaModel3d), aModelRef); |
90 | |
91 | Handle(StepElement_Volume3dElementDescriptor) aElementDescriptor; |
92 | data->ReadEntity (num, 6, "element_descriptor", ach, STANDARD_TYPE(StepElement_Volume3dElementDescriptor), aElementDescriptor); |
93 | |
94 | Handle(StepElement_ElementMaterial) aMaterial; |
95 | data->ReadEntity (num, 7, "material", ach, STANDARD_TYPE(StepElement_ElementMaterial), aMaterial); |
96 | |
97 | // Initialize entity |
98 | ent->Init(aRepresentation_Name, |
99 | aRepresentation_Items, |
100 | aRepresentation_ContextOfItems, |
101 | aElementRepresentation_NodeList, |
102 | aModelRef, |
103 | aElementDescriptor, |
104 | aMaterial); |
105 | } |
106 | |
107 | //======================================================================= |
108 | //function : WriteStep |
109 | //purpose : |
110 | //======================================================================= |
111 | |
112 | void RWStepFEA_RWVolume3dElementRepresentation::WriteStep (StepData_StepWriter& SW, |
113 | const Handle(StepFEA_Volume3dElementRepresentation) &ent) const |
114 | { |
115 | |
116 | // Inherited fields of Representation |
117 | |
118 | SW.Send (ent->StepRepr_Representation::Name()); |
119 | |
120 | SW.OpenSub(); |
121 | for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) { |
122 | Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1); |
123 | SW.Send (Var0); |
124 | } |
125 | SW.CloseSub(); |
126 | |
127 | SW.Send (ent->StepRepr_Representation::ContextOfItems()); |
128 | |
129 | // Inherited fields of ElementRepresentation |
130 | |
131 | SW.OpenSub(); |
132 | for (Standard_Integer i3=1; i3 <= ent->StepFEA_ElementRepresentation::NodeList()->Length(); i3++ ) { |
133 | Handle(StepFEA_NodeRepresentation) Var0 = ent->StepFEA_ElementRepresentation::NodeList()->Value(i3); |
134 | SW.Send (Var0); |
135 | } |
136 | SW.CloseSub(); |
137 | |
138 | // Own fields of Volume3dElementRepresentation |
139 | |
140 | SW.Send (ent->ModelRef()); |
141 | |
142 | SW.Send (ent->ElementDescriptor()); |
143 | |
144 | SW.Send (ent->Material()); |
145 | } |
146 | |
147 | //======================================================================= |
148 | //function : Share |
149 | //purpose : |
150 | //======================================================================= |
151 | |
152 | void RWStepFEA_RWVolume3dElementRepresentation::Share (const Handle(StepFEA_Volume3dElementRepresentation) &ent, |
153 | Interface_EntityIterator& iter) const |
154 | { |
155 | |
156 | // Inherited fields of Representation |
157 | |
158 | for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) { |
159 | Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1); |
160 | iter.AddItem (Var0); |
161 | } |
162 | |
163 | iter.AddItem (ent->StepRepr_Representation::ContextOfItems()); |
164 | |
165 | // Inherited fields of ElementRepresentation |
166 | |
167 | for (Standard_Integer i3=1; i3 <= ent->StepFEA_ElementRepresentation::NodeList()->Length(); i3++ ) { |
168 | Handle(StepFEA_NodeRepresentation) Var0 = ent->StepFEA_ElementRepresentation::NodeList()->Value(i3); |
169 | iter.AddItem (Var0); |
170 | } |
171 | |
172 | // Own fields of Volume3dElementRepresentation |
173 | |
174 | iter.AddItem (ent->ModelRef()); |
175 | |
176 | iter.AddItem (ent->ElementDescriptor()); |
177 | |
178 | iter.AddItem (ent->Material()); |
179 | } |