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 <RWStepFEA_RWElementGroup.ixx>
19 #include <StepFEA_HArray1OfElementRepresentation.hxx>
20 #include <StepFEA_ElementRepresentation.hxx>
21 #include <StepFEA_FeaModel.hxx>
23 //=======================================================================
24 //function : RWStepFEA_RWElementGroup
26 //=======================================================================
28 RWStepFEA_RWElementGroup::RWStepFEA_RWElementGroup ()
32 //=======================================================================
35 //=======================================================================
37 void RWStepFEA_RWElementGroup::ReadStep (const Handle(StepData_StepReaderData)& data,
38 const Standard_Integer num,
39 Handle(Interface_Check)& ach,
40 const Handle(StepFEA_ElementGroup) &ent) const
42 // Check number of parameters
43 if ( ! data->CheckNbParams(num,4,ach,"element_group") ) return;
45 // Inherited fields of Group
47 Handle(TCollection_HAsciiString) aGroup_Name;
48 data->ReadString (num, 1, "group.name", ach, aGroup_Name);
50 Handle(TCollection_HAsciiString) aGroup_Description;
51 data->ReadString (num, 2, "group.description", ach, aGroup_Description);
53 // Inherited fields of FeaGroup
55 Handle(StepFEA_FeaModel) aFeaGroup_ModelRef;
56 data->ReadEntity (num, 3, "fea_group.model_ref", ach, STANDARD_TYPE(StepFEA_FeaModel), aFeaGroup_ModelRef);
58 // Own fields of ElementGroup
60 Handle(StepFEA_HArray1OfElementRepresentation) aElements;
61 Standard_Integer sub4 = 0;
62 if ( data->ReadSubList (num, 4, "elements", ach, sub4) ) {
63 Standard_Integer nb0 = data->NbParams(sub4);
64 aElements = new StepFEA_HArray1OfElementRepresentation (1, nb0);
65 Standard_Integer num2 = sub4;
66 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
67 Handle(StepFEA_ElementRepresentation) anIt0;
68 data->ReadEntity (num2, i0, "element_representation", ach, STANDARD_TYPE(StepFEA_ElementRepresentation), anIt0);
69 aElements->SetValue(i0, anIt0);
74 ent->Init(aGroup_Name,
80 //=======================================================================
81 //function : WriteStep
83 //=======================================================================
85 void RWStepFEA_RWElementGroup::WriteStep (StepData_StepWriter& SW,
86 const Handle(StepFEA_ElementGroup) &ent) const
89 // Inherited fields of Group
91 SW.Send (ent->StepBasic_Group::Name());
93 SW.Send (ent->StepBasic_Group::Description());
95 // Inherited fields of FeaGroup
97 SW.Send (ent->StepFEA_FeaGroup::ModelRef());
99 // Own fields of ElementGroup
102 for (Standard_Integer i3=1; i3 <= ent->Elements()->Length(); i3++ ) {
103 Handle(StepFEA_ElementRepresentation) Var0 = ent->Elements()->Value(i3);
109 //=======================================================================
112 //=======================================================================
114 void RWStepFEA_RWElementGroup::Share (const Handle(StepFEA_ElementGroup) &ent,
115 Interface_EntityIterator& iter) const
118 // Inherited fields of Group
120 // Inherited fields of FeaGroup
122 iter.AddItem (ent->StepFEA_FeaGroup::ModelRef());
124 // Own fields of ElementGroup
126 for (Standard_Integer i2=1; i2 <= ent->Elements()->Length(); i2++ ) {
127 Handle(StepFEA_ElementRepresentation) Var0 = ent->Elements()->Value(i2);