0025133: TKOpenGl - Crash on closing a view containing presentations with capping
[occt.git] / src / RWStepAP203 / RWStepAP203_RWChangeRequest.cxx
1 // Created on: 1999-11-26
2 // Created by: Andrey BETENEV
3 // Copyright (c) 1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 // Generator:   ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
18
19 #include <RWStepAP203_RWChangeRequest.ixx>
20 #include <StepAP203_HArray1OfChangeRequestItem.hxx>
21 #include <StepAP203_ChangeRequestItem.hxx>
22
23 //=======================================================================
24 //function : RWStepAP203_RWChangeRequest
25 //purpose  : 
26 //=======================================================================
27
28 RWStepAP203_RWChangeRequest::RWStepAP203_RWChangeRequest ()
29 {
30 }
31
32 //=======================================================================
33 //function : ReadStep
34 //purpose  : 
35 //=======================================================================
36
37 void RWStepAP203_RWChangeRequest::ReadStep (const Handle(StepData_StepReaderData)& data,
38                                             const Standard_Integer num,
39                                             Handle(Interface_Check)& ach,
40                                             const Handle(StepAP203_ChangeRequest) &ent) const
41 {
42   // Check number of parameters
43   if ( ! data->CheckNbParams(num,2,ach,"change_request") ) return;
44
45   // Inherited fields of ActionRequestAssignment
46
47   Handle(StepBasic_VersionedActionRequest) aActionRequestAssignment_AssignedActionRequest;
48   data->ReadEntity (num, 1, "action_request_assignment.assigned_action_request", ach, STANDARD_TYPE(StepBasic_VersionedActionRequest), aActionRequestAssignment_AssignedActionRequest);
49
50   // Own fields of ChangeRequest
51
52   Handle(StepAP203_HArray1OfChangeRequestItem) aItems;
53   Standard_Integer sub2 = 0;
54   if ( data->ReadSubList (num, 2, "items", ach, sub2) ) {
55     Standard_Integer num2 = sub2;
56     Standard_Integer nb0 = data->NbParams(num2);
57     aItems = new StepAP203_HArray1OfChangeRequestItem (1, nb0);
58     for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
59       StepAP203_ChangeRequestItem anIt0;
60       data->ReadEntity (num2, i0, "items", ach, anIt0);
61       aItems->SetValue(i0, anIt0);
62     }
63   }
64
65   // Initialize entity
66   ent->Init(aActionRequestAssignment_AssignedActionRequest,
67             aItems);
68 }
69
70 //=======================================================================
71 //function : WriteStep
72 //purpose  : 
73 //=======================================================================
74
75 void RWStepAP203_RWChangeRequest::WriteStep (StepData_StepWriter& SW,
76                                              const Handle(StepAP203_ChangeRequest) &ent) const
77 {
78
79   // Inherited fields of ActionRequestAssignment
80
81   SW.Send (ent->StepBasic_ActionRequestAssignment::AssignedActionRequest());
82
83   // Own fields of ChangeRequest
84
85   SW.OpenSub();
86   for (Standard_Integer i1=1; i1 <= ent->Items()->Length(); i1++ ) {
87     StepAP203_ChangeRequestItem Var0 = ent->Items()->Value(i1);
88     SW.Send (Var0.Value());
89   }
90   SW.CloseSub();
91 }
92
93 //=======================================================================
94 //function : Share
95 //purpose  : 
96 //=======================================================================
97
98 void RWStepAP203_RWChangeRequest::Share (const Handle(StepAP203_ChangeRequest) &ent,
99                                          Interface_EntityIterator& iter) const
100 {
101
102   // Inherited fields of ActionRequestAssignment
103
104   iter.AddItem (ent->StepBasic_ActionRequestAssignment::AssignedActionRequest());
105
106   // Own fields of ChangeRequest
107
108   for (Standard_Integer i2=1; i2 <= ent->Items()->Length(); i2++ ) {
109     StepAP203_ChangeRequestItem Var0 = ent->Items()->Value(i2);
110     iter.AddItem (Var0.Value());
111   }
112 }