0024157: Parallelization of assembly part of BO
[occt.git] / src / RWStepFEA / RWStepFEA_RWFeaModel3d.cxx
1 // Created on: 2002-12-12
2 // Created by: data exchange team
3 // Copyright (c) 2002-2012 OPEN CASCADE SAS
4 //
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.
9 //
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.
12 //
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.
19
20 // Generator:   ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
21
22 #include <RWStepFEA_RWFeaModel3d.ixx>
23 #include <StepRepr_HArray1OfRepresentationItem.hxx>
24 #include <StepRepr_RepresentationItem.hxx>
25 #include <TColStd_HArray1OfAsciiString.hxx>
26 #include <TCollection_HAsciiString.hxx>
27
28 //=======================================================================
29 //function : RWStepFEA_RWFeaModel3d
30 //purpose  : 
31 //=======================================================================
32
33 RWStepFEA_RWFeaModel3d::RWStepFEA_RWFeaModel3d ()
34 {
35 }
36
37 //=======================================================================
38 //function : ReadStep
39 //purpose  : 
40 //=======================================================================
41
42 void RWStepFEA_RWFeaModel3d::ReadStep (const Handle(StepData_StepReaderData)& data,
43                                        const Standard_Integer num,
44                                        Handle(Interface_Check)& ach,
45                                        const Handle(StepFEA_FeaModel3d) &ent) const
46 {
47   // Check number of parameters
48   if ( ! data->CheckNbParams(num,7,ach,"fea_model3d") ) 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 FeaModel
72
73   Handle(TCollection_HAsciiString) aFeaModel_CreatingSoftware;
74   data->ReadString (num, 4, "fea_model.creating_software", ach, aFeaModel_CreatingSoftware);
75
76   Handle(TColStd_HArray1OfAsciiString) aFeaModel_IntendedAnalysisCode;
77   Standard_Integer sub5 = 0;
78   if ( data->ReadSubList (num, 5, "fea_model.intended_analysis_code", ach, sub5) ) {
79     Standard_Integer nb0 = data->NbParams(sub5);
80     aFeaModel_IntendedAnalysisCode = 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       aFeaModel_IntendedAnalysisCode->SetValue(i0, anIt0->String());
86     }
87   }
88
89   Handle(TCollection_HAsciiString) aFeaModel_Description;
90   data->ReadString (num, 6, "fea_model.description", ach, aFeaModel_Description);
91
92   Handle(TCollection_HAsciiString) aFeaModel_AnalysisType;
93   data->ReadString (num, 7, "fea_model.analysis_type", ach, aFeaModel_AnalysisType);
94
95   // Initialize entity
96   ent->Init(aRepresentation_Name,
97             aRepresentation_Items,
98             aRepresentation_ContextOfItems,
99             aFeaModel_CreatingSoftware,
100             aFeaModel_IntendedAnalysisCode,
101             aFeaModel_Description,
102             aFeaModel_AnalysisType);
103 }
104
105 //=======================================================================
106 //function : WriteStep
107 //purpose  : 
108 //=======================================================================
109
110 void RWStepFEA_RWFeaModel3d::WriteStep (StepData_StepWriter& SW,
111                                         const Handle(StepFEA_FeaModel3d) &ent) const
112 {
113
114   // Inherited fields of Representation
115
116   SW.Send (ent->StepRepr_Representation::Name());
117
118   SW.OpenSub();
119   for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
120     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
121     SW.Send (Var0);
122   }
123   SW.CloseSub();
124
125   SW.Send (ent->StepRepr_Representation::ContextOfItems());
126
127   // Inherited fields of FeaModel
128
129   SW.Send (ent->StepFEA_FeaModel::CreatingSoftware());
130
131   SW.OpenSub();
132   for (Standard_Integer i4=1; i4 <= ent->StepFEA_FeaModel::IntendedAnalysisCode()->Length(); i4++ ) {
133     Handle(TCollection_HAsciiString) Var0 = 
134       new TCollection_HAsciiString(ent->StepFEA_FeaModel::IntendedAnalysisCode()->Value(i4));
135     SW.Send (Var0);
136   }
137   SW.CloseSub();
138
139   SW.Send (ent->StepFEA_FeaModel::Description());
140
141   SW.Send (ent->StepFEA_FeaModel::AnalysisType());
142 }
143
144 //=======================================================================
145 //function : Share
146 //purpose  : 
147 //=======================================================================
148
149 void RWStepFEA_RWFeaModel3d::Share (const Handle(StepFEA_FeaModel3d) &ent,
150                                     Interface_EntityIterator& iter) const
151 {
152
153   // Inherited fields of Representation
154
155   for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
156     Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
157     iter.AddItem (Var0);
158   }
159
160   iter.AddItem (ent->StepRepr_Representation::ContextOfItems());
161
162   // Inherited fields of FeaModel
163 }