Integration of OCCT 6.5.0 from SVN
[occt.git] / src / RWStepAP214 / RWStepAP214_RWAppliedGroupAssignment.cxx
CommitLineData
7fd59977 1// File: RWStepAP214_RWAppliedGroupAssignment.cxx
2// Created: Wed May 10 15:09:06 2000
3// Author: Andrey BETENEV
4// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.1
5// Copyright: Matra Datavision 2000
6
7#include <RWStepAP214_RWAppliedGroupAssignment.ixx>
8#include <StepAP214_HArray1OfGroupItem.hxx>
9#include <StepAP214_GroupItem.hxx>
10
11//=======================================================================
12//function : RWStepAP214_RWAppliedGroupAssignment
13//purpose :
14//=======================================================================
15
16RWStepAP214_RWAppliedGroupAssignment::RWStepAP214_RWAppliedGroupAssignment ()
17{
18}
19
20//=======================================================================
21//function : ReadStep
22//purpose :
23//=======================================================================
24
25void RWStepAP214_RWAppliedGroupAssignment::ReadStep (const Handle(StepData_StepReaderData)& data,
26 const Standard_Integer num,
27 Handle(Interface_Check)& ach,
28 const Handle(StepAP214_AppliedGroupAssignment) &ent) const
29{
30 // Check number of parameters
31 if ( ! data->CheckNbParams(num,2,ach,"applied_group_assignment") ) return;
32
33 // Inherited fields of GroupAssignment
34
35 Handle(StepBasic_Group) aGroupAssignment_AssignedGroup;
36 data->ReadEntity (num, 1, "group_assignment.assigned_group", ach, STANDARD_TYPE(StepBasic_Group), aGroupAssignment_AssignedGroup);
37
38 // Own fields of AppliedGroupAssignment
39
40 Handle(StepAP214_HArray1OfGroupItem) aItems;
41 Standard_Integer sub2 = 0;
42 if ( data->ReadSubList (num, 2, "items", ach, sub2) ) {
43 Standard_Integer num2 = sub2;
44 Standard_Integer nb0 = data->NbParams(num2);
45 aItems = new StepAP214_HArray1OfGroupItem (1, nb0);
46 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
47 StepAP214_GroupItem anIt0;
48 data->ReadEntity (num2, i0, "items", ach, anIt0);
49 aItems->SetValue(i0, anIt0);
50 }
51 }
52
53 // Initialize entity
54 ent->Init(aGroupAssignment_AssignedGroup,
55 aItems);
56}
57
58//=======================================================================
59//function : WriteStep
60//purpose :
61//=======================================================================
62
63void RWStepAP214_RWAppliedGroupAssignment::WriteStep (StepData_StepWriter& SW,
64 const Handle(StepAP214_AppliedGroupAssignment) &ent) const
65{
66
67 // Inherited fields of GroupAssignment
68
69 SW.Send (ent->StepBasic_GroupAssignment::AssignedGroup());
70
71 // Own fields of AppliedGroupAssignment
72
73 SW.OpenSub();
74 for (Standard_Integer i1=1; i1 <= ent->Items()->Length(); i1++ ) {
75 StepAP214_GroupItem Var0 = ent->Items()->Value(i1);
76 SW.Send (Var0.Value());
77 }
78 SW.CloseSub();
79}
80
81//=======================================================================
82//function : Share
83//purpose :
84//=======================================================================
85
86void RWStepAP214_RWAppliedGroupAssignment::Share (const Handle(StepAP214_AppliedGroupAssignment) &ent,
87 Interface_EntityIterator& iter) const
88{
89
90 // Inherited fields of GroupAssignment
91
92 iter.AddItem (ent->StepBasic_GroupAssignment::AssignedGroup());
93
94 // Own fields of AppliedGroupAssignment
95
96 for (Standard_Integer i2=1; i2 <= ent->Items()->Length(); i2++ ) {
97 StepAP214_GroupItem Var0 = ent->Items()->Value(i2);
98 iter.AddItem (Var0.Value());
99 }
100}