1 // File: RWStepFEA_RWFeaModel.cxx
2 // Created: Thu Dec 12 17:51:05 2002
3 // Author: data exchange team
4 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
5 // Copyright: Open CASCADE 2002
7 #include <RWStepFEA_RWFeaModel.ixx>
8 #include <StepRepr_HArray1OfRepresentationItem.hxx>
9 #include <StepRepr_RepresentationItem.hxx>
10 #include <TColStd_HArray1OfAsciiString.hxx>
11 #include <TCollection_HAsciiString.hxx>
13 //=======================================================================
14 //function : RWStepFEA_RWFeaModel
16 //=======================================================================
18 RWStepFEA_RWFeaModel::RWStepFEA_RWFeaModel ()
22 //=======================================================================
25 //=======================================================================
27 void RWStepFEA_RWFeaModel::ReadStep (const Handle(StepData_StepReaderData)& data,
28 const Standard_Integer num,
29 Handle(Interface_Check)& ach,
30 const Handle(StepFEA_FeaModel) &ent) const
32 // Check number of parameters
33 if ( ! data->CheckNbParams(num,7,ach,"fea_model") ) 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 // Own fields of FeaModel
58 Handle(TCollection_HAsciiString) aCreatingSoftware;
59 data->ReadString (num, 4, "creating_software", ach, aCreatingSoftware);
61 Handle(TColStd_HArray1OfAsciiString) aIntendedAnalysisCode;
62 Standard_Integer sub5 = 0;
63 if ( data->ReadSubList (num, 5, "intended_analysis_code", ach, sub5) ) {
64 Standard_Integer nb0 = data->NbParams(sub5);
65 aIntendedAnalysisCode = new TColStd_HArray1OfAsciiString (1, nb0);
66 Standard_Integer num2 = sub5;
67 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
68 Handle(TCollection_HAsciiString) anIt0;
69 data->ReadString (num2, i0, "h_ascii_string", ach, anIt0);
70 aIntendedAnalysisCode->SetValue(i0, anIt0->String());
74 Handle(TCollection_HAsciiString) aDescription;
75 data->ReadString (num, 6, "description", ach, aDescription);
77 Handle(TCollection_HAsciiString) aAnalysisType;
78 data->ReadString (num, 7, "analysis_type", ach, aAnalysisType);
81 ent->Init(aRepresentation_Name,
82 aRepresentation_Items,
83 aRepresentation_ContextOfItems,
85 aIntendedAnalysisCode,
90 //=======================================================================
91 //function : WriteStep
93 //=======================================================================
95 void RWStepFEA_RWFeaModel::WriteStep (StepData_StepWriter& SW,
96 const Handle(StepFEA_FeaModel) &ent) const
99 // Inherited fields of Representation
101 SW.Send (ent->StepRepr_Representation::Name());
104 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
105 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
110 SW.Send (ent->StepRepr_Representation::ContextOfItems());
112 // Own fields of FeaModel
114 SW.Send (ent->CreatingSoftware());
117 for (Standard_Integer i4=1; i4 <= ent->IntendedAnalysisCode()->Length(); i4++ ) {
118 Handle(TCollection_HAsciiString) Var0 =
119 new TCollection_HAsciiString(ent->IntendedAnalysisCode()->Value(i4));
124 SW.Send (ent->Description());
126 SW.Send (ent->AnalysisType());
129 //=======================================================================
132 //=======================================================================
134 void RWStepFEA_RWFeaModel::Share (const Handle(StepFEA_FeaModel) &ent,
135 Interface_EntityIterator& iter) const
138 // Inherited fields of Representation
140 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
141 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
145 iter.AddItem (ent->StepRepr_Representation::ContextOfItems());
147 // Own fields of FeaModel