0024947: Redesign OCCT legacy type system -- automatic
[occt.git] / src / RWStepShape / RWStepShape_RWSubedge.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_RWSubedge.ixx>
19 #include <StepShape_Vertex.hxx>
20 #include <StepShape_Edge.hxx>
21
22 //=======================================================================
23 //function : RWStepShape_RWSubedge
24 //purpose  : 
25 //=======================================================================
26
27 RWStepShape_RWSubedge::RWStepShape_RWSubedge ()
28 {
29 }
30
31 //=======================================================================
32 //function : ReadStep
33 //purpose  : 
34 //=======================================================================
35
36 void RWStepShape_RWSubedge::ReadStep (const Handle(StepData_StepReaderData)& data,
37                                       const Standard_Integer num,
38                                       Handle(Interface_Check)& ach,
39                                       const Handle(StepShape_Subedge) &ent) const
40 {
41   // Check number of parameters
42   if ( ! data->CheckNbParams(num,4,ach,"subedge") ) 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->ReadEntity (num, 2, "edge.edge_start", ach, STANDARD_TYPE(StepShape_Vertex), aEdge_EdgeStart);
53
54   Handle(StepShape_Vertex) aEdge_EdgeEnd;
55   data->ReadEntity (num, 3, "edge.edge_end", ach, STANDARD_TYPE(StepShape_Vertex), aEdge_EdgeEnd);
56
57   // Own fields of Subedge
58
59   Handle(StepShape_Edge) aParentEdge;
60   data->ReadEntity (num, 4, "parent_edge", ach, STANDARD_TYPE(StepShape_Edge), aParentEdge);
61
62   // Initialize entity
63   ent->Init(aRepresentationItem_Name,
64             aEdge_EdgeStart,
65             aEdge_EdgeEnd,
66             aParentEdge);
67 }
68
69 //=======================================================================
70 //function : WriteStep
71 //purpose  : 
72 //=======================================================================
73
74 void RWStepShape_RWSubedge::WriteStep (StepData_StepWriter& SW,
75                                        const Handle(StepShape_Subedge) &ent) const
76 {
77
78   // Inherited fields of RepresentationItem
79
80   SW.Send (ent->StepRepr_RepresentationItem::Name());
81
82   // Inherited fields of Edge
83
84   SW.Send (ent->StepShape_Edge::EdgeStart());
85
86   SW.Send (ent->StepShape_Edge::EdgeEnd());
87
88   // Own fields of Subedge
89
90   SW.Send (ent->ParentEdge());
91 }
92
93 //=======================================================================
94 //function : Share
95 //purpose  : 
96 //=======================================================================
97
98 void RWStepShape_RWSubedge::Share (const Handle(StepShape_Subedge) &ent,
99                                    Interface_EntityIterator& iter) const
100 {
101
102   // Inherited fields of RepresentationItem
103
104   // Inherited fields of Edge
105
106   iter.AddItem (ent->StepShape_Edge::EdgeStart());
107
108   iter.AddItem (ent->StepShape_Edge::EdgeEnd());
109
110   // Own fields of Subedge
111
112   iter.AddItem (ent->ParentEdge());
113 }