1 // Created on: 2000-05-10
2 // Created by: Andrey BETENEV
3 // Copyright (c) 2000-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
20 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.1
22 #include <RWStepAP214_RWAppliedGroupAssignment.ixx>
23 #include <StepAP214_HArray1OfGroupItem.hxx>
24 #include <StepAP214_GroupItem.hxx>
26 //=======================================================================
27 //function : RWStepAP214_RWAppliedGroupAssignment
29 //=======================================================================
31 RWStepAP214_RWAppliedGroupAssignment::RWStepAP214_RWAppliedGroupAssignment ()
35 //=======================================================================
38 //=======================================================================
40 void RWStepAP214_RWAppliedGroupAssignment::ReadStep (const Handle(StepData_StepReaderData)& data,
41 const Standard_Integer num,
42 Handle(Interface_Check)& ach,
43 const Handle(StepAP214_AppliedGroupAssignment) &ent) const
45 // Check number of parameters
46 if ( ! data->CheckNbParams(num,2,ach,"applied_group_assignment") ) return;
48 // Inherited fields of GroupAssignment
50 Handle(StepBasic_Group) aGroupAssignment_AssignedGroup;
51 data->ReadEntity (num, 1, "group_assignment.assigned_group", ach, STANDARD_TYPE(StepBasic_Group), aGroupAssignment_AssignedGroup);
53 // Own fields of AppliedGroupAssignment
55 Handle(StepAP214_HArray1OfGroupItem) anItems;
56 Standard_Integer sub2 = 0;
57 if ( data->ReadSubList (num, 2, "items", ach, sub2) ) {
58 Standard_Integer num2 = sub2;
59 Standard_Integer nb0 = data->NbParams(num2);
62 anItems = new StepAP214_HArray1OfGroupItem (1, nb0);
63 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
64 StepAP214_GroupItem anIt0;
65 data->ReadEntity (num2, i0, "items", ach, anIt0);
66 anItems->SetValue(i0, anIt0);
71 ent->Init(aGroupAssignment_AssignedGroup, anItems);
74 //=======================================================================
75 //function : WriteStep
77 //=======================================================================
79 void RWStepAP214_RWAppliedGroupAssignment::WriteStep (StepData_StepWriter& SW,
80 const Handle(StepAP214_AppliedGroupAssignment) &ent) const
83 // Inherited fields of GroupAssignment
85 SW.Send (ent->StepBasic_GroupAssignment::AssignedGroup());
87 // Own fields of AppliedGroupAssignment
90 for (Standard_Integer i1=1; i1 <= ent->Items()->Length(); i1++ ) {
91 StepAP214_GroupItem Var0 = ent->Items()->Value(i1);
92 SW.Send (Var0.Value());
97 //=======================================================================
100 //=======================================================================
102 void RWStepAP214_RWAppliedGroupAssignment::Share (const Handle(StepAP214_AppliedGroupAssignment) &ent,
103 Interface_EntityIterator& iter) const
106 // Inherited fields of GroupAssignment
108 iter.AddItem (ent->StepBasic_GroupAssignment::AssignedGroup());
110 // Own fields of AppliedGroupAssignment
111 if (!ent->Items().IsNull())
113 for (Standard_Integer i2=1; i2 <= ent->Items()->Length(); i2++ ) {
114 StepAP214_GroupItem Var0 = ent->Items()->Value(i2);
115 iter.AddItem (Var0.Value());