Integration of OCCT 6.5.0 from SVN
[occt.git] / src / RWStepAP214 / RWStepAP214_RWAppliedPersonAndOrganizationAssignment.cxx
1
2 #include <RWStepAP214_RWAppliedPersonAndOrganizationAssignment.ixx>
3 #include <StepAP214_HArray1OfPersonAndOrganizationItem.hxx>
4 #include <StepAP214_PersonAndOrganizationItem.hxx>
5 #include <StepBasic_PersonAndOrganization.hxx>
6 #include <StepBasic_PersonAndOrganizationRole.hxx>
7
8
9 #include <Interface_EntityIterator.hxx>
10
11
12 #include <StepAP214_AppliedPersonAndOrganizationAssignment.hxx>
13
14
15 RWStepAP214_RWAppliedPersonAndOrganizationAssignment::RWStepAP214_RWAppliedPersonAndOrganizationAssignment () {}
16
17 void RWStepAP214_RWAppliedPersonAndOrganizationAssignment::ReadStep
18         (const Handle(StepData_StepReaderData)& data,
19          const Standard_Integer num,
20          Handle(Interface_Check)& ach,
21          const Handle(StepAP214_AppliedPersonAndOrganizationAssignment)& ent) const
22 {
23
24
25   // --- Number of Parameter Control ---
26
27   if (!data->CheckNbParams(num,3,ach,"applied_person_and_organization_assignment")) return;
28
29   // --- inherited field : assignedPersonAndOrganization ---
30   
31   Handle(StepBasic_PersonAndOrganization) aAssignedPersonAndOrganization;
32 #ifdef DEB
33   Standard_Boolean stat1 = 
34 #endif
35     data->ReadEntity(num, 1,"assigned_person_and_organization", ach, STANDARD_TYPE(StepBasic_PersonAndOrganization), aAssignedPersonAndOrganization);
36   
37   // --- inherited field : role ---
38   
39   Handle(StepBasic_PersonAndOrganizationRole) aRole;
40 #ifdef DEB
41   Standard_Boolean stat2 = 
42 #endif
43     data->ReadEntity(num, 2,"role", ach, STANDARD_TYPE(StepBasic_PersonAndOrganizationRole), aRole);
44   
45   // --- own field : items ---
46   
47   Handle(StepAP214_HArray1OfPersonAndOrganizationItem) aItems;
48   StepAP214_PersonAndOrganizationItem aItemsItem;
49   Standard_Integer nsub3;
50   if (data->ReadSubList (num,3,"items",ach,nsub3)) {
51     Standard_Integer nb3 = data->NbParams(nsub3);
52     aItems = new StepAP214_HArray1OfPersonAndOrganizationItem (1, nb3);
53     for (Standard_Integer i3 = 1; i3 <= nb3; i3 ++) {
54       Standard_Boolean stat3 = data->ReadEntity
55         (nsub3,i3,"items",ach,aItemsItem); 
56       if (stat3) aItems->SetValue(i3,aItemsItem);
57     }
58   }
59
60   //--- Initialisation of the read entity ---
61
62
63   ent->Init(aAssignedPersonAndOrganization, aRole, aItems);
64 }
65
66
67 void RWStepAP214_RWAppliedPersonAndOrganizationAssignment::WriteStep
68         (StepData_StepWriter& SW,
69          const Handle(StepAP214_AppliedPersonAndOrganizationAssignment)& ent) const
70 {
71
72   // --- inherited field assignedPersonAndOrganization ---
73
74   SW.Send(ent->AssignedPersonAndOrganization());
75         
76   // --- inherited field role ---
77
78   SW.Send(ent->Role());
79
80   // --- own field : items ---
81
82   SW.OpenSub();
83   for (Standard_Integer i3 = 1;  i3 <= ent->NbItems();  i3 ++) {
84     SW.Send(ent->ItemsValue(i3).Value());
85   }
86   SW.CloseSub();
87 }
88
89
90 void RWStepAP214_RWAppliedPersonAndOrganizationAssignment::Share(const Handle(StepAP214_AppliedPersonAndOrganizationAssignment)& ent, Interface_EntityIterator& iter) const
91 {
92
93   iter.GetOneItem(ent->AssignedPersonAndOrganization());
94   iter.GetOneItem(ent->Role());
95   Standard_Integer nbElem3 = ent->NbItems();
96   for (Standard_Integer is3=1; is3<=nbElem3; is3 ++) {
97     iter.GetOneItem(ent->ItemsValue(is3).Value());
98   }
99
100 }
101