0024023: Revamp the OCCT Handle -- general
[occt.git] / src / RWStepShape / RWStepShape_RWSeamEdge.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
18#include <RWStepShape_RWSeamEdge.ixx>
ec357c5c 19#include <StepShape_Edge.hxx>
c04c30b3 20#include <StepShape_Vertex.hxx>
ec357c5c 21#include <StepGeom_Pcurve.hxx>
7fd59977 22
23//=======================================================================
24//function : RWStepShape_RWSeamEdge
25//purpose :
26//=======================================================================
27
28RWStepShape_RWSeamEdge::RWStepShape_RWSeamEdge ()
29{
30}
31
32//=======================================================================
33//function : ReadStep
34//purpose :
35//=======================================================================
36
37void RWStepShape_RWSeamEdge::ReadStep (const Handle(StepData_StepReaderData)& data,
38 const Standard_Integer num,
39 Handle(Interface_Check)& ach,
40 const Handle(StepShape_SeamEdge) &ent) const
41{
42 // Check number of parameters
43 if ( ! data->CheckNbParams(num,6,ach,"seam_edge") ) return;
44
45 // Inherited fields of RepresentationItem
46
47 Handle(TCollection_HAsciiString) aRepresentationItem_Name;
48 data->ReadString (num, 1, "representation_item.name", ach, aRepresentationItem_Name);
49
50 // Inherited fields of Edge
51
52 Handle(StepShape_Vertex) aEdge_EdgeStart;
53 data->CheckDerived(num, 2, "edge.edge_start", ach,Standard_False);
54
55 Handle(StepShape_Vertex) aEdge_EdgeEnd;
56 data->CheckDerived (num, 3, "edge.edge_end", ach, Standard_False);
57
58 // Inherited fields of OrientedEdge
59
60 Handle(StepShape_Edge) aOrientedEdge_EdgeElement;
61 data->ReadEntity (num, 4, "oriented_edge.edge_element", ach, STANDARD_TYPE(StepShape_Edge), aOrientedEdge_EdgeElement);
62
63 Standard_Boolean aOrientedEdge_Orientation;
64 data->ReadBoolean (num, 5, "oriented_edge.orientation", ach, aOrientedEdge_Orientation);
65
66 // Own fields of SeamEdge
67
68 Handle(StepGeom_Pcurve) aPcurveReference;
69 data->ReadEntity (num, 6, "pcurve_reference", ach, STANDARD_TYPE(StepGeom_Pcurve), aPcurveReference);
70
71 // Initialize entity
72
73 ent->Init(aRepresentationItem_Name,
74 aOrientedEdge_EdgeElement,
75 aOrientedEdge_Orientation,
76 aPcurveReference);
77}
78
79//=======================================================================
80//function : WriteStep
81//purpose :
82//=======================================================================
83
84void RWStepShape_RWSeamEdge::WriteStep (StepData_StepWriter& SW,
85 const Handle(StepShape_SeamEdge) &ent) const
86{
87
88 // Inherited fields of RepresentationItem
89
90 SW.Send (ent->StepRepr_RepresentationItem::Name());
91
92 // Inherited fields of Edge
93
94 SW.Send (ent->StepShape_Edge::EdgeStart());
95
96 SW.Send (ent->StepShape_Edge::EdgeEnd());
97
98 // Inherited fields of OrientedEdge
99
100 SW.Send (ent->StepShape_OrientedEdge::EdgeElement());
101
102 SW.SendBoolean (ent->StepShape_OrientedEdge::Orientation());
103
104 // Own fields of SeamEdge
105
106 SW.Send (ent->PcurveReference());
107}
108
109//=======================================================================
110//function : Share
111//purpose :
112//=======================================================================
113
114void RWStepShape_RWSeamEdge::Share (const Handle(StepShape_SeamEdge) &ent,
115 Interface_EntityIterator& iter) const
116{
117
118 // Inherited fields of RepresentationItem
119
120 // Inherited fields of Edge
121
122 iter.AddItem (ent->StepShape_Edge::EdgeStart());
123
124 iter.AddItem (ent->StepShape_Edge::EdgeEnd());
125
126 // Inherited fields of OrientedEdge
127
128 iter.AddItem (ent->StepShape_OrientedEdge::EdgeElement());
129
130 // Own fields of SeamEdge
131
132 iter.AddItem (ent->PcurveReference());
133}