0024947: Redesign OCCT legacy type system -- automatic
[occt.git] / src / RWStepGeom / RWStepGeom_RWCurveBoundedSurface.cxx
CommitLineData
b311480e 1// Created on: 1999-11-26
2// Created by: Andrey BETENEV
3// Copyright (c) 1999 Matra Datavision
973c2be1 4// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 5//
973c2be1 6// This file is part of Open CASCADE Technology software library.
b311480e 7//
d5f74e42 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
973c2be1 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.
b311480e 13//
973c2be1 14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
b311480e 16
7fd59977 17// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.0
7fd59977 18
19#include <RWStepGeom_RWCurveBoundedSurface.ixx>
20#include <StepGeom_HArray1OfSurfaceBoundary.hxx>
21#include <StepGeom_SurfaceBoundary.hxx>
ec357c5c 22#include <StepGeom_Surface.hxx>
7fd59977 23
24//=======================================================================
25//function : RWStepGeom_RWCurveBoundedSurface
26//purpose :
27//=======================================================================
28
29RWStepGeom_RWCurveBoundedSurface::RWStepGeom_RWCurveBoundedSurface ()
30{
31}
32
33//=======================================================================
34//function : ReadStep
35//purpose :
36//=======================================================================
37
38void RWStepGeom_RWCurveBoundedSurface::ReadStep (const Handle(StepData_StepReaderData)& data,
39 const Standard_Integer num,
40 Handle(Interface_Check)& ach,
41 const Handle(StepGeom_CurveBoundedSurface) &ent) const
42{
43 // Check number of parameters
44 if ( ! data->CheckNbParams(num,4,ach,"curve_bounded_surface") ) return;
45
46 // Inherited fields of RepresentationItem
47
48 Handle(TCollection_HAsciiString) aRepresentationItem_Name;
49 data->ReadString (num, 1, "representation_item.name", ach, aRepresentationItem_Name);
50
51 // Own fields of CurveBoundedSurface
52
53 Handle(StepGeom_Surface) aBasisSurface;
54 data->ReadEntity (num, 2, "basis_surface", ach, STANDARD_TYPE(StepGeom_Surface), aBasisSurface);
55
56 Handle(StepGeom_HArray1OfSurfaceBoundary) aBoundaries;
57 Standard_Integer sub3 = 0;
58 if ( data->ReadSubList (num, 3, "boundaries", ach, sub3) ) {
59 Standard_Integer num2 = sub3;
60 Standard_Integer nb0 = data->NbParams(num2);
61 aBoundaries = new StepGeom_HArray1OfSurfaceBoundary (1, nb0);
62 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
63 StepGeom_SurfaceBoundary anIt0;
64 data->ReadEntity (num2, i0, "boundaries", ach, anIt0);
65 aBoundaries->SetValue(i0, anIt0);
66 }
67 }
68
69 Standard_Boolean aImplicitOuter;
70 data->ReadBoolean (num, 4, "implicit_outer", ach, aImplicitOuter);
71
72 // Initialize entity
73 ent->Init(aRepresentationItem_Name,
74 aBasisSurface,
75 aBoundaries,
76 aImplicitOuter);
77}
78
79//=======================================================================
80//function : WriteStep
81//purpose :
82//=======================================================================
83
84void RWStepGeom_RWCurveBoundedSurface::WriteStep (StepData_StepWriter& SW,
85 const Handle(StepGeom_CurveBoundedSurface) &ent) const
86{
87
88 // Inherited fields of RepresentationItem
89
90 SW.Send (ent->StepRepr_RepresentationItem::Name());
91
92 // Own fields of CurveBoundedSurface
93
94 SW.Send (ent->BasisSurface());
95
96 SW.OpenSub();
97 for (Standard_Integer i2=1; i2 <= ent->Boundaries()->Length(); i2++ ) {
98 StepGeom_SurfaceBoundary Var0 = ent->Boundaries()->Value(i2);
99 SW.Send (Var0.Value());
100 }
101 SW.CloseSub();
102
103 SW.SendBoolean (ent->ImplicitOuter());
104}
105
106//=======================================================================
107//function : Share
108//purpose :
109//=======================================================================
110
111void RWStepGeom_RWCurveBoundedSurface::Share (const Handle(StepGeom_CurveBoundedSurface) &ent,
112 Interface_EntityIterator& iter) const
113{
114
115 // Inherited fields of RepresentationItem
116
117 // Own fields of CurveBoundedSurface
118
119 iter.AddItem (ent->BasisSurface());
120
121 for (Standard_Integer i2=1; i2 <= ent->Boundaries()->Length(); i2++ ) {
122 StepGeom_SurfaceBoundary Var0 = ent->Boundaries()->Value(i2);
123 iter.AddItem (Var0.Value());
124 }
125}