b311480e |
1 | // Created on: 2003-06-04 |
2 | // Created by: Galina KULIKOVA |
3 | // Copyright (c) 2003-2012 OPEN CASCADE SAS |
4 | // |
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. |
9 | // |
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. |
12 | // |
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. |
19 | |
7fd59977 |
20 | // Generator: ExpToCas (EXPRESS -> CASCADE/XSTEP Translator) V1.2 |
7fd59977 |
21 | |
22 | #include <RWStepDimTol_RWAngularityTolerance.ixx> |
23 | #include <StepDimTol_HArray1OfDatumReference.hxx> |
24 | #include <StepDimTol_DatumReference.hxx> |
25 | |
26 | //======================================================================= |
27 | //function : RWStepDimTol_RWAngularityTolerance |
28 | //purpose : |
29 | //======================================================================= |
30 | |
31 | RWStepDimTol_RWAngularityTolerance::RWStepDimTol_RWAngularityTolerance () |
32 | { |
33 | } |
34 | |
35 | //======================================================================= |
36 | //function : ReadStep |
37 | //purpose : |
38 | //======================================================================= |
39 | |
40 | void RWStepDimTol_RWAngularityTolerance::ReadStep (const Handle(StepData_StepReaderData)& data, |
41 | const Standard_Integer num, |
42 | Handle(Interface_Check)& ach, |
43 | const Handle(StepDimTol_AngularityTolerance) &ent) const |
44 | { |
45 | // Check number of parameters |
46 | if ( ! data->CheckNbParams(num,5,ach,"angularity_tolerance") ) return; |
47 | |
48 | // Inherited fields of GeometricTolerance |
49 | |
50 | Handle(TCollection_HAsciiString) aGeometricTolerance_Name; |
51 | data->ReadString (num, 1, "geometric_tolerance.name", ach, aGeometricTolerance_Name); |
52 | |
53 | Handle(TCollection_HAsciiString) aGeometricTolerance_Description; |
54 | data->ReadString (num, 2, "geometric_tolerance.description", ach, aGeometricTolerance_Description); |
55 | |
56 | Handle(StepBasic_MeasureWithUnit) aGeometricTolerance_Magnitude; |
57 | data->ReadEntity (num, 3, "geometric_tolerance.magnitude", ach, STANDARD_TYPE(StepBasic_MeasureWithUnit), aGeometricTolerance_Magnitude); |
58 | |
59 | Handle(StepRepr_ShapeAspect) aGeometricTolerance_TolerancedShapeAspect; |
60 | data->ReadEntity (num, 4, "geometric_tolerance.toleranced_shape_aspect", ach, STANDARD_TYPE(StepRepr_ShapeAspect), aGeometricTolerance_TolerancedShapeAspect); |
61 | |
62 | // Inherited fields of GeometricToleranceWithDatumReference |
63 | |
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); |
74 | } |
75 | } |
76 | |
77 | // Initialize entity |
78 | ent->Init(aGeometricTolerance_Name, |
79 | aGeometricTolerance_Description, |
80 | aGeometricTolerance_Magnitude, |
81 | aGeometricTolerance_TolerancedShapeAspect, |
82 | aGeometricToleranceWithDatumReference_DatumSystem); |
83 | } |
84 | |
85 | //======================================================================= |
86 | //function : WriteStep |
87 | //purpose : |
88 | //======================================================================= |
89 | |
90 | void RWStepDimTol_RWAngularityTolerance::WriteStep (StepData_StepWriter& SW, |
91 | const Handle(StepDimTol_AngularityTolerance) &ent) const |
92 | { |
93 | |
94 | // Inherited fields of GeometricTolerance |
95 | |
96 | SW.Send (ent->StepDimTol_GeometricTolerance::Name()); |
97 | |
98 | SW.Send (ent->StepDimTol_GeometricTolerance::Description()); |
99 | |
100 | SW.Send (ent->StepDimTol_GeometricTolerance::Magnitude()); |
101 | |
102 | SW.Send (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect()); |
103 | |
104 | // Inherited fields of GeometricToleranceWithDatumReference |
105 | |
106 | SW.OpenSub(); |
107 | for (Standard_Integer i4=1; i4 <= ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystem()->Length(); i4++ ) { |
108 | Handle(StepDimTol_DatumReference) Var0 = ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystem()->Value(i4); |
109 | SW.Send (Var0); |
110 | } |
111 | SW.CloseSub(); |
112 | } |
113 | |
114 | //======================================================================= |
115 | //function : Share |
116 | //purpose : |
117 | //======================================================================= |
118 | |
119 | void RWStepDimTol_RWAngularityTolerance::Share (const Handle(StepDimTol_AngularityTolerance) &ent, |
120 | Interface_EntityIterator& iter) const |
121 | { |
122 | |
123 | // Inherited fields of GeometricTolerance |
124 | |
125 | iter.AddItem (ent->StepDimTol_GeometricTolerance::Magnitude()); |
126 | |
127 | iter.AddItem (ent->StepDimTol_GeometricTolerance::TolerancedShapeAspect()); |
128 | |
129 | // Inherited fields of GeometricToleranceWithDatumReference |
130 | |
131 | for (Standard_Integer i3=1; i3 <= ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystem()->Length(); i3++ ) { |
132 | Handle(StepDimTol_DatumReference) Var0 = ent->StepDimTol_GeometricToleranceWithDatumReference::DatumSystem()->Value(i3); |
133 | iter.AddItem (Var0); |
134 | } |
135 | } |