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