b311480e |
1 | // Created on: 2000-05-10 |
2 | // Created by: Andrey BETENEV |
973c2be1 |
3 | // Copyright (c) 2000-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
7fd59977 |
16 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.1 |
7fd59977 |
17 | |
42cf5bc1 |
18 | #include <Interface_Check.hxx> |
19 | #include <Interface_EntityIterator.hxx> |
20 | #include <RWStepAP214_RWAppliedExternalIdentificationAssignment.hxx> |
21 | #include <StepAP214_AppliedExternalIdentificationAssignment.hxx> |
7fd59977 |
22 | #include <StepAP214_ExternalIdentificationItem.hxx> |
42cf5bc1 |
23 | #include <StepAP214_HArray1OfExternalIdentificationItem.hxx> |
ec357c5c |
24 | #include <StepBasic_ExternalSource.hxx> |
42cf5bc1 |
25 | #include <StepBasic_IdentificationRole.hxx> |
26 | #include <StepData_StepReaderData.hxx> |
27 | #include <StepData_StepWriter.hxx> |
7fd59977 |
28 | |
29 | //======================================================================= |
30 | //function : RWStepAP214_RWAppliedExternalIdentificationAssignment |
31 | //purpose : |
32 | //======================================================================= |
7fd59977 |
33 | RWStepAP214_RWAppliedExternalIdentificationAssignment::RWStepAP214_RWAppliedExternalIdentificationAssignment () |
34 | { |
35 | } |
36 | |
37 | //======================================================================= |
38 | //function : ReadStep |
39 | //purpose : |
40 | //======================================================================= |
41 | |
42 | void RWStepAP214_RWAppliedExternalIdentificationAssignment::ReadStep (const Handle(StepData_StepReaderData)& data, |
43 | const Standard_Integer num, |
44 | Handle(Interface_Check)& ach, |
45 | const Handle(StepAP214_AppliedExternalIdentificationAssignment) &ent) const |
46 | { |
47 | // Check number of parameters |
48 | if ( ! data->CheckNbParams(num,4,ach,"applied_external_identification_assignment") ) return; |
49 | |
50 | // Inherited fields of IdentificationAssignment |
51 | |
52 | Handle(TCollection_HAsciiString) aIdentificationAssignment_AssignedId; |
53 | data->ReadString (num, 1, "identification_assignment.assigned_id", ach, aIdentificationAssignment_AssignedId); |
54 | |
55 | Handle(StepBasic_IdentificationRole) aIdentificationAssignment_Role; |
56 | data->ReadEntity (num, 2, "identification_assignment.role", ach, STANDARD_TYPE(StepBasic_IdentificationRole), aIdentificationAssignment_Role); |
57 | |
58 | // Inherited fields of ExternalIdentificationAssignment |
59 | |
60 | Handle(StepBasic_ExternalSource) aExternalIdentificationAssignment_Source; |
61 | data->ReadEntity (num, 3, "external_identification_assignment.source", ach, STANDARD_TYPE(StepBasic_ExternalSource), aExternalIdentificationAssignment_Source); |
62 | |
63 | // Own fields of AppliedExternalIdentificationAssignment |
64 | |
65 | Handle(StepAP214_HArray1OfExternalIdentificationItem) aItems; |
66 | Standard_Integer sub4 = 0; |
67 | if ( data->ReadSubList (num, 4, "items", ach, sub4) ) { |
68 | Standard_Integer num2 = sub4; |
69 | Standard_Integer nb0 = data->NbParams(num2); |
70 | aItems = new StepAP214_HArray1OfExternalIdentificationItem (1, nb0); |
71 | for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { |
72 | StepAP214_ExternalIdentificationItem anIt0; |
73 | data->ReadEntity (num2, i0, "items", ach, anIt0); |
74 | aItems->SetValue(i0, anIt0); |
75 | } |
76 | } |
77 | |
78 | // Initialize entity |
79 | ent->Init(aIdentificationAssignment_AssignedId, |
80 | aIdentificationAssignment_Role, |
81 | aExternalIdentificationAssignment_Source, |
82 | aItems); |
83 | } |
84 | |
85 | //======================================================================= |
86 | //function : WriteStep |
87 | //purpose : |
88 | //======================================================================= |
89 | |
90 | void RWStepAP214_RWAppliedExternalIdentificationAssignment::WriteStep (StepData_StepWriter& SW, |
91 | const Handle(StepAP214_AppliedExternalIdentificationAssignment) &ent) const |
92 | { |
93 | |
94 | // Inherited fields of IdentificationAssignment |
95 | |
96 | SW.Send (ent->StepBasic_IdentificationAssignment::AssignedId()); |
97 | |
98 | SW.Send (ent->StepBasic_IdentificationAssignment::Role()); |
99 | |
100 | // Inherited fields of ExternalIdentificationAssignment |
101 | |
102 | SW.Send (ent->StepBasic_ExternalIdentificationAssignment::Source()); |
103 | |
104 | // Own fields of AppliedExternalIdentificationAssignment |
105 | |
106 | SW.OpenSub(); |
107 | for (Standard_Integer i3=1; i3 <= ent->Items()->Length(); i3++ ) { |
108 | StepAP214_ExternalIdentificationItem Var0 = ent->Items()->Value(i3); |
109 | SW.Send (Var0.Value()); |
110 | } |
111 | SW.CloseSub(); |
112 | } |
113 | |
114 | //======================================================================= |
115 | //function : Share |
116 | //purpose : |
117 | //======================================================================= |
118 | |
119 | void RWStepAP214_RWAppliedExternalIdentificationAssignment::Share (const Handle(StepAP214_AppliedExternalIdentificationAssignment) &ent, |
120 | Interface_EntityIterator& iter) const |
121 | { |
122 | |
123 | // Inherited fields of IdentificationAssignment |
124 | |
125 | iter.AddItem (ent->StepBasic_IdentificationAssignment::Role()); |
126 | |
127 | // Inherited fields of ExternalIdentificationAssignment |
128 | |
129 | iter.AddItem (ent->StepBasic_ExternalIdentificationAssignment::Source()); |
130 | |
131 | // Own fields of AppliedExternalIdentificationAssignment |
132 | |
133 | for (Standard_Integer i3=1; i3 <= ent->Items()->Length(); i3++ ) { |
134 | StepAP214_ExternalIdentificationItem Var0 = ent->Items()->Value(i3); |
135 | iter.AddItem (Var0.Value()); |
136 | } |
137 | } |