0024947: Redesign OCCT legacy type system -- automatic
[occt.git] / src / RWStepShape / RWStepShape_RWConnectedFaceShapeRepresentation.cxx
CommitLineData
b311480e 1// Created on: 2001-12-28
2// Created by: Andrey BETENEV
973c2be1 3// Copyright (c) 2001-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
18#include <RWStepShape_RWConnectedFaceShapeRepresentation.ixx>
19#include <StepRepr_HArray1OfRepresentationItem.hxx>
20#include <StepRepr_RepresentationItem.hxx>
ec357c5c 21#include <StepRepr_RepresentationContext.hxx>
7fd59977 22
23//=======================================================================
24//function : RWStepShape_RWConnectedFaceShapeRepresentation
25//purpose :
26//=======================================================================
27
28RWStepShape_RWConnectedFaceShapeRepresentation::RWStepShape_RWConnectedFaceShapeRepresentation ()
29{
30}
31
32//=======================================================================
33//function : ReadStep
34//purpose :
35//=======================================================================
36
37void RWStepShape_RWConnectedFaceShapeRepresentation::ReadStep (const Handle(StepData_StepReaderData)& data,
38 const Standard_Integer num,
39 Handle(Interface_Check)& ach,
40 const Handle(StepShape_ConnectedFaceShapeRepresentation) &ent) const
41{
42 // Check number of parameters
43 if ( ! data->CheckNbParams(num,3,ach,"connected_face_shape_representation") ) return;
44
45 // Inherited fields of Representation
46
47 Handle(TCollection_HAsciiString) aRepresentation_Name;
48 data->ReadString (num, 1, "representation.name", ach, aRepresentation_Name);
49
50 Handle(StepRepr_HArray1OfRepresentationItem) aRepresentation_Items;
51 Standard_Integer sub2 = 0;
52 if ( data->ReadSubList (num, 2, "representation.items", ach, sub2) ) {
53 Standard_Integer num2 = sub2;
54 Standard_Integer nb0 = data->NbParams(num2);
55 aRepresentation_Items = new StepRepr_HArray1OfRepresentationItem (1, nb0);
56 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
57 Handle(StepRepr_RepresentationItem) anIt0;
58 data->ReadEntity (num2, i0, "representation.items", ach, STANDARD_TYPE(StepRepr_RepresentationItem), anIt0);
59 aRepresentation_Items->SetValue(i0, anIt0);
60 }
61 }
62
63 Handle(StepRepr_RepresentationContext) aRepresentation_ContextOfItems;
64 data->ReadEntity (num, 3, "representation.context_of_items", ach, STANDARD_TYPE(StepRepr_RepresentationContext), aRepresentation_ContextOfItems);
65
66 // Initialize entity
67 ent->Init(aRepresentation_Name,
68 aRepresentation_Items,
69 aRepresentation_ContextOfItems);
70}
71
72//=======================================================================
73//function : WriteStep
74//purpose :
75//=======================================================================
76
77void RWStepShape_RWConnectedFaceShapeRepresentation::WriteStep (StepData_StepWriter& SW,
78 const Handle(StepShape_ConnectedFaceShapeRepresentation) &ent) const
79{
80
81 // Inherited fields of Representation
82
83 SW.Send (ent->StepRepr_Representation::Name());
84
85 SW.OpenSub();
86 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
87 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
88 SW.Send (Var0);
89 }
90 SW.CloseSub();
91
92 SW.Send (ent->StepRepr_Representation::ContextOfItems());
93}
94
95//=======================================================================
96//function : Share
97//purpose :
98//=======================================================================
99
100void RWStepShape_RWConnectedFaceShapeRepresentation::Share (const Handle(StepShape_ConnectedFaceShapeRepresentation) &ent,
101 Interface_EntityIterator& iter) const
102{
103
104 // Inherited fields of Representation
105
106 for (Standard_Integer i1=1; i1 <= ent->StepRepr_Representation::Items()->Length(); i1++ ) {
107 Handle(StepRepr_RepresentationItem) Var0 = ent->StepRepr_Representation::Items()->Value(i1);
108 iter.AddItem (Var0);
109 }
110
111 iter.AddItem (ent->StepRepr_Representation::ContextOfItems());
112}