1 // Created on: 2002-01-04
2 // Created by: data exchange team
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.1
18 #include <Interface_Check.hxx>
19 #include <Interface_EntityIterator.hxx>
20 #include <RWStepShape_RWSubedge.hxx>
21 #include <StepData_StepReaderData.hxx>
22 #include <StepData_StepWriter.hxx>
23 #include <StepShape_Edge.hxx>
24 #include <StepShape_Subedge.hxx>
25 #include <StepShape_Vertex.hxx>
27 //=======================================================================
28 //function : RWStepShape_RWSubedge
30 //=======================================================================
31 RWStepShape_RWSubedge::RWStepShape_RWSubedge ()
35 //=======================================================================
38 //=======================================================================
40 void RWStepShape_RWSubedge::ReadStep (const Handle(StepData_StepReaderData)& data,
41 const Standard_Integer num,
42 Handle(Interface_Check)& ach,
43 const Handle(StepShape_Subedge) &ent) const
45 // Check number of parameters
46 if ( ! data->CheckNbParams(num,4,ach,"subedge") ) return;
48 // Inherited fields of RepresentationItem
50 Handle(TCollection_HAsciiString) aRepresentationItem_Name;
51 data->ReadString (num, 1, "representation_item.name", ach, aRepresentationItem_Name);
53 // Inherited fields of Edge
55 Handle(StepShape_Vertex) aEdge_EdgeStart;
56 data->ReadEntity (num, 2, "edge.edge_start", ach, STANDARD_TYPE(StepShape_Vertex), aEdge_EdgeStart);
58 Handle(StepShape_Vertex) aEdge_EdgeEnd;
59 data->ReadEntity (num, 3, "edge.edge_end", ach, STANDARD_TYPE(StepShape_Vertex), aEdge_EdgeEnd);
61 // Own fields of Subedge
63 Handle(StepShape_Edge) aParentEdge;
64 data->ReadEntity (num, 4, "parent_edge", ach, STANDARD_TYPE(StepShape_Edge), aParentEdge);
67 ent->Init(aRepresentationItem_Name,
73 //=======================================================================
74 //function : WriteStep
76 //=======================================================================
78 void RWStepShape_RWSubedge::WriteStep (StepData_StepWriter& SW,
79 const Handle(StepShape_Subedge) &ent) const
82 // Inherited fields of RepresentationItem
84 SW.Send (ent->StepRepr_RepresentationItem::Name());
86 // Inherited fields of Edge
88 SW.Send (ent->StepShape_Edge::EdgeStart());
90 SW.Send (ent->StepShape_Edge::EdgeEnd());
92 // Own fields of Subedge
94 SW.Send (ent->ParentEdge());
97 //=======================================================================
100 //=======================================================================
102 void RWStepShape_RWSubedge::Share (const Handle(StepShape_Subedge) &ent,
103 Interface_EntityIterator& iter) const
106 // Inherited fields of RepresentationItem
108 // Inherited fields of Edge
110 iter.AddItem (ent->StepShape_Edge::EdgeStart());
112 iter.AddItem (ent->StepShape_Edge::EdgeEnd());
114 // Own fields of Subedge
116 iter.AddItem (ent->ParentEdge());