1 // Created on: 2015-06-22
2 // Created by: Irina KRYLOVA
3 // Copyright (c) 2015 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 #include <RWStepRepr_RWParallelOffset.hxx>
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>
25 //=======================================================================
26 //function : RWStepRepr_RWParallelOffset
28 //=======================================================================
30 RWStepRepr_RWParallelOffset::RWStepRepr_RWParallelOffset ()
34 //=======================================================================
37 //=======================================================================
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
44 // Check number of parameters
45 if ( ! data->CheckNbParams(num,5,ach,"parallel_offset") ) return;
47 // Inherited fields of ShapeAspect
49 Handle(TCollection_HAsciiString) aShapeAspect_Name;
50 data->ReadString (num, 1, "shape_aspect.name", ach, aShapeAspect_Name);
52 Handle(TCollection_HAsciiString) aShapeAspect_Description;
53 if ( data->IsParamDefined (num,2) ) {
54 data->ReadString (num, 2, "shape_aspect.description", ach, aShapeAspect_Description);
57 Handle(StepRepr_ProductDefinitionShape) aShapeAspect_OfShape;
58 data->ReadEntity (num, 3, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aShapeAspect_OfShape);
60 StepData_Logical aShapeAspect_ProductDefinitional;
61 data->ReadLogical (num, 4, "shape_aspect.product_definitional", ach, aShapeAspect_ProductDefinitional);
63 // Own fields of ParallelOffset
65 Handle(StepBasic_MeasureWithUnit) anOffset;
66 data->ReadEntity (num, 5, "offset", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), anOffset);
69 ent->Init(aShapeAspect_Name,
70 aShapeAspect_Description,
72 aShapeAspect_ProductDefinitional,
76 //=======================================================================
77 //function : WriteStep
79 //=======================================================================
81 void RWStepRepr_RWParallelOffset::WriteStep (StepData_StepWriter& SW,
82 const Handle(StepRepr_ParallelOffset) &ent) const
85 // Inherited fields of ShapeAspect
87 SW.Send (ent->Name());
89 SW.Send (ent->Description());
91 SW.Send (ent->OfShape());
93 SW.SendLogical (ent->ProductDefinitional());
95 SW.Send(ent->Offset());
98 //=======================================================================
101 //=======================================================================
103 void RWStepRepr_RWParallelOffset::Share (const Handle(StepRepr_ParallelOffset) &ent,
104 Interface_EntityIterator& iter) const
107 // Inherited fields of ShapeAspect
109 iter.AddItem (ent->OfShape());