7fd59977 |
1 | |
2 | #include <RWStepAP214_RWAutoDesignApprovalAssignment.ixx> |
3 | #include <StepAP214_HArray1OfAutoDesignGeneralOrgItem.hxx> |
4 | #include <StepAP214_AutoDesignGeneralOrgItem.hxx> |
5 | #include <StepBasic_Approval.hxx> |
6 | |
7 | |
8 | #include <Interface_EntityIterator.hxx> |
9 | |
10 | |
11 | #include <StepAP214_AutoDesignApprovalAssignment.hxx> |
12 | |
13 | |
14 | RWStepAP214_RWAutoDesignApprovalAssignment::RWStepAP214_RWAutoDesignApprovalAssignment () {} |
15 | |
16 | void RWStepAP214_RWAutoDesignApprovalAssignment::ReadStep |
17 | (const Handle(StepData_StepReaderData)& data, |
18 | const Standard_Integer num, |
19 | Handle(Interface_Check)& ach, |
20 | const Handle(StepAP214_AutoDesignApprovalAssignment)& ent) const |
21 | { |
22 | |
23 | |
24 | // --- Number of Parameter Control --- |
25 | |
26 | if (!data->CheckNbParams(num,2,ach,"auto_design_approval_assignment")) return; |
27 | |
28 | // --- inherited field : assignedApproval --- |
29 | |
30 | Handle(StepBasic_Approval) aAssignedApproval; |
31 | #ifdef DEB |
32 | Standard_Boolean stat1 = |
33 | #endif |
34 | data->ReadEntity(num, 1,"assigned_approval", ach, STANDARD_TYPE(StepBasic_Approval), aAssignedApproval); |
35 | |
36 | // --- own field : items --- |
37 | |
38 | Handle(StepAP214_HArray1OfAutoDesignGeneralOrgItem) aItems; |
39 | StepAP214_AutoDesignGeneralOrgItem aItemsItem; |
40 | Standard_Integer nsub2; |
41 | if (data->ReadSubList (num,2,"items",ach,nsub2)) { |
42 | Standard_Integer nb2 = data->NbParams(nsub2); |
43 | aItems = new StepAP214_HArray1OfAutoDesignGeneralOrgItem (1, nb2); |
44 | for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) { |
45 | Standard_Boolean stat2 = data->ReadEntity |
46 | (nsub2,i2,"items",ach,aItemsItem); |
47 | if (stat2) aItems->SetValue(i2,aItemsItem); |
48 | } |
49 | } |
50 | |
51 | //--- Initialisation of the read entity --- |
52 | |
53 | |
54 | ent->Init(aAssignedApproval, aItems); |
55 | } |
56 | |
57 | |
58 | void RWStepAP214_RWAutoDesignApprovalAssignment::WriteStep |
59 | (StepData_StepWriter& SW, |
60 | const Handle(StepAP214_AutoDesignApprovalAssignment)& ent) const |
61 | { |
62 | |
63 | // --- inherited field assignedApproval --- |
64 | |
65 | SW.Send(ent->AssignedApproval()); |
66 | |
67 | // --- own field : items --- |
68 | |
69 | SW.OpenSub(); |
70 | for (Standard_Integer i2 = 1; i2 <= ent->NbItems(); i2 ++) { |
71 | SW.Send(ent->ItemsValue(i2).Value()); |
72 | } |
73 | SW.CloseSub(); |
74 | } |
75 | |
76 | |
77 | void RWStepAP214_RWAutoDesignApprovalAssignment::Share(const Handle(StepAP214_AutoDesignApprovalAssignment)& ent, Interface_EntityIterator& iter) const |
78 | { |
79 | |
80 | iter.GetOneItem(ent->AssignedApproval()); |
81 | |
82 | |
83 | Standard_Integer nbElem2 = ent->NbItems(); |
84 | for (Standard_Integer is2=1; is2<=nbElem2; is2 ++) { |
85 | iter.GetOneItem(ent->ItemsValue(is2).Value()); |
86 | } |
87 | |
88 | } |
89 | |