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_RWNodeGroup.hxx>
21 #include <StepData_StepReaderData.hxx>
22 #include <StepData_StepWriter.hxx>
23 #include <StepFEA_FeaModel.hxx>
24 #include <StepFEA_HArray1OfNodeRepresentation.hxx>
25 #include <StepFEA_NodeGroup.hxx>
26 #include <StepFEA_NodeRepresentation.hxx>
28 //=======================================================================
29 //function : RWStepFEA_RWNodeGroup
31 //=======================================================================
32 RWStepFEA_RWNodeGroup::RWStepFEA_RWNodeGroup ()
36 //=======================================================================
39 //=======================================================================
41 void RWStepFEA_RWNodeGroup::ReadStep (const Handle(StepData_StepReaderData)& data,
42 const Standard_Integer num,
43 Handle(Interface_Check)& ach,
44 const Handle(StepFEA_NodeGroup) &ent) const
46 // Check number of parameters
47 if ( ! data->CheckNbParams(num,4,ach,"node_group") ) return;
49 // Inherited fields of Group
51 Handle(TCollection_HAsciiString) aGroup_Name;
52 data->ReadString (num, 1, "group.name", ach, aGroup_Name);
54 Handle(TCollection_HAsciiString) aGroup_Description;
55 data->ReadString (num, 2, "group.description", ach, aGroup_Description);
57 // Inherited fields of FeaGroup
59 Handle(StepFEA_FeaModel) aFeaGroup_ModelRef;
60 data->ReadEntity (num, 3, "fea_group.model_ref", ach, STANDARD_TYPE(StepFEA_FeaModel), aFeaGroup_ModelRef);
62 // Own fields of NodeGroup
64 Handle(StepFEA_HArray1OfNodeRepresentation) aNodes;
65 Standard_Integer sub4 = 0;
66 if ( data->ReadSubList (num, 4, "nodes", ach, sub4) ) {
67 Standard_Integer nb0 = data->NbParams(sub4);
68 aNodes = new StepFEA_HArray1OfNodeRepresentation (1, nb0);
69 Standard_Integer num2 = sub4;
70 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
71 Handle(StepFEA_NodeRepresentation) anIt0;
72 data->ReadEntity (num2, i0, "node_representation", ach, STANDARD_TYPE(StepFEA_NodeRepresentation), anIt0);
73 aNodes->SetValue(i0, anIt0);
78 ent->Init(aGroup_Name,
84 //=======================================================================
85 //function : WriteStep
87 //=======================================================================
89 void RWStepFEA_RWNodeGroup::WriteStep (StepData_StepWriter& SW,
90 const Handle(StepFEA_NodeGroup) &ent) const
93 // Inherited fields of Group
95 SW.Send (ent->StepBasic_Group::Name());
97 SW.Send (ent->StepBasic_Group::Description());
99 // Inherited fields of FeaGroup
101 SW.Send (ent->StepFEA_FeaGroup::ModelRef());
103 // Own fields of NodeGroup
106 for (Standard_Integer i3=1; i3 <= ent->Nodes()->Length(); i3++ ) {
107 Handle(StepFEA_NodeRepresentation) Var0 = ent->Nodes()->Value(i3);
113 //=======================================================================
116 //=======================================================================
118 void RWStepFEA_RWNodeGroup::Share (const Handle(StepFEA_NodeGroup) &ent,
119 Interface_EntityIterator& iter) const
122 // Inherited fields of Group
124 // Inherited fields of FeaGroup
126 iter.AddItem (ent->StepFEA_FeaGroup::ModelRef());
128 // Own fields of NodeGroup
130 for (Standard_Integer i2=1; i2 <= ent->Nodes()->Length(); i2++ ) {
131 Handle(StepFEA_NodeRepresentation) Var0 = ent->Nodes()->Value(i2);