0027232: Configuration - fix mblen missing building issue on Android
[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 <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>
26
27 //=======================================================================
28 //function : RWStepShape_RWSubedge
29 //purpose  : 
30 //=======================================================================
31 RWStepShape_RWSubedge::RWStepShape_RWSubedge ()
32 {
33 }
34
35 //=======================================================================
36 //function : ReadStep
37 //purpose  : 
38 //=======================================================================
39
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
44 {
45   // Check number of parameters
46   if ( ! data->CheckNbParams(num,4,ach,"subedge") ) return;
47
48   // Inherited fields of RepresentationItem
49
50   Handle(TCollection_HAsciiString) aRepresentationItem_Name;
51   data->ReadString (num, 1, "representation_item.name", ach, aRepresentationItem_Name);
52
53   // Inherited fields of Edge
54
55   Handle(StepShape_Vertex) aEdge_EdgeStart;
56   data->ReadEntity (num, 2, "edge.edge_start", ach, STANDARD_TYPE(StepShape_Vertex), aEdge_EdgeStart);
57
58   Handle(StepShape_Vertex) aEdge_EdgeEnd;
59   data->ReadEntity (num, 3, "edge.edge_end", ach, STANDARD_TYPE(StepShape_Vertex), aEdge_EdgeEnd);
60
61   // Own fields of Subedge
62
63   Handle(StepShape_Edge) aParentEdge;
64   data->ReadEntity (num, 4, "parent_edge", ach, STANDARD_TYPE(StepShape_Edge), aParentEdge);
65
66   // Initialize entity
67   ent->Init(aRepresentationItem_Name,
68             aEdge_EdgeStart,
69             aEdge_EdgeEnd,
70             aParentEdge);
71 }
72
73 //=======================================================================
74 //function : WriteStep
75 //purpose  : 
76 //=======================================================================
77
78 void RWStepShape_RWSubedge::WriteStep (StepData_StepWriter& SW,
79                                        const Handle(StepShape_Subedge) &ent) const
80 {
81
82   // Inherited fields of RepresentationItem
83
84   SW.Send (ent->StepRepr_RepresentationItem::Name());
85
86   // Inherited fields of Edge
87
88   SW.Send (ent->StepShape_Edge::EdgeStart());
89
90   SW.Send (ent->StepShape_Edge::EdgeEnd());
91
92   // Own fields of Subedge
93
94   SW.Send (ent->ParentEdge());
95 }
96
97 //=======================================================================
98 //function : Share
99 //purpose  : 
100 //=======================================================================
101
102 void RWStepShape_RWSubedge::Share (const Handle(StepShape_Subedge) &ent,
103                                    Interface_EntityIterator& iter) const
104 {
105
106   // Inherited fields of RepresentationItem
107
108   // Inherited fields of Edge
109
110   iter.AddItem (ent->StepShape_Edge::EdgeStart());
111
112   iter.AddItem (ent->StepShape_Edge::EdgeEnd());
113
114   // Own fields of Subedge
115
116   iter.AddItem (ent->ParentEdge());
117 }