0024947: Redesign OCCT legacy type system -- automatic
[occt.git] / src / RWStepDimTol / RWStepDimTol_RWLineProfileTolerance.cxx
CommitLineData
b311480e 1// Created on: 2003-06-04
2// Created by: Galina KULIKOVA
973c2be1 3// Copyright (c) 2003-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 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
973c2be1 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.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
7fd59977 16// Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
7fd59977 17
18#include <RWStepDimTol_RWLineProfileTolerance.ixx>
ec357c5c 19#include <StepBasic_MeasureWithUnit.hxx>
20#include <StepRepr_ShapeAspect.hxx>
7fd59977 21
22//=======================================================================
23//function : RWStepDimTol_RWLineProfileTolerance
24//purpose :
25//=======================================================================
26
27RWStepDimTol_RWLineProfileTolerance::RWStepDimTol_RWLineProfileTolerance ()
28{
29}
30
31//=======================================================================
32//function : ReadStep
33//purpose :
34//=======================================================================
35
36void RWStepDimTol_RWLineProfileTolerance::ReadStep (const Handle(StepData_StepReaderData)& data,
37 const Standard_Integer num,
38 Handle(Interface_Check)& ach,
39 const Handle(StepDimTol_LineProfileTolerance) &ent) const
40{
41 // Check number of parameters
42 if ( ! data->CheckNbParams(num,4,ach,"line_profile_tolerance") ) return;
43
44 // Inherited fields of GeometricTolerance
45
46 Handle(TCollection_HAsciiString) aGeometricTolerance_Name;
47 data->ReadString (num, 1, "geometric_tolerance.name", ach, aGeometricTolerance_Name);
48
49 Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
50 data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
51
52 Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
53 data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
54
55 Handle(StepRepr_ShapeAspect) aGeometricTolerance_TolerancedShapeAspect;
56 data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aGeometricTolerance_TolerancedShapeAspect);
57
58 // Initialize entity
59 ent->Init(aGeometricTolerance_Name,
60 aGeometricTolerance_Description,
61 aGeometricTolerance_Magnitude,
62 aGeometricTolerance_TolerancedShapeAspect);
63}
64
65//=======================================================================
66//function : WriteStep
67//purpose :
68//=======================================================================
69
70void RWStepDimTol_RWLineProfileTolerance::WriteStep (StepData_StepWriter& SW,
71 const Handle(StepDimTol_LineProfileTolerance) &ent) const
72{
73
74 // Inherited fields of GeometricTolerance
75
76 SW.Send (ent->StepDimTol_GeometricTolerance::Name());
77
78 SW.Send (ent->StepDimTol_GeometricTolerance::Description());
79
80 SW.Send (ent->StepDimTol_GeometricTolerance::Magnitude());
81
82 SW.Send (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect());
83}
84
85//=======================================================================
86//function : Share
87//purpose :
88//=======================================================================
89
90void RWStepDimTol_RWLineProfileTolerance::Share (const Handle(StepDimTol_LineProfileTolerance) &ent,
91 Interface_EntityIterator& iter) const
92{
93
94 // Inherited fields of GeometricTolerance
95
96 iter.AddItem (ent->StepDimTol_GeometricTolerance::Magnitude());
97
98 iter.AddItem (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect());
99}