0033018: Coding - get rid of unused headers [Plugin to ShapeAnalysis]
[occt.git] / src / RWStepDimTol / RWStepDimTol_RWSurfaceProfileTolerance.cxx
1 // Created on: 2003-06-04
2 // Created by: Galina KULIKOVA
3 // Copyright (c) 2003-2014 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 // Generator:   ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
17
18 #include <Interface_EntityIterator.hxx>
19 #include <RWStepDimTol_RWSurfaceProfileTolerance.hxx>
20 #include <StepBasic_MeasureWithUnit.hxx>
21 #include <StepData_StepReaderData.hxx>
22 #include <StepData_StepWriter.hxx>
23 #include <StepDimTol_SurfaceProfileTolerance.hxx>
24
25 //=======================================================================
26 //function : RWStepDimTol_RWSurfaceProfileTolerance
27 //purpose  : 
28 //=======================================================================
29 RWStepDimTol_RWSurfaceProfileTolerance::RWStepDimTol_RWSurfaceProfileTolerance ()
30 {
31 }
32
33 //=======================================================================
34 //function : ReadStep
35 //purpose  : 
36 //=======================================================================
37
38 void RWStepDimTol_RWSurfaceProfileTolerance::ReadStep (const Handle(StepData_StepReaderData)& data,
39                                                        const Standard_Integer num,
40                                                        Handle(Interface_Check)& ach,
41                                                        const Handle(StepDimTol_SurfaceProfileTolerance) &ent) const
42 {
43   // Check number of parameters
44   if ( ! data->CheckNbParams(num,4,ach,"surface_profile_tolerance") ) return;
45
46   // Inherited fields of GeometricTolerance
47
48   Handle(TCollection_HAsciiString) aGeometricTolerance_Name;
49   data->ReadString (num, 1, "geometric_tolerance.name", ach, aGeometricTolerance_Name);
50
51   Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
52   data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
53
54   Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
55   data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
56
57   StepDimTol_GeometricToleranceTarget aGeometricTolerance_TolerancedShapeAspect;
58   data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aGeometricTolerance_TolerancedShapeAspect);
59
60   // Initialize entity
61   ent->Init(aGeometricTolerance_Name,
62             aGeometricTolerance_Description,
63             aGeometricTolerance_Magnitude,
64             aGeometricTolerance_TolerancedShapeAspect);
65 }
66
67 //=======================================================================
68 //function : WriteStep
69 //purpose  : 
70 //=======================================================================
71
72 void RWStepDimTol_RWSurfaceProfileTolerance::WriteStep (StepData_StepWriter& SW,
73                                                         const Handle(StepDimTol_SurfaceProfileTolerance) &ent) const
74 {
75
76   // Inherited fields of GeometricTolerance
77
78   SW.Send (ent->StepDimTol_GeometricTolerance::Name());
79
80   SW.Send (ent->StepDimTol_GeometricTolerance::Description());
81
82   SW.Send (ent->StepDimTol_GeometricTolerance::Magnitude());
83
84   SW.Send (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect().Value());
85 }
86
87 //=======================================================================
88 //function : Share
89 //purpose  : 
90 //=======================================================================
91
92 void RWStepDimTol_RWSurfaceProfileTolerance::Share (const Handle(StepDimTol_SurfaceProfileTolerance) &ent,
93                                                     Interface_EntityIterator& iter) const
94 {
95
96   // Inherited fields of GeometricTolerance
97
98   iter.AddItem (ent->StepDimTol_GeometricTolerance::Magnitude());
99
100   iter.AddItem (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect().Value());
101 }