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_RWConnectedEdgeSet.ixx> |
19 | #include <StepShape_HArray1OfEdge.hxx> |
20 | #include <StepShape_Edge.hxx> |
21 | |
22 | //======================================================================= |
23 | //function : RWStepShape_RWConnectedEdgeSet |
24 | //purpose : |
25 | //======================================================================= |
26 | |
27 | RWStepShape_RWConnectedEdgeSet::RWStepShape_RWConnectedEdgeSet () |
28 | { |
29 | } |
30 | |
31 | //======================================================================= |
32 | //function : ReadStep |
33 | //purpose : |
34 | //======================================================================= |
35 | |
36 | void RWStepShape_RWConnectedEdgeSet::ReadStep (const Handle(StepData_StepReaderData)& data, |
37 | const Standard_Integer num, |
38 | Handle(Interface_Check)& ach, |
39 | const Handle(StepShape_ConnectedEdgeSet) &ent) const |
40 | { |
41 | // Check number of parameters |
42 | if ( ! data->CheckNbParams(num,2,ach,"connected_edge_set") ) return; |
43 | |
44 | // Inherited fields of RepresentationItem |
45 | |
46 | Handle(TCollection_HAsciiString) aRepresentationItem_Name; |
47 | data->ReadString (num, 1, "representation_item.name", ach, aRepresentationItem_Name); |
48 | |
49 | // Own fields of ConnectedEdgeSet |
50 | |
51 | Handle(StepShape_HArray1OfEdge) aCesEdges; |
52 | Standard_Integer sub2 = 0; |
53 | if ( data->ReadSubList (num, 2, "ces_edges", ach, sub2) ) { |
54 | Standard_Integer num2 = sub2; |
55 | Standard_Integer nb0 = data->NbParams(num2); |
56 | aCesEdges = new StepShape_HArray1OfEdge (1, nb0); |
57 | for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) { |
58 | Handle(StepShape_Edge) anIt0; |
59 | data->ReadEntity (num2, i0, "ces_edges", ach, STANDARD_TYPE(StepShape_Edge), anIt0); |
60 | aCesEdges->SetValue(i0, anIt0); |
61 | } |
62 | } |
63 | |
64 | // Initialize entity |
65 | ent->Init(aRepresentationItem_Name, |
66 | aCesEdges); |
67 | } |
68 | |
69 | //======================================================================= |
70 | //function : WriteStep |
71 | //purpose : |
72 | //======================================================================= |
73 | |
74 | void RWStepShape_RWConnectedEdgeSet::WriteStep (StepData_StepWriter& SW, |
75 | const Handle(StepShape_ConnectedEdgeSet) &ent) const |
76 | { |
77 | |
78 | // Inherited fields of RepresentationItem |
79 | |
80 | SW.Send (ent->StepRepr_RepresentationItem::Name()); |
81 | |
82 | // Own fields of ConnectedEdgeSet |
83 | |
84 | SW.OpenSub(); |
85 | for (Standard_Integer i1=1; i1 <= ent->CesEdges()->Length(); i1++ ) { |
86 | Handle(StepShape_Edge) Var0 = ent->CesEdges()->Value(i1); |
87 | SW.Send (Var0); |
88 | } |
89 | SW.CloseSub(); |
90 | } |
91 | |
92 | //======================================================================= |
93 | //function : Share |
94 | //purpose : |
95 | //======================================================================= |
96 | |
97 | void RWStepShape_RWConnectedEdgeSet::Share (const Handle(StepShape_ConnectedEdgeSet) &ent, |
98 | Interface_EntityIterator& iter) const |
99 | { |
100 | |
101 | // Inherited fields of RepresentationItem |
102 | |
103 | // Own fields of ConnectedEdgeSet |
104 | |
105 | for (Standard_Integer i1=1; i1 <= ent->CesEdges()->Length(); i1++ ) { |
106 | Handle(StepShape_Edge) Var0 = ent->CesEdges()->Value(i1); |
107 | iter.AddItem (Var0); |
108 | } |
109 | } |