7fd59977 |
1 | // File: RWStepDimTol_RWCommonDatum.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_RWCommonDatum.ixx> |
8 | #include <StepDimTol_Datum.hxx> |
9 | |
10 | //======================================================================= |
11 | //function : RWStepDimTol_RWCommonDatum |
12 | //purpose : |
13 | //======================================================================= |
14 | |
15 | RWStepDimTol_RWCommonDatum::RWStepDimTol_RWCommonDatum () |
16 | { |
17 | } |
18 | |
19 | //======================================================================= |
20 | //function : ReadStep |
21 | //purpose : |
22 | //======================================================================= |
23 | |
24 | void RWStepDimTol_RWCommonDatum::ReadStep (const Handle(StepData_StepReaderData)& data, |
25 | const Standard_Integer num, |
26 | Handle(Interface_Check)& ach, |
27 | const Handle(StepDimTol_CommonDatum) &ent) const |
28 | { |
29 | // Check number of parameters |
30 | if ( ! data->CheckNbParams(num,9,ach,"common_datum") ) return; |
31 | |
32 | // Inherited fields of ShapeAspect |
33 | |
34 | Handle(TCollection_HAsciiString) aShapeAspect_Name; |
35 | data->ReadString (num, 1, "shape_aspect.name", ach, aShapeAspect_Name); |
36 | |
37 | Handle(TCollection_HAsciiString) aShapeAspect_Description; |
38 | Standard_Boolean hasShapeAspect_Description = Standard_True; |
39 | if ( data->IsParamDefined (num,2) ) { |
40 | data->ReadString (num, 2, "shape_aspect.description", ach, aShapeAspect_Description); |
41 | } |
42 | else { |
43 | hasShapeAspect_Description = Standard_False; |
44 | } |
45 | |
46 | Handle(StepRepr_ProductDefinitionShape) aShapeAspect_OfShape; |
47 | data->ReadEntity (num, 3, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape), aShapeAspect_OfShape); |
48 | |
49 | StepData_Logical aShapeAspect_ProductDefinitional; |
50 | data->ReadLogical (num, 4, "shape_aspect.product_definitional", ach, aShapeAspect_ProductDefinitional); |
51 | |
52 | // Inherited fields of Datum |
53 | |
54 | Handle(TCollection_HAsciiString) aDatum_Name; |
55 | data->ReadString (num, 5, "shape_aspect.name", ach,aDatum_Name); |
56 | |
57 | Handle(TCollection_HAsciiString) aDatum_Description; |
58 | if ( data->IsParamDefined (num,6) ) { |
59 | data->ReadString (num, 6, "shape_aspect.description", ach,aDatum_Description); |
60 | } |
61 | |
62 | Handle(StepRepr_ProductDefinitionShape) aDatum_OfShape; |
63 | data->ReadEntity (num, 7, "shape_aspect.of_shape", ach, STANDARD_TYPE(StepRepr_ProductDefinitionShape),aDatum_OfShape); |
64 | |
65 | StepData_Logical aDatum_ProductDefinitional; |
66 | data->ReadLogical (num, 8, "shape_aspect.product_definitional", ach,aDatum_ProductDefinitional); |
67 | |
68 | // Inherited fields of Datum |
69 | |
70 | Handle(TCollection_HAsciiString) aDatum_Identification; |
71 | data->ReadString (num, 9, "datum.identification", ach, aDatum_Identification); |
72 | |
73 | // Initialize entity |
74 | ent->Init(aShapeAspect_Name, |
75 | aShapeAspect_Description, |
76 | aShapeAspect_OfShape, |
77 | aShapeAspect_ProductDefinitional, |
78 | aDatum_Name, |
79 | aDatum_Description, |
80 | aDatum_OfShape, |
81 | aDatum_ProductDefinitional, |
82 | aDatum_Identification); |
83 | } |
84 | |
85 | //======================================================================= |
86 | //function : WriteStep |
87 | //purpose : |
88 | //======================================================================= |
89 | |
90 | void RWStepDimTol_RWCommonDatum::WriteStep (StepData_StepWriter& SW, |
91 | const Handle(StepDimTol_CommonDatum) &ent) const |
92 | { |
93 | |
94 | // Inherited fields of ShapeAspect |
95 | |
96 | SW.Send (ent->StepRepr_ShapeAspect::Name()); |
97 | |
98 | SW.Send (ent->StepRepr_ShapeAspect::Description()); |
99 | |
100 | SW.Send (ent->StepRepr_ShapeAspect::OfShape()); |
101 | |
102 | SW.SendLogical (ent->StepRepr_ShapeAspect::ProductDefinitional()); |
103 | |
104 | // Inherited fields of Datum->ShapeAspect |
105 | |
106 | SW.Send (ent->Datum()->StepRepr_ShapeAspect::Name()); |
107 | |
108 | SW.Send (ent->Datum()->StepRepr_ShapeAspect::Description()); |
109 | |
110 | SW.Send (ent->Datum()->StepRepr_ShapeAspect::OfShape()); |
111 | |
112 | SW.SendLogical (ent->Datum()->StepRepr_ShapeAspect::ProductDefinitional()); |
113 | |
114 | // Inherited fields of Datum |
115 | |
116 | SW.Send (ent->Datum()->Identification()); |
117 | } |
118 | |
119 | //======================================================================= |
120 | //function : Share |
121 | //purpose : |
122 | //======================================================================= |
123 | |
124 | void RWStepDimTol_RWCommonDatum::Share (const Handle(StepDimTol_CommonDatum) &ent, |
125 | Interface_EntityIterator& iter) const |
126 | { |
127 | |
128 | // Inherited fields of ShapeAspect |
129 | |
130 | iter.AddItem (ent->StepRepr_ShapeAspect::OfShape()); |
131 | |
132 | // Inherited fields of Datum |
133 | |
134 | iter.AddItem (ent->Datum()->StepRepr_ShapeAspect::OfShape()); |
135 | |
136 | } |