b311480e |
1 | // Copyright (c) 1999-2012 OPEN CASCADE SAS |
2 | // |
3 | // The content of this file is subject to the Open CASCADE Technology Public |
4 | // License Version 6.5 (the "License"). You may not use the content of this file |
5 | // except in compliance with the License. Please obtain a copy of the License |
6 | // at http://www.opencascade.org and read it completely before using this file. |
7 | // |
8 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
9 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
10 | // |
11 | // The Original Code and all software distributed under the License is |
12 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
13 | // Initial Developer hereby disclaims all such warranties, including without |
14 | // limitation, any warranties of merchantability, fitness for a particular |
15 | // purpose or non-infringement. Please see the License for the specific terms |
16 | // and conditions governing the rights and limitations under the License. |
17 | |
7fd59977 |
18 | |
19 | #include <RWStepAP214_RWAppliedSecurityClassificationAssignment.ixx> |
20 | #include <StepAP214_HArray1OfSecurityClassificationItem.hxx> |
21 | #include <StepAP214_SecurityClassificationItem.hxx> |
22 | #include <StepBasic_SecurityClassification.hxx> |
23 | |
24 | |
25 | #include <Interface_EntityIterator.hxx> |
26 | |
27 | |
28 | #include <StepAP214_AppliedSecurityClassificationAssignment.hxx> |
29 | |
30 | |
31 | RWStepAP214_RWAppliedSecurityClassificationAssignment::RWStepAP214_RWAppliedSecurityClassificationAssignment () {} |
32 | |
33 | void RWStepAP214_RWAppliedSecurityClassificationAssignment::ReadStep |
34 | (const Handle(StepData_StepReaderData)& data, |
35 | const Standard_Integer num, |
36 | Handle(Interface_Check)& ach, |
37 | const Handle(StepAP214_AppliedSecurityClassificationAssignment)& ent) const |
38 | { |
39 | |
40 | |
41 | // --- Number of Parameter Control --- |
42 | |
43 | if (!data->CheckNbParams(num,2,ach,"applied_security_classification_assignment")) return; |
44 | |
45 | // --- inherited field : assignedSecurityClassification --- |
46 | |
47 | Handle(StepBasic_SecurityClassification) aAssignedSecurityClassification; |
302f96fb |
48 | data->ReadEntity(num, 1,"assigned_security_classification", ach, STANDARD_TYPE(StepBasic_SecurityClassification), aAssignedSecurityClassification); |
7fd59977 |
49 | |
50 | // --- own field : items --- |
51 | |
52 | Handle(StepAP214_HArray1OfSecurityClassificationItem) aItems; |
53 | StepAP214_SecurityClassificationItem anent2; |
54 | Standard_Integer nsub2; |
55 | if (data->ReadSubList (num,2,"items",ach,nsub2)) { |
56 | Standard_Integer nb2 = data->NbParams(nsub2); |
57 | aItems = new StepAP214_HArray1OfSecurityClassificationItem (1, nb2); |
58 | for (Standard_Integer i2 = 1; i2 <= nb2; i2 ++) { |
59 | Standard_Boolean stat2 = data->ReadEntity |
60 | (nsub2, i2,"items", ach, anent2); |
61 | if (stat2) aItems->SetValue(i2, anent2); |
62 | } |
63 | } |
64 | |
65 | //--- Initialisation of the read entity --- |
66 | |
67 | |
68 | ent->Init(aAssignedSecurityClassification, aItems); |
69 | } |
70 | |
71 | |
72 | void RWStepAP214_RWAppliedSecurityClassificationAssignment::WriteStep |
73 | (StepData_StepWriter& SW, |
74 | const Handle(StepAP214_AppliedSecurityClassificationAssignment)& ent) const |
75 | { |
76 | |
77 | // --- inherited field assignedSecurityClassification --- |
78 | |
79 | SW.Send(ent->AssignedSecurityClassification()); |
80 | |
81 | // --- own field : items --- |
82 | |
83 | SW.OpenSub(); |
84 | for (Standard_Integer i2 = 1; i2 <= ent->NbItems(); i2 ++) { |
85 | SW.Send(ent->ItemsValue(i2).Value()); |
86 | } |
87 | SW.CloseSub(); |
88 | } |
89 | |
90 | |
91 | void RWStepAP214_RWAppliedSecurityClassificationAssignment::Share(const Handle(StepAP214_AppliedSecurityClassificationAssignment)& ent, Interface_EntityIterator& iter) const |
92 | { |
93 | |
94 | iter.GetOneItem(ent->AssignedSecurityClassification()); |
95 | |
96 | Standard_Integer nbElem2 = ent->NbItems(); |
97 | for (Standard_Integer is2=1; is2<=nbElem2; is2 ++) { |
98 | iter.GetOneItem(ent->ItemsValue(is2).Value()); |
99 | } |
100 | |
101 | } |
102 | |