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 | |
18 | #include <RWStepAP214_RWAppliedGroupAssignment.ixx> |
19 | #include <StepAP214_HArray1OfGroupItem.hxx> |
20 | #include <StepAP214_GroupItem.hxx> |
21 | |
22 | //======================================================================= |
23 | //function : RWStepAP214_RWAppliedGroupAssignment |
24 | //purpose : |
25 | //======================================================================= |
26 | |
27 | RWStepAP214_RWAppliedGroupAssignment::RWStepAP214_RWAppliedGroupAssignment () |
28 | { |
29 | } |
30 | |
31 | //======================================================================= |
32 | //function : ReadStep |
33 | //purpose : |
34 | //======================================================================= |
35 | |
36 | void RWStepAP214_RWAppliedGroupAssignment::ReadStep (const Handle(StepData_StepReaderData)& data, |
37 | const Standard_Integer num, |
38 | Handle(Interface_Check)& ach, |
39 | const Handle(StepAP214_AppliedGroupAssignment) &ent) const |
40 | { |
41 | // Check number of parameters |
42 | if ( ! data->CheckNbParams(num,2,ach,"applied_group_assignment") ) return; |
43 | |
44 | // Inherited fields of GroupAssignment |
45 | |
46 | Handle(StepBasic_Group) aGroupAssignment_AssignedGroup; |
47 | data->ReadEntity (num, 1, "group_assignment.assigned_group", ach, STANDARD_TYPE(StepBasic_Group), aGroupAssignment_AssignedGroup); |
48 | |
49 | // Own fields of AppliedGroupAssignment |
50 | |
45521367 |
51 | Handle(StepAP214_HArray1OfGroupItem) anItems; |
7fd59977 |
52 | Standard_Integer sub2 = 0; |
53 | if ( data->ReadSubList (num, 2, "items", ach, sub2) ) { |
54 | Standard_Integer num2 = sub2; |
55 | Standard_Integer nb0 = data->NbParams(num2); |
45521367 |
56 | if (nb0) |
57 | { |
58 | anItems = new StepAP214_HArray1OfGroupItem (1, nb0); |
59 | for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { |
60 | StepAP214_GroupItem anIt0; |
61 | data->ReadEntity (num2, i0, "items", ach, anIt0); |
62 | anItems->SetValue(i0, anIt0); |
63 | } |
7fd59977 |
64 | } |
65 | } |
7fd59977 |
66 | // Initialize entity |
45521367 |
67 | ent->Init(aGroupAssignment_AssignedGroup, anItems); |
7fd59977 |
68 | } |
69 | |
70 | //======================================================================= |
71 | //function : WriteStep |
72 | //purpose : |
73 | //======================================================================= |
74 | |
75 | void RWStepAP214_RWAppliedGroupAssignment::WriteStep (StepData_StepWriter& SW, |
76 | const Handle(StepAP214_AppliedGroupAssignment) &ent) const |
77 | { |
78 | |
79 | // Inherited fields of GroupAssignment |
80 | |
81 | SW.Send (ent->StepBasic_GroupAssignment::AssignedGroup()); |
82 | |
83 | // Own fields of AppliedGroupAssignment |
84 | |
85 | SW.OpenSub(); |
86 | for (Standard_Integer i1=1; i1 <= ent->Items()->Length(); i1++ ) { |
87 | StepAP214_GroupItem 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 RWStepAP214_RWAppliedGroupAssignment::Share (const Handle(StepAP214_AppliedGroupAssignment) &ent, |
99 | Interface_EntityIterator& iter) const |
100 | { |
101 | |
102 | // Inherited fields of GroupAssignment |
103 | |
104 | iter.AddItem (ent->StepBasic_GroupAssignment::AssignedGroup()); |
105 | |
106 | // Own fields of AppliedGroupAssignment |
45521367 |
107 | if (!ent->Items().IsNull()) |
108 | { |
109 | for (Standard_Integer i2=1; i2 <= ent->Items()->Length(); i2++ ) { |
110 | StepAP214_GroupItem Var0 = ent->Items()->Value(i2); |
111 | iter.AddItem (Var0.Value()); |
112 | } |
7fd59977 |
113 | } |
114 | } |