7cfd2711cc8e0399fddfc4f8f1113bc725139a0a
[occt.git] / src / RWStepShape / RWStepShape_RWSeamEdge.cxx
1 // Created on: 2002-01-04
2 // Created by: data exchange team
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 // Generator:   ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.1
17
18 #include <RWStepShape_RWSeamEdge.ixx>
19 #include <StepShape_Edge.hxx>
20 #include <StepGeom_Pcurve.hxx>
21
22 //=======================================================================
23 //function : RWStepShape_RWSeamEdge
24 //purpose  : 
25 //=======================================================================
26
27 RWStepShape_RWSeamEdge::RWStepShape_RWSeamEdge ()
28 {
29 }
30
31 //=======================================================================
32 //function : ReadStep
33 //purpose  : 
34 //=======================================================================
35
36 void RWStepShape_RWSeamEdge::ReadStep (const Handle(StepData_StepReaderData)& data,
37                                        const Standard_Integer num,
38                                        Handle(Interface_Check)& ach,
39                                        const Handle(StepShape_SeamEdge) &ent) const
40 {
41   // Check number of parameters
42   if ( ! data->CheckNbParams(num,6,ach,"seam_edge") ) 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   // Inherited fields of Edge
50
51   Handle(StepShape_Vertex) aEdge_EdgeStart;
52   data->CheckDerived(num, 2, "edge.edge_start", ach,Standard_False);
53
54   Handle(StepShape_Vertex) aEdge_EdgeEnd;
55   data->CheckDerived (num, 3, "edge.edge_end", ach, Standard_False);
56
57   // Inherited fields of OrientedEdge
58
59   Handle(StepShape_Edge) aOrientedEdge_EdgeElement;
60   data->ReadEntity (num, 4, "oriented_edge.edge_element", ach, STANDARD_TYPE(StepShape_Edge), aOrientedEdge_EdgeElement);
61
62   Standard_Boolean aOrientedEdge_Orientation;
63   data->ReadBoolean (num, 5, "oriented_edge.orientation", ach, aOrientedEdge_Orientation);
64
65   // Own fields of SeamEdge
66
67   Handle(StepGeom_Pcurve) aPcurveReference;
68   data->ReadEntity (num, 6, "pcurve_reference", ach, STANDARD_TYPE(StepGeom_Pcurve), aPcurveReference);
69
70   // Initialize entity
71  
72   ent->Init(aRepresentationItem_Name,
73             aOrientedEdge_EdgeElement,
74             aOrientedEdge_Orientation,
75             aPcurveReference);
76 }
77
78 //=======================================================================
79 //function : WriteStep
80 //purpose  : 
81 //=======================================================================
82
83 void RWStepShape_RWSeamEdge::WriteStep (StepData_StepWriter& SW,
84                                         const Handle(StepShape_SeamEdge) &ent) const
85 {
86
87   // Inherited fields of RepresentationItem
88
89   SW.Send (ent->StepRepr_RepresentationItem::Name());
90
91   // Inherited fields of Edge
92
93   SW.Send (ent->StepShape_Edge::EdgeStart());
94
95   SW.Send (ent->StepShape_Edge::EdgeEnd());
96
97   // Inherited fields of OrientedEdge
98
99   SW.Send (ent->StepShape_OrientedEdge::EdgeElement());
100
101   SW.SendBoolean (ent->StepShape_OrientedEdge::Orientation());
102
103   // Own fields of SeamEdge
104
105   SW.Send (ent->PcurveReference());
106 }
107
108 //=======================================================================
109 //function : Share
110 //purpose  : 
111 //=======================================================================
112
113 void RWStepShape_RWSeamEdge::Share (const Handle(StepShape_SeamEdge) &ent,
114                                     Interface_EntityIterator& iter) const
115 {
116
117   // Inherited fields of RepresentationItem
118
119   // Inherited fields of Edge
120
121   iter.AddItem (ent->StepShape_Edge::EdgeStart());
122
123   iter.AddItem (ent->StepShape_Edge::EdgeEnd());
124
125   // Inherited fields of OrientedEdge
126
127   iter.AddItem (ent->StepShape_OrientedEdge::EdgeElement());
128
129   // Own fields of SeamEdge
130
131   iter.AddItem (ent->PcurveReference());
132 }