1 // Created on: 2002-12-12
2 // Created by: data exchange team
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
18 #include <Interface_Check.hxx>
19 #include <Interface_EntityIterator.hxx>
20 #include <RWStepFEA_RWFeaModel3d.hxx>
21 #include <StepData_StepReaderData.hxx>
22 #include <StepData_StepWriter.hxx>
23 #include <StepFEA_FeaModel3d.hxx>
24 #include <StepRepr_HArray1OfRepresentationItem.hxx>
25 #include <StepRepr_RepresentationContext.hxx>
26 #include <StepRepr_RepresentationItem.hxx>
27 #include <TCollection_HAsciiString.hxx>
28 #include <TColStd_HArray1OfAsciiString.hxx>
30 //=======================================================================
31 //function : RWStepFEA_RWFeaModel3d
33 //=======================================================================
34 RWStepFEA_RWFeaModel3d::RWStepFEA_RWFeaModel3d ()
38 //=======================================================================
41 //=======================================================================
43 void RWStepFEA_RWFeaModel3d::ReadStep (const Handle(StepData_StepReaderData)& data,
44 const Standard_Integer num,
45 Handle(Interface_Check)& ach,
46 const Handle(StepFEA_FeaModel3d) &ent) const
48 // Check number of parameters
49 if ( ! data->CheckNbParams(num,7,ach,"fea_model3d") ) return;
51 // Inherited fields of Representation
53 Handle(TCollection_HAsciiString) aRepresentation_Name;
54 data->ReadString (num, 1, "representation.name", ach, aRepresentation_Name);
56 Handle(StepRepr_HArray1OfRepresentationItem) aRepresentation_Items;
57 Standard_Integer sub2 = 0;
58 if ( data->ReadSubList (num, 2, "representation.items", ach, sub2) ) {
59 Standard_Integer nb0 = data->NbParams(sub2);
60 aRepresentation_Items = new StepRepr_HArray1OfRepresentationItem (1, nb0);
61 Standard_Integer num2 = sub2;
62 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
63 Handle(StepRepr_RepresentationItem) anIt0;
64 data->ReadEntity (num2, i0, "representation_item", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anIt0);
65 aRepresentation_Items->SetValue(i0, anIt0);
69 Handle(StepRepr_RepresentationContext) aRepresentation_ContextOfItems;
70 data->ReadEntity (num, 3, "representation.context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aRepresentation_ContextOfItems);
72 // Inherited fields of FeaModel
74 Handle(TCollection_HAsciiString) aFeaModel_CreatingSoftware;
75 data->ReadString (num, 4, "fea_model.creating_software", ach, aFeaModel_CreatingSoftware);
77 Handle(TColStd_HArray1OfAsciiString) aFeaModel_IntendedAnalysisCode;
78 Standard_Integer sub5 = 0;
79 if ( data->ReadSubList (num, 5, "fea_model.intended_analysis_code", ach, sub5) ) {
80 Standard_Integer nb0 = data->NbParams(sub5);
81 aFeaModel_IntendedAnalysisCode = new TColStd_HArray1OfAsciiString (1, nb0);
82 Standard_Integer num2 = sub5;
83 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
84 Handle(TCollection_HAsciiString) anIt0;
85 data->ReadString (num2, i0, "h_ascii_string", ach, anIt0);
86 aFeaModel_IntendedAnalysisCode->SetValue(i0, anIt0->String());
90 Handle(TCollection_HAsciiString) aFeaModel_Description;
91 data->ReadString (num, 6, "fea_model.description", ach, aFeaModel_Description);
93 Handle(TCollection_HAsciiString) aFeaModel_AnalysisType;
94 data->ReadString (num, 7, "fea_model.analysis_type", ach, aFeaModel_AnalysisType);
97 ent->Init(aRepresentation_Name,
98 aRepresentation_Items,
99 aRepresentation_ContextOfItems,
100 aFeaModel_CreatingSoftware,
101 aFeaModel_IntendedAnalysisCode,
102 aFeaModel_Description,
103 aFeaModel_AnalysisType);
106 //=======================================================================
107 //function : WriteStep
109 //=======================================================================
111 void RWStepFEA_RWFeaModel3d::WriteStep (StepData_StepWriter& SW,
112 const Handle(StepFEA_FeaModel3d) &ent) const
115 // Inherited fields of Representation
117 SW.Send (ent->StepRepr_Representation::Name());
120 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
121 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
126 SW.Send (ent->StepRepr_Representation::ContextOfItems());
128 // Inherited fields of FeaModel
130 SW.Send (ent->StepFEA_FeaModel::CreatingSoftware());
133 for (Standard_Integer i4=1; i4 <= ent->StepFEA_FeaModel::IntendedAnalysisCode()->Length(); i4++ ) {
134 Handle(TCollection_HAsciiString) Var0 =
135 new TCollection_HAsciiString(ent->StepFEA_FeaModel::IntendedAnalysisCode()->Value(i4));
140 SW.Send (ent->StepFEA_FeaModel::Description());
142 SW.Send (ent->StepFEA_FeaModel::AnalysisType());
145 //=======================================================================
148 //=======================================================================
150 void RWStepFEA_RWFeaModel3d::Share (const Handle(StepFEA_FeaModel3d) &ent,
151 Interface_EntityIterator& iter) const
154 // Inherited fields of Representation
156 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::NbItems(); i1++ ) {
157 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
161 iter.AddItem (ent->StepRepr_Representation::ContextOfItems());
163 // Inherited fields of FeaModel