0024947: Redesign OCCT legacy type system -- automatic
[occt.git] / src / RWStepDimTol / RWStepDimTol_RWGeometricTolerance.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_RWGeometricTolerance.ixx>
ec357c5c 19#include <StepBasic_MeasureWithUnit.hxx>
20#include <StepRepr_ShapeAspect.hxx>
7fd59977 21
22//=======================================================================
23//function : RWStepDimTol_RWGeometricTolerance
24//purpose :
25//=======================================================================
26
27RWStepDimTol_RWGeometricTolerance::RWStepDimTol_RWGeometricTolerance ()
28{
29}
30
31//=======================================================================
32//function : ReadStep
33//purpose :
34//=======================================================================
35
36void RWStepDimTol_RWGeometricTolerance::ReadStep (const Handle(StepData_StepReaderData)& data,
37 const Standard_Integer num,
38 Handle(Interface_Check)& ach,
39 const Handle(StepDimTol_GeometricTolerance) &ent) const
40{
41 // Check number of parameters
42 if ( ! data->CheckNbParams(num,4,ach,"geometric_tolerance") ) return;
43
44 // Own fields of GeometricTolerance
45
46 Handle(TCollection_HAsciiString) aName;
47 data->ReadString (num, 1, "name", ach, aName);
48
49 Handle(TCollection_HAsciiString) aDescription;
50 data->ReadString (num, 2, "description", ach, aDescription);
51
52 Handle(StepBasic_MeasureWithUnit) aMagnitude;
53 data->ReadEntity (num, 3, "magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aMagnitude);
54
55 Handle(StepRepr_ShapeAspect) aTolerancedShapeAspect;
56 data->ReadEntity (num, 4, "toleranced_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aTolerancedShapeAspect);
57
58 // Initialize entity
59 ent->Init(aName,
60 aDescription,
61 aMagnitude,
62 aTolerancedShapeAspect);
63}
64
65//=======================================================================
66//function : WriteStep
67//purpose :
68//=======================================================================
69
70void RWStepDimTol_RWGeometricTolerance::WriteStep (StepData_StepWriter& SW,
71 const Handle(StepDimTol_GeometricTolerance) &ent) const
72{
73
74 // Own fields of GeometricTolerance
75
76 SW.Send (ent->Name());
77
78 SW.Send (ent->Description());
79
80 SW.Send (ent->Magnitude());
81
82 SW.Send (ent->TolerancedShapeAspect());
83}
84
85//=======================================================================
86//function : Share
87//purpose :
88//=======================================================================
89
90void RWStepDimTol_RWGeometricTolerance::Share (const Handle(StepDimTol_GeometricTolerance) &ent,
91 Interface_EntityIterator& iter) const
92{
93
94 // Own fields of GeometricTolerance
95
96 iter.AddItem (ent->Magnitude());
97
98 iter.AddItem (ent->TolerancedShapeAspect());
99}