b311480e |
1 | // Created on: 1999-11-26 |
2 | // Created by: Andrey BETENEV |
3 | // Copyright (c) 1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
b311480e |
16 | |
7fd59977 |
17 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0 |
7fd59977 |
18 | |
42cf5bc1 |
19 | #include <Interface_Check.hxx> |
20 | #include <Interface_EntityIterator.hxx> |
21 | #include <RWStepAP203_RWChangeRequest.hxx> |
22 | #include <StepAP203_ChangeRequest.hxx> |
7fd59977 |
23 | #include <StepAP203_ChangeRequestItem.hxx> |
42cf5bc1 |
24 | #include <StepAP203_HArray1OfChangeRequestItem.hxx> |
ec357c5c |
25 | #include <StepBasic_VersionedActionRequest.hxx> |
42cf5bc1 |
26 | #include <StepData_StepReaderData.hxx> |
27 | #include <StepData_StepWriter.hxx> |
7fd59977 |
28 | |
29 | //======================================================================= |
30 | //function : RWStepAP203_RWChangeRequest |
31 | //purpose : |
32 | //======================================================================= |
7fd59977 |
33 | RWStepAP203_RWChangeRequest::RWStepAP203_RWChangeRequest () |
34 | { |
35 | } |
36 | |
37 | //======================================================================= |
38 | //function : ReadStep |
39 | //purpose : |
40 | //======================================================================= |
41 | |
42 | void RWStepAP203_RWChangeRequest::ReadStep (const Handle(StepData_StepReaderData)& data, |
43 | const Standard_Integer num, |
44 | Handle(Interface_Check)& ach, |
45 | const Handle(StepAP203_ChangeRequest) &ent) const |
46 | { |
47 | // Check number of parameters |
48 | if ( ! data->CheckNbParams(num,2,ach,"change_request") ) return; |
49 | |
50 | // Inherited fields of ActionRequestAssignment |
51 | |
52 | Handle(StepBasic_VersionedActionRequest) aActionRequestAssignment_AssignedActionRequest; |
53 | data->ReadEntity (num, 1, "action_request_assignment.assigned_action_request", ach, STANDARD_TYPE(StepBasic_VersionedActionRequest), aActionRequestAssignment_AssignedActionRequest); |
54 | |
55 | // Own fields of ChangeRequest |
56 | |
57 | Handle(StepAP203_HArray1OfChangeRequestItem) aItems; |
58 | Standard_Integer sub2 = 0; |
59 | if ( data->ReadSubList (num, 2, "items", ach, sub2) ) { |
60 | Standard_Integer num2 = sub2; |
61 | Standard_Integer nb0 = data->NbParams(num2); |
62 | aItems = new StepAP203_HArray1OfChangeRequestItem (1, nb0); |
63 | for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { |
64 | StepAP203_ChangeRequestItem anIt0; |
65 | data->ReadEntity (num2, i0, "items", ach, anIt0); |
66 | aItems->SetValue(i0, anIt0); |
67 | } |
68 | } |
69 | |
70 | // Initialize entity |
71 | ent->Init(aActionRequestAssignment_AssignedActionRequest, |
72 | aItems); |
73 | } |
74 | |
75 | //======================================================================= |
76 | //function : WriteStep |
77 | //purpose : |
78 | //======================================================================= |
79 | |
80 | void RWStepAP203_RWChangeRequest::WriteStep (StepData_StepWriter& SW, |
81 | const Handle(StepAP203_ChangeRequest) &ent) const |
82 | { |
83 | |
84 | // Inherited fields of ActionRequestAssignment |
85 | |
86 | SW.Send (ent->StepBasic_ActionRequestAssignment::AssignedActionRequest()); |
87 | |
88 | // Own fields of ChangeRequest |
89 | |
90 | SW.OpenSub(); |
91 | for (Standard_Integer i1=1; i1 <= ent->Items()->Length(); i1++ ) { |
92 | StepAP203_ChangeRequestItem Var0 = ent->Items()->Value(i1); |
93 | SW.Send (Var0.Value()); |
94 | } |
95 | SW.CloseSub(); |
96 | } |
97 | |
98 | //======================================================================= |
99 | //function : Share |
100 | //purpose : |
101 | //======================================================================= |
102 | |
103 | void RWStepAP203_RWChangeRequest::Share (const Handle(StepAP203_ChangeRequest) &ent, |
104 | Interface_EntityIterator& iter) const |
105 | { |
106 | |
107 | // Inherited fields of ActionRequestAssignment |
108 | |
109 | iter.AddItem (ent->StepBasic_ActionRequestAssignment::AssignedActionRequest()); |
110 | |
111 | // Own fields of ChangeRequest |
112 | |
113 | for (Standard_Integer i2=1; i2 <= ent->Items()->Length(); i2++ ) { |
114 | StepAP203_ChangeRequestItem Var0 = ent->Items()->Value(i2); |
115 | iter.AddItem (Var0.Value()); |
116 | } |
117 | } |