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