Warnings on vc14 were eliminated
[occt.git] / src / RWStepRepr / RWStepRepr_RWParallelOffset.cxx
1 // Created on: 2015-06-22
2 // Created by: Irina KRYLOVA
3 // Copyright (c) 2015 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 #include <RWStepRepr_RWParallelOffset.hxx>
17
18 #include <Interface_EntityIterator.hxx>
19 #include <StepBasic_MeasureWithUnit.hxx>
20 #include <StepData_StepReaderData.hxx>
21 #include <StepData_StepWriter.hxx>
22 #include <StepRepr_ParallelOffset.hxx>
23 #include <StepRepr_ProductDefinitionShape.hxx>
24
25 //=======================================================================
26 //function : RWStepRepr_RWParallelOffset
27 //purpose  : 
28 //=======================================================================
29
30 RWStepRepr_RWParallelOffset::RWStepRepr_RWParallelOffset ()
31 {
32 }
33
34 //=======================================================================
35 //function : ReadStep
36 //purpose  : 
37 //=======================================================================
38
39 void RWStepRepr_RWParallelOffset::ReadStep (const Handle(StepData_StepReaderData)& data,
40                                             const Standard_Integer num,
41                                             Handle(Interface_Check)& ach,
42                                             const Handle(StepRepr_ParallelOffset) &ent) const
43 {
44   // Check number of parameters
45   if ( ! data->CheckNbParams(num,5,ach,"parallel_offset") ) return;
46
47   // Inherited fields of ShapeAspect
48
49   Handle(TCollection_HAsciiString) aShapeAspect_Name;
50   data->ReadString (num, 1, "shape_aspect.name", ach, aShapeAspect_Name);
51
52   Handle(TCollection_HAsciiString) aShapeAspect_Description;
53   if ( data->IsParamDefined (num,2) ) {
54     data->ReadString (num, 2, "shape_aspect.description", ach, aShapeAspect_Description);
55   }
56
57   Handle(StepRepr_ProductDefinitionShape) aShapeAspect_OfShape;
58   data->ReadEntity (num, 3, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aShapeAspect_OfShape);
59
60   StepData_Logical aShapeAspect_ProductDefinitional;
61   data->ReadLogical (num, 4, "shape_aspect.product_definitional", ach, aShapeAspect_ProductDefinitional);
62   
63   // Own fields of ParallelOffset
64   
65   Handle(StepBasic_MeasureWithUnit) anOffset;
66   data->ReadEntity (num, 5, "offset", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), anOffset);
67
68   // Initialize entity
69   ent->Init(aShapeAspect_Name,
70             aShapeAspect_Description,
71             aShapeAspect_OfShape,
72             aShapeAspect_ProductDefinitional,
73             anOffset);
74 }
75
76 //=======================================================================
77 //function : WriteStep
78 //purpose  : 
79 //=======================================================================
80
81 void RWStepRepr_RWParallelOffset::WriteStep (StepData_StepWriter& SW,
82                                              const Handle(StepRepr_ParallelOffset) &ent) const
83 {
84
85   // Inherited fields of ShapeAspect
86
87   SW.Send (ent->Name());
88
89   SW.Send (ent->Description());
90
91   SW.Send (ent->OfShape());
92
93   SW.SendLogical (ent->ProductDefinitional());
94   
95   SW.Send(ent->Offset());
96 }
97
98 //=======================================================================
99 //function : Share
100 //purpose  : 
101 //=======================================================================
102
103 void RWStepRepr_RWParallelOffset::Share (const Handle(StepRepr_ParallelOffset) &ent,
104                                          Interface_EntityIterator& iter) const
105 {
106
107   // Inherited fields of ShapeAspect
108
109   iter.AddItem (ent->OfShape());
110 }