0027961: Visualization - remove unused and no more working OpenGl_AVIWriter
[occt.git] / src / RWStepShape / RWStepShape_RWSubface.cxx
CommitLineData
b311480e 1// Created on: 2002-01-04
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//
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 <RWStepShape_RWSubface.hxx>
21#include <StepData_StepReaderData.hxx>
22#include <StepData_StepWriter.hxx>
ec357c5c 23#include <StepShape_Face.hxx>
42cf5bc1 24#include <StepShape_FaceBound.hxx>
25#include <StepShape_HArray1OfFaceBound.hxx>
26#include <StepShape_Subface.hxx>
7fd59977 27
28//=======================================================================
29//function : RWStepShape_RWSubface
30//purpose :
31//=======================================================================
7fd59977 32RWStepShape_RWSubface::RWStepShape_RWSubface ()
33{
34}
35
36//=======================================================================
37//function : ReadStep
38//purpose :
39//=======================================================================
40
41void RWStepShape_RWSubface::ReadStep (const Handle(StepData_StepReaderData)& data,
42 const Standard_Integer num,
43 Handle(Interface_Check)& ach,
44 const Handle(StepShape_Subface) &ent) const
45{
46 // Check number of parameters
47 if ( ! data->CheckNbParams(num,3,ach,"subface") ) return;
48
49 // Inherited fields of RepresentationItem
50
51 Handle(TCollection_HAsciiString) aRepresentationItem_Name;
52 data->ReadString (num, 1, "representation_item.name", ach, aRepresentationItem_Name);
53
54 // Inherited fields of Face
55
56 Handle(StepShape_HArray1OfFaceBound) aFace_Bounds;
57 Standard_Integer sub2 = 0;
58 if ( data->ReadSubList (num, 2, "face.bounds", ach, sub2) ) {
59 Standard_Integer num2 = sub2;
60 Standard_Integer nb0 = data->NbParams(num2);
61 aFace_Bounds = new StepShape_HArray1OfFaceBound (1, nb0);
62 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
63 Handle(StepShape_FaceBound) anIt0;
64 data->ReadEntity (num2, i0, "face.bounds", ach, STANDARD_TYPE(StepShape_FaceBound), anIt0);
65 aFace_Bounds->SetValue(i0, anIt0);
66 }
67 }
68
69 // Own fields of Subface
70
71 Handle(StepShape_Face) aParentFace;
72 data->ReadEntity (num, 3, "parent_face", ach, STANDARD_TYPE(StepShape_Face), aParentFace);
73
74 // Initialize entity
75 ent->Init(aRepresentationItem_Name,
76 aFace_Bounds,
77 aParentFace);
78}
79
80//=======================================================================
81//function : WriteStep
82//purpose :
83//=======================================================================
84
85void RWStepShape_RWSubface::WriteStep (StepData_StepWriter& SW,
86 const Handle(StepShape_Subface) &ent) const
87{
88
89 // Inherited fields of RepresentationItem
90
91 SW.Send (ent->StepRepr_RepresentationItem::Name());
92
93 // Inherited fields of Face
94
95 SW.OpenSub();
96 for (Standard_Integer i1=1; i1 <= ent->StepShape_Face::Bounds()->Length(); i1++ ) {
97 Handle(StepShape_FaceBound) Var0 = ent->StepShape_Face::Bounds()->Value(i1);
98 SW.Send (Var0);
99 }
100 SW.CloseSub();
101
102 // Own fields of Subface
103
104 SW.Send (ent->ParentFace());
105}
106
107//=======================================================================
108//function : Share
109//purpose :
110//=======================================================================
111
112void RWStepShape_RWSubface::Share (const Handle(StepShape_Subface) &ent,
113 Interface_EntityIterator& iter) const
114{
115
116 // Inherited fields of RepresentationItem
117
118 // Inherited fields of Face
119
120 for (Standard_Integer i1=1; i1 <= ent->StepShape_Face::Bounds()->Length(); i1++ ) {
121 Handle(StepShape_FaceBound) Var0 = ent->StepShape_Face::Bounds()->Value(i1);
122 iter.AddItem (Var0);
123 }
124
125 // Own fields of Subface
126
127 iter.AddItem (ent->ParentFace());
128}