1 // File: RWStepDimTol_RWGeometricToleranceWithDatumReference.cxx
2 // Created: Wed Jun 4 13:34:35 2003
3 // Author: Galina KULIKOVA
4 // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2
5 // Copyright: Open CASCADE 2002
7 #include <RWStepDimTol_RWGeometricToleranceWithDatumReference.ixx>
8 #include <StepDimTol_HArray1OfDatumReference.hxx>
9 #include <StepDimTol_DatumReference.hxx>
11 //=======================================================================
12 //function : RWStepDimTol_RWGeometricToleranceWithDatumReference
14 //=======================================================================
16 RWStepDimTol_RWGeometricToleranceWithDatumReference::RWStepDimTol_RWGeometricToleranceWithDatumReference ()
20 //=======================================================================
23 //=======================================================================
25 void RWStepDimTol_RWGeometricToleranceWithDatumReference::ReadStep (const Handle(StepData_StepReaderData)& data,
26 const Standard_Integer num,
27 Handle(Interface_Check)& ach,
28 const Handle(StepDimTol_GeometricToleranceWithDatumReference) &ent) const
30 // Check number of parameters
31 if ( ! data->CheckNbParams(num,5,ach,"geometric_tolerance_with_datum_reference") ) return;
33 // Inherited fields of GeometricTolerance
35 Handle(TCollection_HAsciiString) aGeometricTolerance_Name;
36 data->ReadString (num, 1, "geometric_tolerance.name", ach, aGeometricTolerance_Name);
38 Handle(TCollection_HAsciiString) aGeometricTolerance_Description;
39 data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description);
41 Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude;
42 data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude);
44 Handle(StepRepr_ShapeAspect) aGeometricTolerance_TolerancedShapeAspect;
45 data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aGeometricTolerance_TolerancedShapeAspect);
47 // Own fields of GeometricToleranceWithDatumReference
49 Handle(StepDimTol_HArray1OfDatumReference) aDatumSystem;
50 Standard_Integer sub5 = 0;
51 if ( data->ReadSubList (num, 5, "datum_system", ach, sub5) ) {
52 Standard_Integer nb0 = data->NbParams(sub5);
53 aDatumSystem = new StepDimTol_HArray1OfDatumReference (1, nb0);
54 Standard_Integer num2 = sub5;
55 for ( Standard_Integer i0=1; i0 <= nb0; i0++ ) {
56 Handle(StepDimTol_DatumReference) anIt0;
57 data->ReadEntity (num2, i0, "datum_reference", ach, STANDARD_TYPE(StepDimTol_DatumReference), anIt0);
58 aDatumSystem->SetValue(i0, anIt0);
63 ent->Init(aGeometricTolerance_Name,
64 aGeometricTolerance_Description,
65 aGeometricTolerance_Magnitude,
66 aGeometricTolerance_TolerancedShapeAspect,
70 //=======================================================================
71 //function : WriteStep
73 //=======================================================================
75 void RWStepDimTol_RWGeometricToleranceWithDatumReference::WriteStep (StepData_StepWriter& SW,
76 const Handle(StepDimTol_GeometricToleranceWithDatumReference) &ent) const
79 // Inherited fields of GeometricTolerance
81 SW.Send (ent->StepDimTol_GeometricTolerance::Name());
83 SW.Send (ent->StepDimTol_GeometricTolerance::Description());
85 SW.Send (ent->StepDimTol_GeometricTolerance::Magnitude());
87 SW.Send (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect());
89 // Own fields of GeometricToleranceWithDatumReference
92 for (Standard_Integer i4=1; i4 <= ent->DatumSystem()->Length(); i4++ ) {
93 Handle(StepDimTol_DatumReference) Var0 = ent->DatumSystem()->Value(i4);
99 //=======================================================================
102 //=======================================================================
104 void RWStepDimTol_RWGeometricToleranceWithDatumReference::Share (const Handle(StepDimTol_GeometricToleranceWithDatumReference) &ent,
105 Interface_EntityIterator& iter) const
108 // Inherited fields of GeometricTolerance
110 iter.AddItem (ent->StepDimTol_GeometricTolerance::Magnitude());
112 iter.AddItem (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect());
114 // Own fields of GeometricToleranceWithDatumReference
116 for (Standard_Integer i3=1; i3 <= ent->DatumSystem()->Length(); i3++ ) {
117 Handle(StepDimTol_DatumReference) Var0 = ent->DatumSystem()->Value(i3);