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_RWPerpendicularTo.hxx>
18 #include <Interface_EntityIterator.hxx>
19 #include <StepData_StepReaderData.hxx>
20 #include <StepData_StepWriter.hxx>
21 #include <StepRepr_PerpendicularTo.hxx>
22 #include <StepRepr_ProductDefinitionShape.hxx>
24 //=======================================================================
25 //function : RWStepRepr_RWPerpendicularTo
27 //=======================================================================
29 RWStepRepr_RWPerpendicularTo::RWStepRepr_RWPerpendicularTo ()
33 //=======================================================================
36 //=======================================================================
38 void RWStepRepr_RWPerpendicularTo::ReadStep (const Handle(StepData_StepReaderData)& data,
39 const Standard_Integer num,
40 Handle(Interface_Check)& ach,
41 const Handle(StepRepr_PerpendicularTo) &ent) const
43 // Check number of parameters
44 if ( ! data->CheckNbParams(num,4,ach,"perpendicular_to") ) return;
46 // Inherited fields of ShapeAspect
48 Handle(TCollection_HAsciiString) aShapeAspect_Name;
49 data->ReadString (num, 1, "shape_aspect.name", ach, aShapeAspect_Name);
51 Handle(TCollection_HAsciiString) aShapeAspect_Description;
52 if ( data->IsParamDefined (num,2) ) {
53 data->ReadString (num, 2, "shape_aspect.description", ach, aShapeAspect_Description);
56 Handle(StepRepr_ProductDefinitionShape) aShapeAspect_OfShape;
57 data->ReadEntity (num, 3, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aShapeAspect_OfShape);
59 StepData_Logical aShapeAspect_ProductDefinitional;
60 data->ReadLogical (num, 4, "shape_aspect.product_definitional", ach, aShapeAspect_ProductDefinitional);
63 ent->Init(aShapeAspect_Name,
64 aShapeAspect_Description,
66 aShapeAspect_ProductDefinitional);
69 //=======================================================================
70 //function : WriteStep
72 //=======================================================================
74 void RWStepRepr_RWPerpendicularTo::WriteStep (StepData_StepWriter& SW,
75 const Handle(StepRepr_PerpendicularTo) &ent) const
78 // Inherited fields of ShapeAspect
80 SW.Send (ent->Name());
82 SW.Send (ent->Description());
84 SW.Send (ent->OfShape());
86 SW.SendLogical (ent->ProductDefinitional());
89 //=======================================================================
92 //=======================================================================
94 void RWStepRepr_RWPerpendicularTo::Share (const Handle(StepRepr_PerpendicularTo) &ent,
95 Interface_EntityIterator& iter) const
98 // Inherited fields of ShapeAspect
100 iter.AddItem (ent->OfShape());