1 // Created on: 2003-06-04
2 // Created by: Galina KULIKOVA
3 // Copyright (c) 2003-2014 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 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
18 #include <Interface_Check.hxx>
19 #include <Interface_EntityIterator.hxx>
20 #include <RWStepDimTol_RWTotalRunoutTolerance.hxx>
21 #include <StepBasic_MeasureWithUnit.hxx>
22 #include <StepData_StepReaderData.hxx>
23 #include <StepData_StepWriter.hxx>
24 #include <StepDimTol_TotalRunoutTolerance.hxx>
26 //=======================================================================
27 //function : RWStepDimTol_RWTotalRunoutTolerance
29 //=======================================================================
30 RWStepDimTol_RWTotalRunoutTolerance::RWStepDimTol_RWTotalRunoutTolerance ()
34 //=======================================================================
37 //=======================================================================
39 void RWStepDimTol_RWTotalRunoutTolerance::ReadStep (const Handle(StepData_StepReaderData)& data,
40 const Standard_Integer num,
41 Handle(Interface_Check)& ach,
42 const Handle(StepDimTol_TotalRunoutTolerance) &ent) const
44 // Check number of parameters
45 if ( ! data->CheckNbParams(num,5,ach,"total_runout_tolerance") ) return;
47 // Inherited fields of GeometricTolerance
49 Handle(TCollection_HAsciiString) aGeometricTolerance_Name;
50 data->ReadString (num, 1, "geometric_tolerance.name", ach, aGeometricTolerance_Name);
52 Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
53 data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
55 Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
56 data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
58 StepDimTol_GeometricToleranceTarget aGeometricTolerance_TolerancedShapeAspect;
59 data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, aGeometricTolerance_TolerancedShapeAspect);
61 // Inherited fields of GeometricToleranceWithDatumReference
63 Handle(StepDimTol_HArray1OfDatumSystemOrReference) aGeometricToleranceWithDatumReference_DatumSystem;
64 Standard_Integer sub5 = 0;
65 if ( data->ReadSubList (num, 5, "geometric_tolerance_with_datum_reference.datum_system", ach, sub5) ) {
66 Standard_Integer nb0 = data->NbParams(sub5);
67 aGeometricToleranceWithDatumReference_DatumSystem = new StepDimTol_HArray1OfDatumSystemOrReference (1, nb0);
68 Standard_Integer num2 = sub5;
69 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
70 StepDimTol_DatumSystemOrReference anIt0;
71 data->ReadEntity (num2, i0, "datum_system_or_reference", ach, anIt0);
72 aGeometricToleranceWithDatumReference_DatumSystem->SetValue(i0, anIt0);
77 ent->Init(aGeometricTolerance_Name,
78 aGeometricTolerance_Description,
79 aGeometricTolerance_Magnitude,
80 aGeometricTolerance_TolerancedShapeAspect,
81 aGeometricToleranceWithDatumReference_DatumSystem);
84 //=======================================================================
85 //function : WriteStep
87 //=======================================================================
89 void RWStepDimTol_RWTotalRunoutTolerance::WriteStep (StepData_StepWriter& SW,
90 const Handle(StepDimTol_TotalRunoutTolerance) &ent) const
93 // Inherited fields of GeometricTolerance
95 SW.Send (ent->StepDimTol_GeometricTolerance::Name());
97 SW.Send (ent->StepDimTol_GeometricTolerance::Description());
99 SW.Send (ent->StepDimTol_GeometricTolerance::Magnitude());
101 SW.Send (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect().Value());
103 // Inherited fields of GeometricToleranceWithDatumReference
106 for (Standard_Integer i4=1; i4 <= ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystemAP242()->Length(); i4++ ) {
107 StepDimTol_DatumSystemOrReference Var0 = ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystemAP242()->Value(i4);
108 SW.Send (Var0.Value());
113 //=======================================================================
116 //=======================================================================
118 void RWStepDimTol_RWTotalRunoutTolerance::Share (const Handle(StepDimTol_TotalRunoutTolerance) &ent,
119 Interface_EntityIterator& iter) const
122 // Inherited fields of GeometricTolerance
124 iter.AddItem (ent->StepDimTol_GeometricTolerance::Magnitude());
126 iter.AddItem (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect().Value());
128 // Inherited fields of GeometricToleranceWithDatumReference
130 for (Standard_Integer i3=1; i3 <= ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystemAP242()->Length(); i3++ ) {
131 StepDimTol_DatumSystemOrReference Var0 = ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystemAP242()->Value(i3);
132 iter.AddItem (Var0.Value());