1 // File: RWStepFEA_RWCurve3dElementRepresentation.cxx
2 // Created: Thu Dec 12 17:51:03 2002
3 // Author: data exchange team
4 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
5 // Copyright: Open CASCADE 2002
7 #include <RWStepFEA_RWCurve3dElementRepresentation.ixx>
8 #include <StepRepr_HArray1OfRepresentationItem.hxx>
9 #include <StepRepr_RepresentationItem.hxx>
10 #include <StepFEA_HArray1OfNodeRepresentation.hxx>
11 #include <StepFEA_NodeRepresentation.hxx>
13 //=======================================================================
14 //function : RWStepFEA_RWCurve3dElementRepresentation
16 //=======================================================================
18 RWStepFEA_RWCurve3dElementRepresentation::RWStepFEA_RWCurve3dElementRepresentation ()
22 //=======================================================================
25 //=======================================================================
27 void RWStepFEA_RWCurve3dElementRepresentation::ReadStep (const Handle(StepData_StepReaderData)& data,
28 const Standard_Integer num,
29 Handle(Interface_Check)& ach,
30 const Handle(StepFEA_Curve3dElementRepresentation) &ent) const
32 // Check number of parameters
33 if ( ! data->CheckNbParams(num,8,ach,"curve3d_element_representation") ) return;
35 // Inherited fields of Representation
37 Handle(TCollection_HAsciiString) aRepresentation_Name;
38 data->ReadString (num, 1, "representation.name", ach, aRepresentation_Name);
40 Handle(StepRepr_HArray1OfRepresentationItem) aRepresentation_Items;
41 Standard_Integer sub2 = 0;
42 if ( data->ReadSubList (num, 2, "representation.items", ach, sub2) ) {
43 Standard_Integer nb0 = data->NbParams(sub2);
44 aRepresentation_Items = new StepRepr_HArray1OfRepresentationItem (1, nb0);
45 Standard_Integer num2 = sub2;
46 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
47 Handle(StepRepr_RepresentationItem) anIt0;
48 data->ReadEntity (num2, i0, "representation_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anIt0);
49 aRepresentation_Items->SetValue(i0, anIt0);
53 Handle(StepRepr_RepresentationContext) aRepresentation_ContextOfItems;
54 data->ReadEntity (num, 3, "representation.context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aRepresentation_ContextOfItems);
56 // Inherited fields of ElementRepresentation
58 Handle(StepFEA_HArray1OfNodeRepresentation) aElementRepresentation_NodeList;
59 Standard_Integer sub4 = 0;
60 if ( data->ReadSubList (num, 4, "element_representation.node_list", ach, sub4) ) {
61 Standard_Integer nb0 = data->NbParams(sub4);
62 aElementRepresentation_NodeList = new StepFEA_HArray1OfNodeRepresentation (1, nb0);
63 Standard_Integer num2 = sub4;
64 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
65 Handle(StepFEA_NodeRepresentation) anIt0;
66 data->ReadEntity (num2, i0, "node_representation", ach, STANDARD_TYPE(StepFEA_NodeRepresentation), anIt0);
67 aElementRepresentation_NodeList->SetValue(i0, anIt0);
71 // Own fields of Curve3dElementRepresentation
73 Handle(StepFEA_FeaModel3d) aModelRef;
74 data->ReadEntity (num, 5, "model_ref", ach, STANDARD_TYPE(StepFEA_FeaModel3d), aModelRef);
76 Handle(StepElement_Curve3dElementDescriptor) aElementDescriptor;
77 data->ReadEntity (num, 6, "element_descriptor", ach, STANDARD_TYPE(StepElement_Curve3dElementDescriptor), aElementDescriptor);
79 Handle(StepFEA_Curve3dElementProperty) aProperty;
80 data->ReadEntity (num, 7, "property", ach, STANDARD_TYPE(StepFEA_Curve3dElementProperty), aProperty);
82 Handle(StepElement_ElementMaterial) aMaterial;
83 data->ReadEntity (num, 8, "material", ach, STANDARD_TYPE(StepElement_ElementMaterial), aMaterial);
86 ent->Init(aRepresentation_Name,
87 aRepresentation_Items,
88 aRepresentation_ContextOfItems,
89 aElementRepresentation_NodeList,
96 //=======================================================================
97 //function : WriteStep
99 //=======================================================================
101 void RWStepFEA_RWCurve3dElementRepresentation::WriteStep (StepData_StepWriter& SW,
102 const Handle(StepFEA_Curve3dElementRepresentation) &ent) const
105 // Inherited fields of Representation
107 SW.Send (ent->StepRepr_Representation::Name());
110 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
111 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
116 SW.Send (ent->StepRepr_Representation::ContextOfItems());
118 // Inherited fields of ElementRepresentation
121 for (Standard_Integer i3=1; i3 <= ent->StepFEA_ElementRepresentation::NodeList()->Length(); i3++ ) {
122 Handle(StepFEA_NodeRepresentation) Var0 = ent->StepFEA_ElementRepresentation::NodeList()->Value(i3);
127 // Own fields of Curve3dElementRepresentation
129 SW.Send (ent->ModelRef());
131 SW.Send (ent->ElementDescriptor());
133 SW.Send (ent->Property());
135 SW.Send (ent->Material());
138 //=======================================================================
141 //=======================================================================
143 void RWStepFEA_RWCurve3dElementRepresentation::Share (const Handle(StepFEA_Curve3dElementRepresentation) &ent,
144 Interface_EntityIterator& iter) const
147 // Inherited fields of Representation
149 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
150 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
154 iter.AddItem (ent->StepRepr_Representation::ContextOfItems());
156 // Inherited fields of ElementRepresentation
158 for (Standard_Integer i3=1; i3 <= ent->StepFEA_ElementRepresentation::NodeList()->Length(); i3++ ) {
159 Handle(StepFEA_NodeRepresentation) Var0 = ent->StepFEA_ElementRepresentation::NodeList()->Value(i3);
163 // Own fields of Curve3dElementRepresentation
165 iter.AddItem (ent->ModelRef());
167 iter.AddItem (ent->ElementDescriptor());
169 iter.AddItem (ent->Property());
171 iter.AddItem (ent->Material());