0024428: Implementation of LGPL license
[occt.git] / src / RWStepElement / RWStepElement_RWSurfaceSectionFieldVarying.cxx
CommitLineData
b311480e 1// Created on: 2002-12-12
2// Created by: data exchange team
973c2be1 3// Copyright (c) 2002-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
973c2be1 7// This library is free software; you can redistribute it and / or modify it
8// under the terms of the GNU Lesser General Public version 2.1 as published
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.2
7fd59977 17
18#include <RWStepElement_RWSurfaceSectionFieldVarying.ixx>
19#include <StepElement_HArray1OfSurfaceSection.hxx>
20#include <StepElement_SurfaceSection.hxx>
21
22//=======================================================================
23//function : RWStepElement_RWSurfaceSectionFieldVarying
24//purpose :
25//=======================================================================
26
27RWStepElement_RWSurfaceSectionFieldVarying::RWStepElement_RWSurfaceSectionFieldVarying ()
28{
29}
30
31//=======================================================================
32//function : ReadStep
33//purpose :
34//=======================================================================
35
36void RWStepElement_RWSurfaceSectionFieldVarying::ReadStep (const Handle(StepData_StepReaderData)& data,
37 const Standard_Integer num,
38 Handle(Interface_Check)& ach,
39 const Handle(StepElement_SurfaceSectionFieldVarying) &ent) const
40{
41 // Check number of parameters
42 if ( ! data->CheckNbParams(num,2,ach,"surface_section_field_varying") ) return;
43
44 // Own fields of SurfaceSectionFieldVarying
45
46 Handle(StepElement_HArray1OfSurfaceSection) aDefinitions;
47 Standard_Integer sub1 = 0;
48 if ( data->ReadSubList (num, 1, "definitions", ach, sub1) ) {
49 Standard_Integer nb0 = data->NbParams(sub1);
50 aDefinitions = new StepElement_HArray1OfSurfaceSection (1, nb0);
51 Standard_Integer num2 = sub1;
52 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
53 Handle(StepElement_SurfaceSection) anIt0;
54 data->ReadEntity (num2, i0, "surface_section", ach, STANDARD_TYPE(StepElement_SurfaceSection), anIt0);
55 aDefinitions->SetValue(i0, anIt0);
56 }
57 }
58
59 Standard_Boolean aAdditionalNodeValues;
60 data->ReadBoolean (num, 2, "additional_node_values", ach, aAdditionalNodeValues);
61
62 // Initialize entity
63 ent->Init(aDefinitions,
64 aAdditionalNodeValues);
65}
66
67//=======================================================================
68//function : WriteStep
69//purpose :
70//=======================================================================
71
72void RWStepElement_RWSurfaceSectionFieldVarying::WriteStep (StepData_StepWriter& SW,
73 const Handle(StepElement_SurfaceSectionFieldVarying) &ent) const
74{
75
76 // Own fields of SurfaceSectionFieldVarying
77
78 SW.OpenSub();
79 for (Standard_Integer i0=1; i0 <= ent->Definitions()->Length(); i0++ ) {
80 Handle(StepElement_SurfaceSection) Var0 = ent->Definitions()->Value(i0);
81 SW.Send (Var0);
82 }
83 SW.CloseSub();
84
85 SW.SendBoolean (ent->AdditionalNodeValues());
86}
87
88//=======================================================================
89//function : Share
90//purpose :
91//=======================================================================
92
93void RWStepElement_RWSurfaceSectionFieldVarying::Share (const Handle(StepElement_SurfaceSectionFieldVarying) &ent,
94 Interface_EntityIterator& iter) const
95{
96
97 // Own fields of SurfaceSectionFieldVarying
98
99 for (Standard_Integer i1=1; i1 <= ent->Definitions()->Length(); i1++ ) {
100 Handle(StepElement_SurfaceSection) Var0 = ent->Definitions()->Value(i1);
101 iter.AddItem (Var0);
102 }
103}