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