1 // Created on: 2003-06-04
2 // Created by: Galina KULIKOVA
3 // Copyright (c) 2003-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
20 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
22 #include <RWStepDimTol_RWCoaxialityTolerance.ixx>
23 #include <StepDimTol_HArray1OfDatumReference.hxx>
24 #include <StepDimTol_DatumReference.hxx>
26 //=======================================================================
27 //function : RWStepDimTol_RWCoaxialityTolerance
29 //=======================================================================
31 RWStepDimTol_RWCoaxialityTolerance::RWStepDimTol_RWCoaxialityTolerance ()
35 //=======================================================================
38 //=======================================================================
40 void RWStepDimTol_RWCoaxialityTolerance::ReadStep (const Handle(StepData_StepReaderData)& data,
41 const Standard_Integer num,
42 Handle(Interface_Check)& ach,
43 const Handle(StepDimTol_CoaxialityTolerance) &ent) const
45 // Check number of parameters
46 if ( ! data->CheckNbParams(num,5,ach,"coaxiality_tolerance") ) return;
48 // Inherited fields of GeometricTolerance
50 Handle(TCollection_HAsciiString) aGeometricTolerance_Name;
51 data->ReadString (num, 1, "geometric_tolerance.name", ach, aGeometricTolerance_Name);
53 Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
54 data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
56 Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
57 data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
59 Handle(StepRepr_ShapeAspect) aGeometricTolerance_TolerancedShapeAspect;
60 data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aGeometricTolerance_TolerancedShapeAspect);
62 // Inherited fields of GeometricToleranceWithDatumReference
64 Handle(StepDimTol_HArray1OfDatumReference) aGeometricToleranceWithDatumReference_DatumSystem;
65 Standard_Integer sub5 = 0;
66 if ( data->ReadSubList (num, 5, "geometric_tolerance_with_datum_reference.datum_system", ach, sub5) ) {
67 Standard_Integer nb0 = data->NbParams(sub5);
68 aGeometricToleranceWithDatumReference_DatumSystem = new StepDimTol_HArray1OfDatumReference (1, nb0);
69 Standard_Integer num2 = sub5;
70 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
71 Handle(StepDimTol_DatumReference) anIt0;
72 data->ReadEntity (num2, i0, "datum_reference", ach, STANDARD_TYPE(StepDimTol_DatumReference), anIt0);
73 aGeometricToleranceWithDatumReference_DatumSystem->SetValue(i0, anIt0);
78 ent->Init(aGeometricTolerance_Name,
79 aGeometricTolerance_Description,
80 aGeometricTolerance_Magnitude,
81 aGeometricTolerance_TolerancedShapeAspect,
82 aGeometricToleranceWithDatumReference_DatumSystem);
85 //=======================================================================
86 //function : WriteStep
88 //=======================================================================
90 void RWStepDimTol_RWCoaxialityTolerance::WriteStep (StepData_StepWriter& SW,
91 const Handle(StepDimTol_CoaxialityTolerance) &ent) const
94 // Inherited fields of GeometricTolerance
96 SW.Send (ent->StepDimTol_GeometricTolerance::Name());
98 SW.Send (ent->StepDimTol_GeometricTolerance::Description());
100 SW.Send (ent->StepDimTol_GeometricTolerance::Magnitude());
102 SW.Send (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect());
104 // Inherited fields of GeometricToleranceWithDatumReference
107 for (Standard_Integer i4=1; i4 <= ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystem()->Length(); i4++ ) {
108 Handle(StepDimTol_DatumReference) Var0 = ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystem()->Value(i4);
114 //=======================================================================
117 //=======================================================================
119 void RWStepDimTol_RWCoaxialityTolerance::Share (const Handle(StepDimTol_CoaxialityTolerance) &ent,
120 Interface_EntityIterator& iter) const
123 // Inherited fields of GeometricTolerance
125 iter.AddItem (ent->StepDimTol_GeometricTolerance::Magnitude());
127 iter.AddItem (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect());
129 // Inherited fields of GeometricToleranceWithDatumReference
131 for (Standard_Integer i3=1; i3 <= ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystem()->Length(); i3++ ) {
132 Handle(StepDimTol_DatumReference) Var0 = ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystem()->Value(i3);