1 // Created on: 2002-12-12
2 // Created by: data exchange team
3 // Copyright (c) 2002-2012 OPEN CASCADE SAS
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.
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.
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.
20 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
22 #include <RWStepFEA_RWFeaModel.ixx>
23 #include <StepRepr_HArray1OfRepresentationItem.hxx>
24 #include <StepRepr_RepresentationItem.hxx>
25 #include <TColStd_HArray1OfAsciiString.hxx>
26 #include <TCollection_HAsciiString.hxx>
28 //=======================================================================
29 //function : RWStepFEA_RWFeaModel
31 //=======================================================================
33 RWStepFEA_RWFeaModel::RWStepFEA_RWFeaModel ()
37 //=======================================================================
40 //=======================================================================
42 void RWStepFEA_RWFeaModel::ReadStep (const Handle(StepData_StepReaderData)& data,
43 const Standard_Integer num,
44 Handle(Interface_Check)& ach,
45 const Handle(StepFEA_FeaModel) &ent) const
47 // Check number of parameters
48 if ( ! data->CheckNbParams(num,7,ach,"fea_model") ) return;
50 // Inherited fields of Representation
52 Handle(TCollection_HAsciiString) aRepresentation_Name;
53 data->ReadString (num, 1, "representation.name", ach, aRepresentation_Name);
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);
68 Handle(StepRepr_RepresentationContext) aRepresentation_ContextOfItems;
69 data->ReadEntity (num, 3, "representation.context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aRepresentation_ContextOfItems);
71 // Own fields of FeaModel
73 Handle(TCollection_HAsciiString) aCreatingSoftware;
74 data->ReadString (num, 4, "creating_software", ach, aCreatingSoftware);
76 Handle(TColStd_HArray1OfAsciiString) aIntendedAnalysisCode;
77 Standard_Integer sub5 = 0;
78 if ( data->ReadSubList (num, 5, "intended_analysis_code", ach, sub5) ) {
79 Standard_Integer nb0 = data->NbParams(sub5);
80 aIntendedAnalysisCode = new TColStd_HArray1OfAsciiString (1, nb0);
81 Standard_Integer num2 = sub5;
82 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
83 Handle(TCollection_HAsciiString) anIt0;
84 data->ReadString (num2, i0, "h_ascii_string", ach, anIt0);
85 aIntendedAnalysisCode->SetValue(i0, anIt0->String());
89 Handle(TCollection_HAsciiString) aDescription;
90 data->ReadString (num, 6, "description", ach, aDescription);
92 Handle(TCollection_HAsciiString) aAnalysisType;
93 data->ReadString (num, 7, "analysis_type", ach, aAnalysisType);
96 ent->Init(aRepresentation_Name,
97 aRepresentation_Items,
98 aRepresentation_ContextOfItems,
100 aIntendedAnalysisCode,
105 //=======================================================================
106 //function : WriteStep
108 //=======================================================================
110 void RWStepFEA_RWFeaModel::WriteStep (StepData_StepWriter& SW,
111 const Handle(StepFEA_FeaModel) &ent) const
114 // Inherited fields of Representation
116 SW.Send (ent->StepRepr_Representation::Name());
119 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
120 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
125 SW.Send (ent->StepRepr_Representation::ContextOfItems());
127 // Own fields of FeaModel
129 SW.Send (ent->CreatingSoftware());
132 for (Standard_Integer i4=1; i4 <= ent->IntendedAnalysisCode()->Length(); i4++ ) {
133 Handle(TCollection_HAsciiString) Var0 =
134 new TCollection_HAsciiString(ent->IntendedAnalysisCode()->Value(i4));
139 SW.Send (ent->Description());
141 SW.Send (ent->AnalysisType());
144 //=======================================================================
147 //=======================================================================
149 void RWStepFEA_RWFeaModel::Share (const Handle(StepFEA_FeaModel) &ent,
150 Interface_EntityIterator& iter) const
153 // Inherited fields of Representation
155 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
156 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
160 iter.AddItem (ent->StepRepr_Representation::ContextOfItems());
162 // Own fields of FeaModel