7fd59977 |
1 | // File: RWStepDimTol_RWConcentricityTolerance.cxx |
2 | // Created: Wed Jun 4 13:34:34 2003 |
3 | // Author: Galina KULIKOVA |
4 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 |
5 | // Copyright: Open CASCADE 2002 |
6 | |
7 | #include <RWStepDimTol_RWConcentricityTolerance.ixx> |
8 | #include <StepDimTol_HArray1OfDatumReference.hxx> |
9 | #include <StepDimTol_DatumReference.hxx> |
10 | |
11 | //======================================================================= |
12 | //function : RWStepDimTol_RWConcentricityTolerance |
13 | //purpose : |
14 | //======================================================================= |
15 | |
16 | RWStepDimTol_RWConcentricityTolerance::RWStepDimTol_RWConcentricityTolerance () |
17 | { |
18 | } |
19 | |
20 | //======================================================================= |
21 | //function : ReadStep |
22 | //purpose : |
23 | //======================================================================= |
24 | |
25 | void RWStepDimTol_RWConcentricityTolerance::ReadStep (const Handle(StepData_StepReaderData)& data, |
26 | const Standard_Integer num, |
27 | Handle(Interface_Check)& ach, |
28 | const Handle(StepDimTol_ConcentricityTolerance) &ent) const |
29 | { |
30 | // Check number of parameters |
31 | if ( ! data->CheckNbParams(num,5,ach,"concentricity_tolerance") ) return; |
32 | |
33 | // Inherited fields of GeometricTolerance |
34 | |
35 | Handle(TCollection_HAsciiString) aGeometricTolerance_Name; |
36 | data->ReadString (num, 1, "geometric_tolerance.name", ach, aGeometricTolerance_Name); |
37 | |
38 | Handle(TCollection_HAsciiString) aGeometricTolerance_Description; |
39 | data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description); |
40 | |
41 | Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude; |
42 | data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude); |
43 | |
44 | Handle(StepRepr_ShapeAspect) aGeometricTolerance_TolerancedShapeAspect; |
45 | data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aGeometricTolerance_TolerancedShapeAspect); |
46 | |
47 | // Inherited fields of GeometricToleranceWithDatumReference |
48 | |
49 | Handle(StepDimTol_HArray1OfDatumReference) aGeometricToleranceWithDatumReference_DatumSystem; |
50 | Standard_Integer sub5 = 0; |
51 | if ( data->ReadSubList (num, 5, "geometric_tolerance_with_datum_reference.datum_system", ach, sub5) ) { |
52 | Standard_Integer nb0 = data->NbParams(sub5); |
53 | aGeometricToleranceWithDatumReference_DatumSystem = 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 | aGeometricToleranceWithDatumReference_DatumSystem->SetValue(i0, anIt0); |
59 | } |
60 | } |
61 | |
62 | // Initialize entity |
63 | ent->Init(aGeometricTolerance_Name, |
64 | aGeometricTolerance_Description, |
65 | aGeometricTolerance_Magnitude, |
66 | aGeometricTolerance_TolerancedShapeAspect, |
67 | aGeometricToleranceWithDatumReference_DatumSystem); |
68 | } |
69 | |
70 | //======================================================================= |
71 | //function : WriteStep |
72 | //purpose : |
73 | //======================================================================= |
74 | |
75 | void RWStepDimTol_RWConcentricityTolerance::WriteStep (StepData_StepWriter& SW, |
76 | const Handle(StepDimTol_ConcentricityTolerance) &ent) const |
77 | { |
78 | |
79 | // Inherited fields of GeometricTolerance |
80 | |
81 | SW.Send (ent->StepDimTol_GeometricTolerance::Name()); |
82 | |
83 | SW.Send (ent->StepDimTol_GeometricTolerance::Description()); |
84 | |
85 | SW.Send (ent->StepDimTol_GeometricTolerance::Magnitude()); |
86 | |
87 | SW.Send (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect()); |
88 | |
89 | // Inherited fields of GeometricToleranceWithDatumReference |
90 | |
91 | SW.OpenSub(); |
92 | for (Standard_Integer i4=1; i4 <= ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystem()->Length(); i4++ ) { |
93 | Handle(StepDimTol_DatumReference) Var0 = ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystem()->Value(i4); |
94 | SW.Send (Var0); |
95 | } |
96 | SW.CloseSub(); |
97 | } |
98 | |
99 | //======================================================================= |
100 | //function : Share |
101 | //purpose : |
102 | //======================================================================= |
103 | |
104 | void RWStepDimTol_RWConcentricityTolerance::Share (const Handle(StepDimTol_ConcentricityTolerance) &ent, |
105 | Interface_EntityIterator& iter) const |
106 | { |
107 | |
108 | // Inherited fields of GeometricTolerance |
109 | |
110 | iter.AddItem (ent->StepDimTol_GeometricTolerance::Magnitude()); |
111 | |
112 | iter.AddItem (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect()); |
113 | |
114 | // Inherited fields of GeometricToleranceWithDatumReference |
115 | |
116 | for (Standard_Integer i3=1; i3 <= ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystem()->Length(); i3++ ) { |
117 | Handle(StepDimTol_DatumReference) Var0 = ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystem()->Value(i3); |
118 | iter.AddItem (Var0); |
119 | } |
120 | } |